/* Bottom Navigation */
.bottom-nav {
    flex: 0 0 auto;
    height: calc(60px + env(safe-area-inset-bottom));
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 50;
    padding: 0 40px env(safe-area-inset-bottom) 40px;
    box-sizing: border-box;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-top: 12px; /* Reduced spacing */
    
    /* Safe area support for iPhone */
    padding-left: max(40px, env(safe-area-inset-left));
    padding-right: max(40px, env(safe-area-inset-right));
}

/* Hide bottom navigation when not in Telegram */
.bottom-nav.web-hidden {
    display: none;
}

/* Desktop navigation width limitation */
@media (min-width: 600px) {
    .bottom-nav {
        max-width: 480px;
        width: 480px;
        margin-left: auto;
        margin-right: auto;
        position: relative;
    }
}

.bottom-nav.hidden {
    transform: translateY(100%);
    opacity: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px;
    width: 44px;
    height: 44px;
}

.nav-item.active {
    transform: scale(1.1);
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s ease;
}

.nav-icon img {
    transition: all 0.2s ease;
}

.nav-item.active .nav-icon img {
    filter: brightness(1) sepia(1) saturate(3) hue-rotate(200deg) contrast(0.2);
}

.create-nav-item {
    background: transparent;
    color: var(--tg-text);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-nav-item:active {
    transform: scale(0.9);
}

/* Content padding - no longer needed with flexbox layout */
.categories-container,
.my-interviews-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* My Interviews Styles */
.my-interviews-container {
    color: var(--tg-text);
}

.stats-section {
    margin-bottom: 32px;
}

.stats-section h2 {
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--tg-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: var(--card-bg);
    border: 1px solid rgba(34, 158, 217, 0.18);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-color-light);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-blue);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--tg-hint);
}

.interviews-section h2 {
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--tg-text);
}

.interviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.interview-card {
    background: var(--card-bg);
    border: 1px solid rgba(34, 158, 217, 0.18);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px var(--shadow-color-light);
    transition: all 0.2s ease;
}

.interview-card:active {
    transform: scale(0.98);
}

.interview-info {
    flex: 1;
    min-width: 0;
}

.interview-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
    margin-bottom: 4px;
}

.interview-description {
    font-size: 14px;
    color: var(--tg-hint);
    margin-bottom: 8px;
    line-height: 1.3;
}

.interview-stats {
    font-size: 12px;
    color: var(--tg-hint);
    margin-bottom: 4px;
}

.interview-stats span {
    margin: 0 4px;
}

.interview-last {
    font-size: 12px;
    color: var(--tg-hint);
}

.interview-action {
    flex-shrink: 0;
}

.continue-btn {
    background: var(--tg-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.continue-btn:active {
    transform: scale(0.95);
    background: var(--tg-blue-dark);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-hint);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-text);
}

.empty-state p {
    font-size: 14px;
    line-height: 1.4;
}

/* Donate Screen Styles */
.mission-section {
    margin-bottom: 20px;
}

.mission-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
    margin-bottom: 8px;
}

.mission-section p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-hint);
    margin-bottom: 0;
}

.mission-section ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.mission-section li {
    font-size: 14px;
    line-height: 1.4;
    color: var(--tg-hint);
    margin-bottom: 4px;
}

.sponsor-button {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
}

.sponsor-button:hover {
    background: linear-gradient(135deg, #FFA500, #FFD700);
}

/* Telegram-style loader */
.telegram-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.telegram-loader-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.telegram-loader-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    animation: telegramDotPulse 1.4s infinite ease-in-out;
}

.telegram-loader-dot:nth-child(1) {
    animation-delay: 0s;
}

.telegram-loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.telegram-loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes telegramDotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading state for navigation buttons */
.nav-item.loading .nav-icon,
.create-nav-item.loading {
    pointer-events: none;
}

.nav-item.loading .nav-icon img,
.create-nav-item.loading img {
    opacity: 0;
}

.nav-item.loading::after,
.create-nav-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item.loading::before,
.create-nav-item.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    animation: telegramDotPulse 1.4s infinite ease-in-out;
    box-shadow: 
        7px 0 0 currentColor,
        14px 0 0 currentColor;
}

.nav-item.loading::before {
    animation-delay: 0s;
}

.create-nav-item.loading::before {
    animation-delay: 0s;
}

/* Alternative spinner loader for buttons */
.telegram-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: telegramSpin 0.8s linear infinite;
}

@keyframes telegramSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Web Footer - shown only when not in Telegram */
.web-footer {
    flex: 0 0 auto;
    height: 60px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 0 20px;
    box-sizing: border-box;
    margin-top: 12px;
    position: relative;
}

/* Desktop footer width limitation */
@media (min-width: 600px) {
    .web-footer {
        max-width: 480px;
        width: 480px;
        margin-left: auto;
        margin-right: auto;
        position: relative;
    }
}

.web-footer-telegram-link {
    color: var(--tg-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    text-align: center;
}

.web-footer-telegram-link:hover {
    opacity: 0.8;
}

.web-footer-telegram-link:active {
    opacity: 0.6;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .web-footer {
        padding: 0 16px;
    }
    
    .web-footer-telegram-link {
        font-size: 13px;
    }
}
