:root {
    --bg-color: #f5f5f7;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --primary: #000000;
    --primary-hover: #333333;
    --secondary: #0071e3;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 14px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
}

html.dark-mode,
body.dark-mode,
[data-theme="dark"] {
    --bg-color: #000000;
    --nav-bg: rgba(0, 0, 0, 0.85);
    --primary: #ffffff;
    --primary-hover: #e0e0e0;
    --text-main: #f5f5f7;
    --text-muted: #a1a1a6;
    --card-bg: #1d1d1f;
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 14px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Global Link & Tap Reset */
a, a:link, a:visited, a:hover, a:active, a:focus {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar.scrolled {
    background: var(--nav-bg);
    box-shadow: var(--shadow-sm);
    padding: 10px 5%;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo span {
    font-weight: 400;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.3s;
    opacity: 0.7;
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
}

/* Dropdown */
.nav-links li {
    position: relative;
}

.nav-links li.dropdown {
    padding-bottom: 20px;
    margin-bottom: -20px; /* Neutralize the padding so it doesn't break flex alignment */
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(20px);
    min-width: 190px;
    max-height: min(400px, 75vh);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    padding: 8px 0;
    z-index: 1001;
    border: 1px solid var(--glass-border);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

body:not(.dark-mode) .dropdown-content {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-content li {
    list-style: none;
}

.dropdown-content li a {
    color: var(--text-main) !important;
    padding: 10px 20px;
    display: block;
    opacity: 0.8 !important;
    text-align: left;
    white-space: nowrap;
}

.dropdown-content li a:hover {
    background: var(--glass-border);
    opacity: 1 !important;
}

/* Custom Scrollbar for Dropdown */
.dropdown-content::-webkit-scrollbar {
    width: 5px;
}
.dropdown-content::-webkit-scrollbar-track {
    background: transparent;
}
.dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

body:not(.dark-mode) .dropdown-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
body:not(.dark-mode) .dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.btn-login {
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--primary-hover);
}

/* Search Form */
.search-form {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    padding: 6px 14px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-right: 20px;
    border: 1px solid transparent;
}

.search-form:focus-within {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
}

.search-form input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 140px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-form input:focus {
    width: 220px;
}

.search-form button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.search-form:focus-within button {
    color: var(--primary);
}

/* Hero Section */
.hero {
    height: 85vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
    background: var(--bg-color);
    overflow: hidden;
}

/* Apple style large background element */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 70%;
    height: 140%;
    background: var(--glass-bg);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.7;
}

.hero-overlay {
    display: none; /* No dark overlay for light theme */
}

.hero-content {
    max-width: 700px;
    z-index: 2;
    position: relative;
}

.badge {
    display: inline-block;
    background: rgba(0, 113, 227, 0.1);
    color: var(--secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 25px;
}

.hero h1 {
    font-size: 72px;
    line-height: 1.05;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -2px;
    color: var(--text-main);
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.5;
    font-weight: 400;
    max-width: 550px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 32px;
    border-radius: 30px; /* Apple pill shape */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid #d2d2d7;
}

.btn-secondary:hover {
    background: #f5f5f7;
}

/* Page Header (Peliculas, Series, etc.) */
.page-header {
    padding: 100px 5% 15px 5%;
    background: var(--bg-color);
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
    margin: 0;
}

.page-header-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

/* Catalog */
.catalog {
    padding: 15px 5% 80px 5%;
    position: relative;
    z-index: 2;
    background: var(--bg-color);
}

.catalog h2 {
    font-size: 32px;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Home Carousels */
.home-catalog {
    padding: 60px 0;
    background: var(--bg-color);
    position: relative;
    z-index: 2;
}

.category-row {
    margin-bottom: 45px;
    padding-left: 5%;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-right: 5%;
}

.category-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.category-header h2 a,
.category-header h2 a:link,
.category-header h2 a:visited,
.category-header h2 a:hover,
.category-header h2 a:active,
.category-header h2 a:focus {
    color: var(--text-main) !important;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.see-all {
    font-size: 14px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.carousel-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.04);
}

/* Scrollbar ultra delgada y elegante */
.carousel-container::-webkit-scrollbar {
    display: block;
    height: 4px;
}

.carousel-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    margin-right: 5%;
}

.carousel-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    transition: background 0.3s ease;
}

.carousel-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

/* Modo claro */
body:not(.dark-mode) .carousel-container {
    scrollbar-color: rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .carousel-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .carousel-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

body:not(.dark-mode) .carousel-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.carousel-track {
    display: inline-flex;
    gap: 20px;
    padding-right: 5%;
}

.carousel-card,
.carousel-card:link,
.carousel-card:visited,
.carousel-card:hover,
.carousel-card:active,
.carousel-card:focus {
    display: inline-block;
    width: 280px;
    background: transparent;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-decoration: none;
    color: var(--text-main) !important;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.carousel-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.card-image-horizontal {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.4s ease;
}

.carousel-card:hover .card-image-horizontal {
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.carousel-info {
    padding: 12px 4px;
    color: var(--text-main);
}

.carousel-info h3,
.carousel-card:visited .carousel-info h3,
.carousel-card:active .carousel-info h3,
.carousel-card:hover .carousel-info h3,
.carousel-card:focus .carousel-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main) !important;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-info .year,
.carousel-info span.year {
    color: var(--text-muted) !important;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 15px;
}

.movie-card,
.movie-card:link,
.movie-card:visited,
.movie-card:hover,
.movie-card:active,
.movie-card:focus {
    background: transparent;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-decoration: none;
    color: var(--text-main) !important;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    aspect-ratio: 2/3;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.4s ease;
}

.movie-card:hover .card-image {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.placeholder-img {
    background: linear-gradient(135deg, #e5e5ea, #f2f2f7);
}

.card-info {
    padding: 8px 4px 0 4px;
}

.card-info h3 {
    font-size: 14px;
    margin-bottom: 2px;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.card-info span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn, .pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-main);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.pagination-btn:hover, .pagination-page:hover {
    background: var(--primary);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.pagination-page.active {
    background: var(--secondary);
    color: #ffffff;
    border-color: var(--secondary);
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
    cursor: default;
    transform: none;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 6px;
    font-size: 14px;
    user-select: none;
}

/* Ticker Statistics */
.stats-ticker-container {
    width: 100%;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 0;
    margin-bottom: 20px;
    display: flex;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

.stats-ticker {
    display: flex;
    align-items: center;
    animation: scrollTicker 35s linear infinite;
    width: max-content;
}

.stats-ticker:hover {
    animation-play-state: paused;
}

.ticker-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0 25px;
    letter-spacing: 0.2px;
}

.ticker-item strong {
    color: var(--text-main);
    margin-left: 6px;
    font-weight: 700;
}

.ticker-separator {
    color: var(--text-muted);
    font-size: 14px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #34c759;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Platform Branding Styles */
.platform-header-hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.platform-header-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

body:not(.dark-mode) .platform-header-label {
    background: rgba(0, 0, 0, 0.05);
}

.platform-header-logo-container {
    display: flex;
    align-items: center;
    height: 48px;
}

.platform-logo-wrapper {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.platform-logo-wrapper svg {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.platform-carousel-link,
.platform-carousel-link:link,
.platform-carousel-link:visited,
.platform-carousel-link:hover,
.platform-carousel-link:active,
.platform-carousel-link:focus {
    text-decoration: none;
    color: var(--text-main) !important;
    display: inline-flex;
    align-items: center;
    padding: 2px 4px;
    border-radius: 8px;
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.platform-carousel-link:hover {
    opacity: 0.85;
    transform: translateX(4px);
}

.platform-carousel-link span {
    color: var(--text-main) !important;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 10px 5%;
        gap: 8px;
    }
    
    .nav-links {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 16px;
        margin-top: 4px;
        order: 2;
    }

    .nav-links a {
        font-size: 13px;
    }
    
    .user-menu {
        width: 100%;
        margin-top: 4px;
        justify-content: space-between;
        order: 3;
    }
    
    .search-container {
        flex: 1;
        margin-right: 10px;
    }
    
    .search-input {
        width: 100% !important;
        font-size: 13px;
        padding: 7px 14px;
    }

    /* Page Header para Películas / Series en móvil */
    .page-header {
        padding: 130px 5% 15px 5%;
        text-align: left;
    }

    .page-header h1 {
        font-size: 26px;
        letter-spacing: -0.5px;
    }

    .catalog {
        padding: 10px 5% 60px 5%;
    }
    
    .hero {
        padding: 140px 5% 40px 5%;
        height: auto;
        min-height: auto;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    .hero-content {
        margin: 0 auto;
    }
    
    .hero h1 {
        font-size: 32px;
        letter-spacing: -1px;
    }
    
    .hero p {
        font-size: 15px;
        margin: 0 auto 25px auto;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 12px;
    }

    .card-info h3 {
        font-size: 13px;
    }

    .card-info span {
        font-size: 11px;
    }
    
    .stats-ticker-container {
        padding: 8px 0;
    }
    
    .ticker-item {
        font-size: 12px;
        padding: 0 15px;
    }

    .category-header h2 {
        font-size: 19px;
    }

    .category-header h2 a,
    .category-header h2 a:visited,
    .platform-carousel-link,
    .platform-carousel-link:visited {
        color: var(--text-main) !important;
        -webkit-tap-highlight-color: transparent;
    }

    .carousel-card,
    .carousel-card:visited,
    .carousel-card:active {
        width: 220px;
        color: var(--text-main) !important;
        -webkit-tap-highlight-color: transparent;
    }

    .carousel-info h3,
    .carousel-card:visited .carousel-info h3,
    .carousel-card:active .carousel-info h3 {
        font-size: 13px;
        color: var(--text-main) !important;
    }

    .carousel-container::-webkit-scrollbar {
        height: 3px;
    }
}
