/* =======================================
   NOVA THEME - COMPLETE INDEX CSS (FIXED)
   File: themes/nova/assets/css/index.css
   ======================================= */

/* =======================================
   CSS VARIABLES
   ======================================= */

:root {
    /* Colors */
    --nova-primary: #7C3AED;
    --nova-primary-hover: #6D28D9;
    --nova-accent: #EC4899;
    --nova-bg-dark: #0a0a0a;
    --nova-bg-darker: #050505;
    --nova-bg-card: #141414;
    --nova-bg-card-hover: #1a1a1a;
    
    /* Text Colors */
    --nova-text-primary: #ffffff;
    --nova-text-secondary: #b3b3b3;
    --nova-text-muted: #737373;
    
    /* Gradients */
    --nova-gradient-primary: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    --nova-gradient-overlay: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
    --nova-gradient-card: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%);
    
    /* Shadows */
    --nova-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --nova-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --nova-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --nova-shadow-accent: 0 8px 32px rgba(124, 58, 237, 0.3);
    --nova-shadow-glow: 0 0 40px rgba(124, 58, 237, 0.4);
    
    /* Spacing */
    --nova-spacing-xs: 0.5rem;
    --nova-spacing-sm: 1rem;
    --nova-spacing-md: 1.5rem;
    --nova-spacing-lg: 2rem;
    --nova-spacing-xl: 3rem;
    
    /* Border Radius */
    --nova-radius-sm: 6px;
    --nova-radius-md: 12px;
    --nova-radius-lg: 16px;
    --nova-radius-xl: 24px;
    
    /* Transitions */
    --nova-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nova-transition-fast: all 0.2s ease;
}

/* =======================================
   RESET & BASE
   ======================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0a0a0a;
    color: var(--nova-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light {
    background-color: #f5f5f5;
}

html {
    scroll-behavior: smooth;
}

/* =======================================
   MAIN LAYOUT
   ======================================= */

.nova-main {
    min-height: 100vh;
    background: transparent;
}

.nova-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--nova-spacing-lg);
}

/* =======================================
   BUTTONS
   ======================================= */

.nova-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--nova-transition);
    cursor: pointer;
    border: none;
    outline: none;
}

.nova-btn-play {
    background: var(--nova-gradient-primary);
    color: var(--nova-text-primary);
    box-shadow: var(--nova-shadow-accent);
}

.nova-btn-play:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--nova-shadow-glow);
}

.nova-btn-info {
    background: rgba(255, 255, 255, 0.1);
    color: var(--nova-text-primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nova-btn-info:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nova-btn-primary {
    background: var(--nova-primary);
    color: var(--nova-text-primary);
}

.nova-btn-primary:hover {
    background: var(--nova-primary-hover);
    transform: translateY(-2px);
}

/* =======================================
   SECTIONS
   ======================================= */

.nova-section {
    margin-bottom: var(--nova-spacing-xl);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.nova-section:nth-child(2) { animation-delay: 0.1s; }
.nova-section:nth-child(3) { animation-delay: 0.2s; }
.nova-section:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* First section after hero needs top padding */
.nova-main > .nova-container > .nova-section:first-of-type {
    padding-top: 2rem;
}

/* For pages WITHOUT hero */
body:not(:has(.nova-hero)) .nova-main,
body:not(:has(.nova-trending-slider-fullwidth)) .nova-main {
    padding-top: 100px;
}

.nova-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--nova-spacing-lg);
}

.nova-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--nova-spacing-md);
}

.nova-section-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nova-gradient-primary);
    border-radius: var(--nova-radius-md);
    box-shadow: var(--nova-shadow-accent);
}

.nova-section-icon i {
    font-size: 1.5rem;
    color: var(--nova-text-primary);
}

.nova-section-title {
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nova-title-main {
    color: var(--nova-text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.nova-title-accent {
    background: var(--nova-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nova-view-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 50px;
    color: var(--nova-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--nova-transition);
}

.nova-view-all:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--nova-primary);
    transform: translateX(5px);
}

/* =======================================
   CONTENT GRID
   ======================================= */

.nova-content-slider {
    overflow: visible;
}

.nova-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* =======================================
   CARDS
   ======================================= */

.nova-card {
    position: relative;
    transition: var(--nova-transition);
}

.nova-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.nova-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--nova-radius-md);
    overflow: hidden;
    background: var(--nova-bg-card);
    box-shadow: var(--nova-shadow-md);
    transition: var(--nova-transition);
}

.nova-card:hover .nova-card-poster {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--nova-shadow-accent);
}

.nova-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--nova-transition);
}

.nova-card:hover .nova-card-img {
    transform: scale(1.1);
}

/* Card Badges */
.nova-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 3;
}

.nova-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    box-shadow: var(--nova-shadow-sm);
}

.nova-badge-quality {
    background: rgba(124, 58, 237, 0.9);
    border: 1px solid rgba(124, 58, 237, 1);
    color: #fff;
}

.nova-badge-year {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--nova-text-secondary);
}

.nova-badge-tv {
    background: rgba(236, 72, 153, 0.9);
    border: 1px solid rgba(236, 72, 153, 1);
    color: #fff;
}

.nova-badge-episode {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 1);
    color: #fff;
}

.nova-badge-season {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 1);
    color: #fff;
}

/* Card Overlay */
.nova-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: var(--nova-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.nova-card:hover .nova-card-overlay {
    opacity: 1;
}

.nova-play-icon {
    font-size: 4rem;
    color: var(--nova-text-primary);
    transform: scale(0.8);
    transition: var(--nova-transition);
    filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.8));
}

.nova-card:hover .nova-play-icon {
    transform: scale(1);
    animation: playPulse 1.5s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nova-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--nova-gradient-card);
}

/* Card Rating */
.nova-card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    z-index: 3;
}

.nova-card-rating i {
    color: #fbbf24;
    font-size: 0.9rem;
}

.nova-card-rating span {
    color: var(--nova-text-primary);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Card Info */
.nova-card-info {
    padding: var(--nova-spacing-sm) 0.5rem 0;
}

.nova-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--nova-text-primary);
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--nova-transition-fast);
}

.nova-card:hover .nova-card-title {
    color: var(--nova-primary);
}

.nova-card-meta {
    font-size: 0.85rem;
    color: var(--nova-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nova-meta-divider {
    color: var(--nova-text-muted);
    opacity: 0.5;
}

/* =======================================
   AD SECTION
   ======================================= */

.nova-ad-section {
    margin: var(--nova-spacing-xl) 0;
}

.nova-ad-container {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.05);
    border: 2px dashed rgba(124, 58, 237, 0.3);
    border-radius: var(--nova-radius-md);
    padding: var(--nova-spacing-lg);
    color: var(--nova-text-muted);
}

/* =======================================
   EMPTY STATE
   ======================================= */

.nova-empty-state {
    padding: 5rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    background: var(--nova-bg-card);
    border-radius: var(--nova-radius-lg);
    box-shadow: var(--nova-shadow-lg);
}

.nova-empty-icon {
    font-size: 5rem;
    color: var(--nova-text-muted);
    opacity: 0.3;
    margin-bottom: var(--nova-spacing-lg);
}

.nova-empty-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--nova-spacing-md);
    background: var(--nova-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nova-empty-text {
    color: var(--nova-text-secondary);
    margin-bottom: var(--nova-spacing-lg);
    font-size: 1.1rem;
}

/* =======================================
   LOADING STATES
   ======================================= */

.nova-card-img[loading="lazy"] {
    background: linear-gradient(
        90deg,
        var(--nova-bg-card) 25%,
        var(--nova-bg-card-hover) 50%,
        var(--nova-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =======================================
   TRENDING SLIDER SECTION - FULL WIDTH
   ======================================= */

.nova-main-with-slider {
    padding-top: 0 !important;
}

body:has(.nova-trending-slider-fullwidth) .nova-main {
    padding-top: 0 !important;
}

.nova-trending-slider-fullwidth {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0a0a, #1a1a2e);
}

.nova-trending-wrapper {
    position: relative;
    width: 100%;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.nova-trending-main {
    position: relative;
    width: 100%;
}

/* Trending Hero Items */
.nova-trending-hero {
    position: relative;
    height: 85vh;
    width: 100%;
    overflow: hidden;
}

.nova-trending-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-end;
}

.nova-trending-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Background with modern fade effect */
.nova-trending-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
    transform: scale(1);
    transition: transform 8s cubic-bezier(0.4, 0, 0.2, 1);
}

.nova-trending-item.active .nova-trending-bg {
    transform: scale(1.05);
}

/* Modern gradient overlay */
.nova-trending-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(10, 10, 10, 0.95) 0%,
        rgba(10, 10, 10, 0.8) 30%,
        rgba(10, 10, 10, 0.6) 50%,
        rgba(10, 10, 10, 0.3) 70%,
        transparent 100%
    );
    z-index: 1;
}

.nova-trending-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(10, 10, 10, 0.8) 0%,
        transparent 100%
    );
}

/* Trending Content */
.nova-trending-content {
    position: relative;
    z-index: 3;
    padding: 3rem;
    width: 100%;
    padding-top: 180px;
    padding-bottom: 100px;
}

.nova-trending-info {
    max-width: 650px;
}

/* Meta information */
.nova-trending-meta-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.nova-meta-language {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.nova-meta-year {
    color: rgba(255, 255, 255, 0.8);
}

.nova-meta-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #fbbf24;
}

.nova-meta-rating i {
    color: #fbbf24;
    font-size: 0.95rem;
}

.nova-meta-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
}

/* Title */
.nova-trending-title {
    font-size: 3.4rem;
    font-weight: 900;
    margin-bottom: 1.2rem;
    color: white;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.02em;
}

/* Genre badges and description wrapper */
.nova-trending-plot-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.nova-trending-genres {
    display: inline-flex;
    gap: 0.7rem;
    margin-bottom: 0;
    margin-right: 1rem;
    flex-wrap: wrap;
    vertical-align: middle;
}

.nova-genre-badge {
    padding: 0.45rem 1.1rem;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nova-genre-badge:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.8);
    transform: translateY(-2px);
}

.nova-trending-description {
    display: inline;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    max-width: 580px;
}

/* Action Buttons */
.nova-trending-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.nova-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nova-btn-play:hover .nova-btn-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.nova-btn-icon i {
    font-size: 1.05rem;
}

.nova-btn-text {
    font-size: 0.9rem;
}

.nova-btn-play {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

/* Navigation Controls */
.nova-trending-nav {
    position: absolute;
    right: 3.5rem;
    bottom: 80px;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    z-index: 10;
}

.nova-trending-arrow {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nova-trending-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.nova-trending-arrow i {
    font-size: 1.1rem;
}

/* Progress Bar */
.nova-trending-progress {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 180px;
}

.nova-progress-current,
.nova-progress-total {
    font-weight: 700;
    color: white;
    font-size: 1rem;
    opacity: 0.6;
}

.nova-progress-bar {
    flex: 1;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.nova-progress-fill {
    height: 100%;
    background: var(--nova-primary, #7c3aed);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* =======================================
   HORIZONTAL THUMBNAIL CAROUSEL
   ======================================= */

.nova-trending-carousel {
    position: absolute;
    right: 3.5rem;
    bottom: 200px;
    transform: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    align-items: center;
}

.nova-carousel-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-align: center;
    margin: 0;
}

.nova-carousel-items {
    display: flex;
    flex-direction: row;
    gap: 0.9rem;
    align-items: center;
    justify-content: center;
    position: relative;
    width: auto;
}

.nova-carousel-item {
    position: relative;
    width: 105px;
    height: 158px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    transform: scale(0.85);
    border: 2px solid transparent;
    flex-shrink: 0;
    background: #1a1a1a;
}

.nova-carousel-item.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.6);
    border-color: var(--nova-primary, #7c3aed);
    z-index: 2;
}

.nova-carousel-item:hover {
    opacity: 0.9;
    transform: scale(0.95);
}

.nova-carousel-item.active:hover {
    transform: scale(1.15);
}

.nova-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.nova-carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.nova-carousel-item:hover .nova-carousel-overlay {
    opacity: 1;
}

.nova-carousel-overlay i {
    font-size: 2.5rem;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.nova-carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.85rem 0.7rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    text-align: center;
    z-index: 3;
}

.nova-carousel-info h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    margin: 0;
}

/* Browse Indicator */
.nova-browse-indicator {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.4);
    opacity: 0.6;
    animation: bounce 2s infinite;
    z-index: 5;
}

.nova-browse-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    transform: rotate(90deg);
}

.nova-browse-icon {
    font-size: 1.2rem;
}

@keyframes bounce {
    0%, 100% { 
        transform: translateX(-50%) translateY(0); 
        opacity: 0.6;
    }
    50% { 
        transform: translateX(-50%) translateY(6px);
        opacity: 0.3;
    }
}

/* =======================================
   RESPONSIVE - LARGE DESKTOP
   ======================================= */

@media (max-width: 1600px) {
    .nova-trending-carousel {
        right: 2.8rem;
        bottom: 180px;
    }
    
    .nova-trending-nav {
        right: 2.8rem;
    }
    
    .nova-carousel-item {
        width: 95px;
        height: 143px;
    }
}

@media (max-width: 1400px) {
    .nova-trending-carousel {
        right: 2rem;
        bottom: 170px;
    }
    
    .nova-trending-nav {
        right: 2rem;
    }
    
    .nova-carousel-item {
        width: 88px;
        height: 132px;
    }
    
    .nova-trending-title {
        font-size: 3rem;
    }
}

@media (max-width: 1200px) {
    .nova-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .nova-trending-title {
        font-size: 2.6rem;
    }
    
    .nova-carousel-item {
        width: 78px;
        height: 117px;
    }
    
    .nova-trending-content {
        padding: 2.5rem;
        padding-top: 100px;
        padding-bottom: 130px;
    }
    
    .nova-carousel-items {
        gap: 0.7rem;
    }
    
    .nova-trending-carousel {
        bottom: 160px;
    }
    
    .nova-trending-nav {
        bottom: 70px;
    }
}

/* =======================================
   RESPONSIVE - TABLET
   ======================================= */

@media (max-width: 992px) {
    body:not(:has(.nova-trending-slider-fullwidth)) .nova-main {
        padding-top: 80px;
    }
    
    .nova-trending-slider-fullwidth {
        margin-top: 0;
        padding-top: 0;
    }
    
    .nova-trending-content {
        padding: 2rem;
        padding-top: 90px;
        padding-bottom: 220px;
    }
    
    .nova-trending-plot-wrapper {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .nova-trending-genres {
        margin-right: 0;
    }
    
    .nova-trending-description {
        display: block;
        margin-bottom: 0;
    }
    
    .nova-trending-carousel {
        position: absolute;
        bottom: 140px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .nova-trending-nav {
        bottom: 50px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .nova-carousel-item {
        width: 70px;
        height: 105px;
    }
    
    .nova-trending-title {
        font-size: 2.2rem;
    }
    
    .nova-trending-hero {
        height: 75vh;
    }
    
    .nova-trending-wrapper {
        min-height: 75vh;
    }
    
    /* Grid improvements */
    .nova-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 1.2rem;
    }
    
    .nova-card-title {
        font-size: 0.95rem;
    }
}

/* =======================================
   RESPONSIVE - MOBILE
   ======================================= */

@media (max-width: 768px) {
    /* Adjust main padding for pages without slider */
    body:not(:has(.nova-trending-slider-fullwidth)) .nova-main {
        padding-top: 80px;
    }
    
    /* Reduce section spacing on mobile */
    .nova-section {
        margin-bottom: 1.5rem !important;
    }
    
    /* Remove top padding from first section */
    .nova-main > .nova-container > .nova-section:first-of-type,
    .nova-main > .nova-container > .nova-section:first-child {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Slider adjustments */
    .nova-trending-hero {
        height: 80vh;
        min-height: 500px;
    }
    
    .nova-trending-wrapper {
        min-height: 80vh;
    }
    
    .nova-trending-content {
        padding: 1.5rem;
        padding-top: 80px;
        padding-bottom: 200px;
    }
    
    .nova-trending-info {
        max-width: 100%;
    }
    
    .nova-trending-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .nova-trending-meta-top {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .nova-trending-plot-wrapper {
        margin-bottom: 1.5rem;
    }
    
    .nova-trending-genres {
        gap: 0.5rem;
    }
    
    .nova-genre-badge {
        padding: 0.35rem 0.9rem;
        font-size: 0.75rem;
    }
    
    .nova-trending-description {
        font-size: 0.95rem;
        line-height: 1.5;
        max-width: 100%;
    }
    
    .nova-trending-actions {
        flex-direction: row;
        gap: 0.8rem;
        flex-wrap: wrap;
    }
    
    .nova-btn-play {
        padding: 0.7rem 1.4rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
    
    .nova-btn-icon {
        width: 30px;
        height: 30px;
    }
    
    .nova-btn-icon i {
        font-size: 1rem;
    }
    
    .nova-trending-carousel {
        bottom: 110px;
        gap: 0.9rem;
    }
    
    .nova-trending-nav {
        bottom: 35px;
        gap: 1.5rem;
    }
    
    .nova-trending-arrow {
        width: 42px;
        height: 42px;
    }
    
    .nova-carousel-items {
        gap: 0.5rem;
    }
    
    .nova-carousel-item {
        width: 60px;
        height: 90px;
    }
    
    .nova-carousel-label {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }
    
    /* Content grid - match slider padding */
    .nova-container {
        padding: 0 1.5rem;
    }
    
    .nova-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 1rem;
    }
    
    .nova-card-poster {
        aspect-ratio: 2/3;
        min-height: 180px;
    }
    
    .nova-card {
        max-width: 100%;
    }
    
    .nova-card-title {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .nova-card-meta {
        font-size: 0.8rem;
    }
    
    .nova-play-icon {
        font-size: 3rem;
    }
    
    /* Section headers - match slider spacing */
    .nova-section-header {
        margin-bottom: 1rem;
    }
    
    .nova-section-icon {
        width: 40px;
        height: 40px;
    }
    
    .nova-section-icon i {
        font-size: 1.2rem;
    }
    
    .nova-section-title {
        font-size: 1.5rem;
    }
    
    .nova-title-main {
        font-size: 0.75rem;
    }
    
    /* Spacing after slider - match slider padding */
    .nova-trending-slider-fullwidth + .nova-container {
        padding-top: 1.5rem;
    }
}

/* =======================================
   RESPONSIVE - SMALL MOBILE
   ======================================= */

@media (max-width: 576px) {
    /* Adjust main padding for pages without slider */
    body:not(:has(.nova-trending-slider-fullwidth)) .nova-main {
        padding-top: 70px;
    }
    
    /* Reduce section spacing more on small mobile */
    .nova-section {
        margin-bottom: 1rem !important;
    }
    
    /* Remove ALL top spacing from first section */
    .nova-main > .nova-container > .nova-section:first-of-type,
    .nova-main > .nova-container > .nova-section:first-child {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Slider adjustments */
    .nova-trending-hero {
        height: 90vh;
        min-height: 550px;
    }
    
    .nova-trending-wrapper {
        min-height: 90vh;
    }
    
    .nova-trending-content {
        padding: 1rem;
        padding-top: 70px;
        padding-bottom: 140px;
    }
    
    .nova-trending-title {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .nova-trending-meta-top {
        font-size: 0.75rem;
        gap: 0.6rem;
        margin-bottom: 0.8rem;
        flex-wrap: wrap;
    }
    
    .nova-trending-plot-wrapper {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    .nova-trending-genres {
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .nova-genre-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    
    .nova-trending-description {
        font-size: 0.9rem;
        line-height: 1.5;
        display: block;
    }
    
    .nova-trending-actions {
        flex-direction: column;
        gap: 0.7rem;
        width: 100%;
        margin-top: 1rem;
    }
    
    .nova-btn-play {
        width: 100%;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    /* Hide carousel on small screens */
    .nova-trending-carousel {
        display: none;
    }
    
    .nova-trending-nav {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        gap: 1.2rem;
    }
    
    .nova-trending-arrow {
        width: 40px;
        height: 40px;
    }
    
    .nova-trending-arrow i {
        font-size: 1rem;
    }
    
    .nova-progress-bar {
        max-width: 100px;
    }
    
    .nova-progress-current,
    .nova-progress-total {
        font-size: 0.9rem;
    }
    
    /* Improve gradient for readability */
    .nova-trending-gradient {
        background: linear-gradient(
            to top,
            rgba(10, 10, 10, 0.98) 0%,
            rgba(10, 10, 10, 0.85) 40%,
            rgba(10, 10, 10, 0.6) 60%,
            rgba(10, 10, 10, 0.3) 80%,
            transparent 100%
        );
    }
    
    /* Content grid - FIXED for better mobile display */
    .nova-container {
        padding: 0 1rem;
    }
    
    .nova-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .nova-card-poster {
        aspect-ratio: 2/3;
        min-height: 180px;
    }
    
    .nova-card {
        max-width: 100%;
    }
    
    .nova-card-info {
        padding: 0.5rem 0.2rem 0;
    }
    
    .nova-card-title {
        font-size: 0.85rem;
    }
    
    .nova-card-meta {
        font-size: 0.75rem;
    }
    
    /* Hide year badge on small screens */
    .nova-badge-year {
        display: none;
    }
    
    .nova-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .nova-play-icon {
        font-size: 2.5rem;
    }
    
    /* Section adjustments - match slider spacing */
    .nova-section-header {
        margin-bottom: 0.8rem;
    }
    
    .nova-section-icon {
        width: 35px;
        height: 35px;
    }
    
    .nova-section-icon i {
        font-size: 1.1rem;
    }
    
    .nova-section-title {
        font-size: 1.3rem;
    }
    
    .nova-view-all {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Spacing after slider - match slider padding */
    .nova-trending-slider-fullwidth + .nova-container {
        padding-top: 1rem;
    }
}

/* =======================================
   RESPONSIVE - EXTRA SMALL
   ======================================= */

@media (max-width: 400px) {
    .nova-trending-title {
        font-size: 1.5rem;
    }
    
    .nova-trending-description {
        font-size: 0.85rem;
    }
    
    .nova-trending-content {
        padding: 0.8rem;
        padding-top: 3.5rem;
        padding-bottom: 120px;
    }
    
    .nova-btn-play {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .nova-trending-nav {
        gap: 1rem;
    }
    
    .nova-trending-arrow {
        width: 36px;
        height: 36px;
    }
    
    .nova-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.6rem;
    }
    
    .nova-card-poster {
        min-height: 160px;
    }
    
    .nova-card-title {
        font-size: 0.8rem;
    }
    
    .nova-section-title {
        font-size: 1.2rem;
    }
}

/* =======================================
   LANDSCAPE ORIENTATION (MOBILE)
   ======================================= */

@media (max-width: 992px) and (orientation: landscape) {
    .nova-trending-hero {
        height: 100vh;
    }
    
    .nova-trending-wrapper {
        min-height: 100vh;
    }
    
    .nova-trending-content {
        padding-top: 3rem;
        padding-bottom: 160px;
    }
    
    .nova-trending-title {
        font-size: 1.8rem;
    }
    
    .nova-trending-description {
        font-size: 0.85rem;
        max-width: 500px;
    }
}

/* =======================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================= */

@media (hover: none) and (pointer: coarse) {
    /* Disable hover transforms on touch devices */
    .nova-card:hover .nova-card-poster {
        transform: none;
    }
    
    .nova-card:hover .nova-card-img {
        transform: none;
    }
    
    /* Show overlay on tap */
    .nova-card:active .nova-card-overlay {
        opacity: 1;
    }
    
    /* Better touch feedback */
    .nova-btn:active {
        transform: scale(0.98);
    }
}

/* =======================================
   ACCESSIBILITY
   ======================================= */

.nova-card:focus-within .nova-card-poster,
.nova-btn:focus {
    outline: 3px solid var(--nova-primary);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =======================================
   PERFORMANCE OPTIMIZATIONS
   ======================================= */

.nova-card {
    contain: layout style paint;
}

.nova-card-poster {
    will-change: transform;
}

.nova-card-img {
    will-change: transform;
}

/* =======================================
   PRINT STYLES
   ======================================= */

@media print {
    .nova-hero,
    .nova-ad-section,
    .nova-btn,
    .nova-view-all,
    .nova-card-overlay,
    .nova-trending-slider-fullwidth {
        display: none !important;
    }
    
    .nova-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    body {
        background: white;
        color: black;
    }
}