/* RÈGLE PRINCIPALE : Cacher la navbar mobile sur PC */
.mobile-nav {
    display: none !important;
}

/* Afficher uniquement sur mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Modern Bottom Navigation Bar - Fixed at bottom */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        justify-content: space-around;
        align-items: center;
        padding: 8px 0 calc(3px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 8px 4px;
        text-decoration: none;
        color: #888;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        position: relative;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        min-height: 58px;
    }

    /* Active state indicator - top bar */
    .mobile-nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-radius: 0 0 3px 3px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-nav-item.active::before {
        opacity: 1;
    }

    .mobile-nav-item.active {
        color: #667eea;
    }

    .mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        height: 28px;
    }

    .mobile-nav-item.active .mobile-nav-icon {
        transform: translateY(-4px);
    }

    .mobile-nav-icon i {
        font-size: 24px;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active .mobile-nav-icon i {
        color: #667eea;
    }

    .mobile-nav-label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        white-space: nowrap;
        opacity: 0;
        transform: translateY(-4px);
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        position: absolute;
        bottom: 6px;
    }

    .mobile-nav-item.active .mobile-nav-label {
        opacity: 1;
        transform: translateY(0);
        color: #667eea;
    }

    /* Tap effect */
    .mobile-nav-item:active {
        transform: scale(0.92);
    }

    /* Ensure body has bottom padding for the fixed nav */
    body {
        padding-bottom: calc(65px + env(safe-area-inset-bottom));
    }

    header {
        padding: 8px 0;
        padding-top: 35px;  /* ✅ Minimum 12px pour Android */
    }

    nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        padding: 0 16px;
    }

    .logo {
        font-size: 24px;
        white-space: nowrap;
        font-size: clamp(18px, 5vw, 22px) !important;
    }

    .nav-links {
        display: none !important;
    }

    #authButtons {
        gap: 8px;
        flex-shrink: 0;
    }

    #authButtons .btn,
    #authButtons .btn-secondary {
        font-size: clamp(11px, 3.5vw, 13px);
        padding: 6px clamp(8px, 2vw, 12px);
        border-radius: 6px;
        white-space: nowrap;
        height: auto;
        min-height: 32px;
    }

    #authButtons .btn {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    }

    #authButtons .btn-secondary {
        padding: 6px 14px;
        border-width: 2px;
    }

    #userMenu {
        padding: 6px 10px 6px 14px;
        gap: 10px;
        border-radius: 40px;
        max-width: 180px;
    }

    #usernameDisplay {
        font-size: 13px;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-avatar,
    .user-avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .swiper-section {
        padding: 0;
    }

    .swiper-card-stack {
        width: 95%;
        max-width: 340px;
        height: auto;
        min-height: 500px;
    }

    .swiper-card-modern {
        width: 100%;
        max-width: 100%;
        position: relative;
        transform: none;
        top: auto;
        left: auto;
    }

    .swiper-card-modern.active {
        z-index: 2;
    }

    .swiper-card-modern.behind {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.5;
        filter: blur(2px);
    }

    .swiper-card-inner {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }

    .swiper-poster-container {
        max-width: 280px;
        margin: 0 auto;
    }

    .swiper-header {
        padding: 0 20px;
    }

    .swiper-title-modern {
        font-size: 22px;
        line-height: 1.3;
        padding: 0 10px;
    }

    .swiper-year-modern {
        font-size: 14px;
    }

    .swiper-hints {
        bottom: -60px;
        gap: 16px;
    }

    .swiper-hint-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .swiper-hint-label {
        font-size: 10px; 
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 28px;
        margin-top: 20px;
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-avatar-upload {
        width: 32px;
        height: 32px;
    }

    .profile-info h2 {
        font-size: 24px;
    }

    .profile-actions {
        justify-content: center;
    }

    .favorite-genres {
        padding: 24px;
    }

    .genre-list {
        justify-content: center;
    }

    .movie-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .movie-details-poster {
        max-width: 250px;
        margin: 0 auto;
    }

    .movie-details-info h2 {
        font-size: 24px;
    }

    .movie-actions {
        flex-direction: row;
        gap: 8px;
    }

    .movie-actions .btn {
        padding: 10px;
        font-size: 13px;
    }

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

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 40px;
    }

    .stat-label {
        font-size: 12px;
    }

    .theme-toggle {
        bottom: 100px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .search-section {
        padding: 40px 0 0px;
    }

    .search-section h1 {
        font-size: 32px;
        margin-bottom: 40px;
    }

    .search-box {
        flex-direction: column;
        gap: 12px;
    }

    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .modal-content {
        padding: 28px;
        margin: 16px;
    }

    .section-title {
        font-size: 24px;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0;
    }
}