/* 
   PeliSeriesPlus - Mobile Styles (Optimized)
   Consolidated & Refined 2025
*/

/* ========== TABLET & MOBILE (max-width: 768px) ========== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    body {
        font-size: 15px;
        padding-bottom: 70px;
        width: 100%;
        overflow-x: hidden;
        /* Fix double scrollbar: allow body to scroll naturally */
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
        /* Performance optimizations */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* Hardware acceleration ONLY for carousels to avoid breaking fixed position elements */
    .swiper-container,
    .hero-swiper {
        transform: translateZ(0);
        will-change: transform;
    }

    /* Performance optimization: Disable expensive backdrop-filter on mobile for better scroll smoothness */
    *,
    *::before,
    *::after {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Re-enable ONLY for essential UI components */
    .main-header,
    .mobile-sidebar,
    .mobile-top-bar,
    .mobile-sidebar-overlay {
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    html {
        width: 100%;
        overflow-x: hidden;
        /* Avoid height: 100% on html to prevent lock */
        height: auto;
    }

    /* --- HEADER & NAV --- */
    .main-header {
        padding: 15px 4%;
        background: rgba(15, 23, 42, 0.98) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
        justify-content: center;
        height: auto;
        pointer-events: none;
        /* Let clicks pass through empty header */
    }

    .main-header.scrolled {
        background: rgba(15, 23, 42, 0.95) !important;
        box-shadow: var(--shadow-lg) !important;
        padding: 8px 4%;
    }

    .logo {
        font-size: 1.8rem;
        margin-right: 0;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }

    /* Hide Desktop Elements */
    .header-nav,
    .header-actions,
    .nav-principal,
    .nav-usuario,
    .search-trigger,
    .search-form,
    .desktop-only {
        display: none !important;
    }

    /* Mobile Top Bar */
    .mobile-top-bar {
        display: flex !important;
        /* Override desktop display: none */
        justify-content: space-between;
        align-items: center;
        width: 100%;
        pointer-events: auto;
        height: 60px;
    }

    .top-bar-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .logo-text {
        font-size: 1.4rem;
        font-weight: 700;
        color: white;
        display: flex;
        align-items: center;
        text-decoration: none;
    }

    /* Override header-logo styles that break mobile layout */
    .header-logo {
        margin-right: 0 !important;
        font-size: 1.4rem !important;
    }

    .logo-highlight {
        color: var(--primary);
    }

    .top-bar-actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-avatar-link {
        display: flex;
        align-items: center;
    }

    .avatar-xs {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
        border: 1.5px solid var(--primary);
    }

    .mobile-notif-btn {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        padding: 5px;
        position: relative;
    }

    /* --- MOBILE SIDEBAR --- */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: #1f2937;
        z-index: 10000;
        transform: translateX(-100%) translateZ(0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        /* Override desktop display: none */
        flex-direction: column;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        pointer-events: auto !important;
        will-change: transform;
        backface-visibility: hidden;
    }

    .mobile-sidebar.active {
        transform: translateX(0) translateZ(0);
    }

    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        /* Slightly darker, less blur */
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(1px);
        /* Minimal blur for mobile */
        display: block !important;
        /* By default no pointer events when hidden */
        pointer-events: none !important;
    }

    .mobile-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto !important;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-title {
        font-size: 1.2rem;
        font-weight: bold;
        color: white;
    }

    .close-sidebar-btn {
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.7);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
    }

    /* User Info in Sidebar */
    .sidebar-user-info {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .avatar-md {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--primary);
    }

    .user-details {
        display: flex;
        flex-direction: column;
    }

    .user-name {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .view-profile-link {
        font-size: 0.8rem;
        color: var(--primary);
    }

    .sidebar-auth-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 25px;
    }

    .btn-sidebar-login,
    .btn-sidebar-register {
        padding: 10px;
        border-radius: 6px;
        text-align: center;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .btn-sidebar-login {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .btn-sidebar-register {
        background: var(--primary);
        color: white;
    }

    /* Sidebar Nav */
    .sidebar-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .sidebar-nav li {
        margin-bottom: 5px;
    }

    .sidebar-nav a {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        color: rgba(255, 255, 255, 0.8);
        border-radius: 6px;
        transition: all 0.2s;
        font-size: 1rem;
        text-decoration: none;
        /* Ensure no underline */
    }

    .sidebar-nav a i {
        width: 25px;
        text-align: center;
        margin-right: 10px;
        color: var(--primary);
    }

    .sidebar-nav a:hover,
    .sidebar-nav a:active {
        background: rgba(255, 255, 255, 0.05);
        color: white;
    }

    .sidebar-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 15px 0;
    }

    .sidebar-section-title {
        display: block;
        font-size: 0.85rem;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 10px;
        padding-left: 15px;
        letter-spacing: 1px;
    }

    .sidebar-subnav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .sidebar-subnav a {
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    /* Mobile Notification Dropdown */
    .mobile-notif-dropdown {
        position: fixed;
        top: 70px;
        /* Adjusted below top bar */
        right: 10px;
        left: 10px;
        background: #1f2937;
        border-radius: 8px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
        z-index: 10100;
        /* Above sidebar */
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* --- HERO SECTION --- */
    .hero-swiper {
        height: 85vh;
        margin-top: -60px;
    }

    .hero-slide-item {
        /* background-image is set inline in HTML, allow it to show */
        background-position: center top;
        background-size: cover;
        background-color: #000;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .mobile-hero-poster-wrapper {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    .mobile-hero-poster {
        width: 100%;
        height: 100%;
        object-fit: cover;
        mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    }

    .hero-container {
        padding-top: calc(var(--header-height) + 60px);
        padding-left: 4%;
        padding-right: 4%;
        padding-bottom: 30px;
        align-items: flex-end;
        justify-content: center;
        text-align: center;
        background: linear-gradient(to top, var(--bg-main) 5%, rgba(15, 23, 42, 0.8) 25%, transparent 60%);
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        z-index: 10;
    }

    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        gap: 10px;
        transform: translateY(0);
        opacity: 1;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        line-height: 1;
        margin-bottom: 5px;
        text-align: center;
    }

    .hero-meta {
        font-size: 0.9rem;
        justify-content: center;
        margin-bottom: 15px;
        gap: 10px;
    }

    .hero-description {
        display: none;
    }

    .hero-actions {
        width: 100%;
        gap: 10px;
        justify-content: center;
        padding: 0 10px;
        flex-direction: row;
        margin-top: 15px;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        flex: 1;
        justify-content: center;
        padding: 10px 15px;
        font-size: 1rem;
        border-radius: 4px;
        max-width: 140px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .btn-hero-primary {
        background: white;
        color: black;
        font-weight: bold;
    }

    .btn-hero-secondary {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        backdrop-filter: blur(5px);
        color: white;
        font-weight: bold;
    }

    /* --- PREMIUM HERO (HOME) --- */
    .hero-wrapper-premium {
        height: 72vh;
        min-height: 480px;
        max-height: 760px;
    }

    .hero-wrapper-premium .hero-swiper {
        height: 100%;
        margin-top: 0;
    }

    .hero-wrapper-premium .hero-slide-item {
        align-items: flex-end;
    }

    .hero-wrapper-premium .hero-bg-image {
        background-position: center 20%;
    }

    .hero-wrapper-premium .hero-video-container {
        display: block;
    }

    .hero-wrapper-premium .hero-container {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        padding: calc(var(--header-height) + 12px) 5% 22px;
        align-items: flex-end;
        text-align: left;
        background: linear-gradient(to top, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.6) 45%, transparent 100%);
    }

    .hero-wrapper-premium .hero-content {
        width: 100%;
        max-width: 520px;
        align-items: flex-start;
        text-align: left;
        gap: 12px;
    }

    .hero-wrapper-premium .hero-header-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .hero-wrapper-premium .hero-logo {
        max-width: 220px;
        max-height: 90px;
        margin-bottom: 6px;
    }

    .hero-wrapper-premium .hero-title {
        font-size: clamp(1.7rem, 6.3vw, 2.4rem);
        line-height: 1.1;
    }

    .hero-wrapper-premium .hero-meta {
        font-size: 0.85rem;
        gap: 8px;
        margin-bottom: 8px;
        justify-content: flex-start;
    }

    .hero-wrapper-premium .hero-tag {
        padding: 4px 10px;
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }

    .hero-wrapper-premium .hero-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
        padding: 0;
        flex-wrap: wrap;
    }

    .hero-wrapper-premium .btn-hero-primary,
    .hero-wrapper-premium .btn-hero-secondary {
        max-width: none;
        flex: 1 1 calc(50% - 5px);
        padding: 12px 16px;
        border-radius: 999px;
        font-size: 0.95rem;
    }

    .hero-wrapper-premium .btn-hero-primary {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: #fff;
    }

    .hero-wrapper-premium .btn-hero-secondary {
        background: rgba(15, 23, 42, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .hero-wrapper-premium .btn-card-list {
        flex-basis: 100%;
    }

    .hero-wrapper-premium .hero-description {
        display: -webkit-box !important;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.92rem;
        color: #dbe4f0;
        margin-bottom: 4px;
    }

    .hero-wrapper-premium .hero-kicker {
        margin-bottom: 8px;
        font-size: 0.72rem;
    }

    .hero-wrapper-premium .hero-stats {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 6px;
    }

    .hero-wrapper-premium .hero-stat {
        padding: 6px 10px;
        font-size: 0.75rem;
        background: rgba(2, 6, 23, 0.65);
    }

    .hero-wrapper-premium .btn-hero-glass {
        display: none;
    }

    .hero-wrapper-premium .hero-video-cta {
        font-size: 0.85rem;
        padding: 10px 18px;
    }

    .hero-pagination-mobile {
        position: absolute;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        display: flex;
        gap: 6px;
        z-index: 15;
    }

    .hero-pagination-mobile .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
        background: rgba(255, 255, 255, 0.45);
        opacity: 1;
        border-radius: 999px;
    }

    .hero-pagination-mobile .swiper-pagination-bullet-active {
        width: 18px;
        background: var(--primary);
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
    }

    .cta-random,
    .cta-peticiones,
    .cta-store,
    .cta-affiliate {
        margin-top: 12px;
    }

    .section-heading__title {
        font-size: 1.5rem;
    }

    .discovery-card__title {
        font-size: 1rem;
    }

    /* --- DETAIL PAGES --- */
    .movie-hero {
        min-height: 85vh;
        padding-top: 120px !important;
        padding-bottom: 40px;
        margin-top: -80px;
        align-items: flex-end;
        z-index: 1;
        position: relative;
        overflow: hidden;
    }

    .hero-background {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-size: cover !important;
        background-position: center top !important;
        z-index: -1 !important;
    }

    .movie-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(15, 23, 42, 0.95) 85%, var(--bg-main) 100%);
        z-index: 0;
    }

    /* Episode List Grid (Catalog) - Force 2 columns */
    .episodios-list-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .episode-card-catalog .episode-thumbnail {
        aspect-ratio: 16/9;
    }

    .episode-card-catalog .episode-info {
        padding: 10px !important;
    }

    .episode-card-catalog .episode-title {
        font-size: 0.9rem !important;
    }

    .hero-poster {
        display: none !important;
    }

    .hero-info {
        width: 100%;
        padding: 0 10px;
    }

    .hero-info h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.1 !important;
        margin-bottom: 15px !important;
        margin-top: 10px !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }

    .hero-info h1 span {
        font-size: 1.2rem;
        display: block;
        margin-top: 5px;
    }

    .details {
        display: block;
        margin-top: 15px;
        font-size: 1rem;
        line-height: 1.5;
        color: #ccc;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        display: -webkit-box;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* --- GRIDS & CARDS --- */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    .episode-grid,
    .search-results-container,
    .lists-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .movie-card {
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .movie-card .poster-wrapper {
        border-radius: 4px;
    }

    .card-info-overlay,
    .card-hover-info,
    .card-overlay,
    .list-overlay {
        display: none !important;
    }

    /* --- CAROUSELS --- */
    .swiper-container,
    .carousel-container {
        width: 100% !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: hidden;
    }

    .category-carousel {
        margin-bottom: 20px !important;
    }

    .carousel-header h2 {
        font-size: 1.1rem;
        border-left: none;
        padding-left: 0;
    }

    /* --- TOP 10 --- */
    .top-10-card {
        padding-left: 15px !important;
        margin-left: 0;
        overflow: visible !important;
        position: relative;
    }

    .rank-number {
        font-size: 1rem !important;
        line-height: 1 !important;
        position: absolute;
        top: 5px !important;
        left: 5px !important;
        bottom: auto !important;
        background-color: var(--primary);
        color: white;
        padding: 4px 10px;
        border-radius: 6px;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        font-family: 'Outfit', sans-serif;
        text-shadow: none;
        -webkit-text-stroke: 0;
        transform: none;
        font-weight: 800;
    }

    .rank-number::before {
        content: "#";
        margin-right: 1px;
        opacity: 0.8;
        font-weight: 400;
        font-size: 0.9em;
    }

    /* --- VIDEO PLAYER --- */
    .video-container-single,
    .video-responsive {
        width: 100% !important;
        max-width: 100vw !important;
        height: auto !important;
        aspect-ratio: 16/9 !important;
        margin-bottom: 15px !important;
        background: black;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        display: block !important;
    }

    iframe {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    .player-controls {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 10px !important;
    }

    .btn-player-control {
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
        flex-grow: 1 !important;
        justify-content: center !important;
    }

    /* --- SEARCH OVERLAY --- */
    .search-overlay {
        padding-top: 0;
        padding-bottom: 0;
        background: rgba(10, 10, 10, 0.85) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-box-card {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        background: transparent !important;
        box-shadow: none !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 80px;
        /* Space for close button */
    }

    .search-bar-wrapper {
        opacity: 0;
        animation: slideDown 0.5s ease forwards 0.2s;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-results-container {
        padding: 20px;
    }

    .search-bar-wrapper input {
        font-size: 1.5rem;
    }

    .close-search {
        top: 20px;
        right: 20px;
        font-size: 2rem;
    }

    /* --- FOOTER --- */
    footer {
        padding: 50px 4% 90px;
        margin-top: 50px;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 35px;
    }

    .footer-logo {
        justify-content: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0 auto 15px;
    }

    /* --- PAGES (Profile, Auth, Etc) --- */
    .page-content {
        padding-top: 80px !important;
        padding-bottom: 90px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .profile-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        margin-top: 10px !important;
    }

    .profile-sidebar {
        width: 100% !important;
        margin-bottom: 20px !important;
        text-align: center !important;
        position: relative !important;
        top: 0 !important;
        padding: 20px !important;
    }

    .profile-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    .auth-wrapper {
        padding: 20px !important;
        min-height: calc(100vh - 170px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .auth-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 25px !important;
        margin: 0 !important;
    }

    .btn-login,
    .btn-registro {
        padding: 6px 16px;
        font-size: 0.85rem;
    }
}

/* ========== MOBILE LANDSCAPE (max-width: 640px) ========== */
@media (max-width: 640px) {
    .container {
        width: 94%;
    }

    h1 {
        font-size: 2.5rem;
    }

    .hero-swiper {
        height: 80vh;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        justify-content: center;
    }

    .dropdown-content {
        min-width: 280px;
        grid-template-columns: 1fr;
    }
}

/* ========== SMALL MOBILE (max-width: 480px) ========== */
@media (max-width: 480px) {
    :root {
        --header-height: 55px;
    }

    body {
        font-size: 14px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .hero-container {
        padding-top: calc(var(--header-height) + 50px);
    }

    .carousel-header h2 {
        font-size: 1.2rem;
    }
}

/* ========== EXTRA SMALL MOBILE (max-width: 380px) ========== */
@media (max-width: 380px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .episode-grid,
    .search-results-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
    }

    .nav-item span {
        font-size: 0.6rem;
    }
}

/* ========== TOUCH OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {

    /* Optimize cards for mobile */
    .movie-card,
    .episode-card {
        will-change: transform;
        transform: translateZ(0);
    }

    .movie-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .btn-registro:hover,
    .btn-login:hover,
    .btn-hero-primary:hover,
    .btn-hero-secondary:hover,
    .episode-card:hover {
        transform: none;
        box-shadow: none;
    }

    .nav-principal a,
    .server-btn,
    .btn-login,
    .btn-registro {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .movie-card:active {
        transform: scale(0.98) translateZ(0);
    }

    /* Disable hover effects on touch devices for better performance */
    @media (hover: none) and (pointer: coarse) {

        .movie-card:hover,
        .episode-card:hover {
            transform: none;
            box-shadow: var(--shadow-sm);
        }
    }

    button,
    a {
        -webkit-tap-highlight-color: rgba(124, 58, 237, 0.3);
    }
}

/* ========== LANDSCAPE FIXES ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-swiper {
        height: 100vh;
    }

    .hero-container {
        padding-top: 100px;
    }

    .auth-wrapper {
        padding: 40px 20px;
    }
}

/* Bottom Nav Styles */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.75rem;
    text-decoration: none;
    width: 100%;
    height: 100%;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}

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