/* ===============================================
   🎬 MOVIE OPINION METER — HOME PAGE STYLES
   Production-grade Netflix-inspired design
   =============================================== */

:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-accent: rgba(56, 189, 248, 0.3);
    
    --accent-primary: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.2);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dimmed: #64748b;
    
    --status-released: #4ade80;
    --status-upcoming: #38bdf8;
    
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 30px rgba(56, 189, 248, 0.2);
    
    /* FIXED CARD DIMENSIONS */
    --card-width: 220px;
    --poster-aspect: 1.5; /* 2:3 ratio = 1.5 */

    /* ✅ NEW: fixed card total height */
    --card-height: 480px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
}

/* ================= NAVBAR ================= */
.navbar {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo span {
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Search & Filters */
.nav-search-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 800px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0 16px;
    flex: 1;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-form input {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 12px 0;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.search-form input::placeholder {
    color: var(--text-dimmed);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.search-btn:hover {
    color: var(--accent-primary);
}
.search-form input:focus,
.search-form input:focus-visible {
    outline: none;
}


/* Nav Filters */
.nav-filters {
    display: flex;
    gap: 12px;
}

.nav-filters select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-filters select:hover {
    border-color: var(--accent-primary);
}

.apply-btn {
    background: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Auth Section */
.auth {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 17px;
    font-weight: 600;
    transition: color 0.2s;
}

.profile-btn:hover {
    color: var(--accent-primary);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.nav-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid var(--border-subtle);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-darker);
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ================= PAGE CONTAINER ================= */
.page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding-top: 30px;
}

.content-wrapper {
    margin-bottom: 60px;
}

/* ================= SECTION HEADERS ================= */
.section-header {
    padding: 0 2rem;
    margin-bottom: 24px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.section-icon {
    font-size: 36px;
    line-height: 1;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 48px;
}

/* ================= HORIZONTAL SCROLL ================= */
.horizontal-scroll {
    padding: 0 2rem 10px;
}

.scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-card);
}

.scroll-container::-webkit-scrollbar {
    height: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ================= MOVIE GRID ================= */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--card-width));
    gap: 24px;
    padding: 0 2rem;
    justify-content: center;
}

/* ================= MOVIE CARDS ================= */
.movie-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ✅ FIXED UNIFORM CARD HEIGHT */
.movie-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-card);

    width: var(--card-width);
    height: var(--card-height);

    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-card-hover);
}

.movie-card.horizontal {
    flex-shrink: 0;
}

/* Poster Container - FIXED HEIGHT */
.poster-container {
    position: relative;
    width: 100%;
    height: calc(var(--card-width) * var(--poster-aspect));
    overflow: hidden;
    background: var(--bg-darker);
}

.poster-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.movie-card:hover .poster-container img {
    transform: scale(1.08);
}

.no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    font-size: 48px;
    color: var(--text-dimmed);
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(2, 6, 23, 0.95) 0%,
        rgba(2, 6, 23, 0.5) 50%,
        transparent 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card:hover .card-overlay {
    opacity: 1;
}

.view-btn {
    background: var(--accent-primary);
    color: var(--bg-darker);
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ✅ FIXED INFO AREA LAYOUT */
.card-info {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-bottom: 4px;
}

.status-badge.released {
    background: rgba(74, 222, 128, 0.15);
    color: var(--status-released);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-badge.upcoming {
    background: rgba(56, 189, 248, 0.15);
    color: var(--status-upcoming);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.movie-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* ✅ ensures title always reserves 2 lines space */
    min-height: 40px;
}

.movie-genres {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;        
    overflow: hidden;         
    white-space: nowrap;

    min-height: 24px;
    max-height: 24px;
}



.genre-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 700;

    padding: 4px 10px;
    border-radius: 999px;

    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-primary);

    line-height: 1;
    white-space: nowrap;

    height: 22px;   
      overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}


.release-date {
    font-size: 11px;
    color: var(--text-dimmed);
    font-weight: 600;

    /* ✅ always takes space + always sticks to bottom */
    min-height: 14px;
    margin-top: auto;
}

/* ================= NO RESULTS ================= */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.no-results p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ================= PAGINATION ================= */
.pagination-wrapper {
    padding: 0 2rem 60px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--bg-card);
    color: var(--accent-primary);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-darker);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.page-info {
    font-size: 14px;
    color: var(--text-muted);
    padding: 0 8px;
}

.page-info strong {
    color: var(--text-main);
    font-weight: 700;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
    :root {
        --card-width: 200px;
        --card-height: 460px;
    }
    
    .movie-grid {
        gap: 20px;
    }
}

@media (max-width: 900px) {
    :root {
        --card-width: 180px;
        --card-height: 440px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-search-group {
        width: 100%;
        flex-direction: column;
    }
    
    .search-form {
        width: 100%;
    }
    
    .nav-filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-filters select,
    .apply-btn {
        flex: 1;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .movie-grid {
        gap: 16px;
    }
}

@media (max-width: 640px) {
    :root {
        --card-width: 160px;
        --card-height: 420px;
    }
    
    .section-header {
        padding: 0 1rem;
    }
    
    .horizontal-scroll {
        padding: 0 1rem 10px;
    }
    
    .movie-grid {
        padding: 0 1rem;
        gap: 12px;
    }
    
    .pagination-wrapper {
        padding: 0 1rem 40px;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .section-icon {
        font-size: 28px;
    }
    
    .card-info {
        padding: 12px;
    }
    
    .movie-title {
        font-size: 14px;
        min-height: 37px;
    }
}

@media (max-width: 480px) {
    :root {
        --card-width: 140px;
        --card-height: 400px;
    }
}

/* ================= SMOOTH ANIMATIONS ================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: fadeIn 0.5s ease-out;
}

/* ================= ACCESSIBILITY ================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus States */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

.poster-container {
  position: relative;
}

.hype-badge {
  position: absolute;
  top: 10px;
  left: 10px;

  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: rgba(186, 230, 253, 0.95);

  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;

  backdrop-filter: blur(10px);
  z-index: 5;

  overflow: hidden;
  transform: translateZ(0);

  box-shadow:
    0 0 18px rgba(255, 125, 0, 0.35),
    0 0 32px rgba(255, 40, 0, 0.18);

  animation: hype-flicker 2.2s infinite ease-in-out;
}

.hype-badge::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 190, 0, 0.45), transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(255, 70, 0, 0.35), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255, 0, 0, 0.18), transparent 65%);
  filter: blur(10px);
  opacity: 0.75;
  animation: flame-move 3.2s infinite linear;
  pointer-events: none;
}

.hype-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 120%, rgba(255, 200, 50, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 55% 130%, rgba(255, 120, 0, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 115%, rgba(255, 60, 0, 0.7) 0 2px, transparent 3px);
  opacity: 0.55;
  animation: sparks 1.6s infinite ease-in-out;
  pointer-events: none;
}


@media (max-width: 768px) {
  .horizontal-scroll {
    padding: 0;
  }

  .scroll-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow: visible;
  }

  .movie-card.horizontal {
    width: 100%;
  }
}


@media (max-width: 640px) {
  :root {
    --card-width: 100%;
    --card-height: auto;
  }

  .movie-card {
    height: auto;
  }

  .poster-container {
    height: auto;
    aspect-ratio: 2 / 3;
  }
}



@media (max-width: 640px) {
  .section-subtitle {
    display: none;
  }

  .section-icon {
    display: none;
  }

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




@media (max-width: 640px) {
  .navbar {
    padding: 0.6rem 1rem;
  }

  .nav-search-group {
    gap: 8px;
  }

  .search-form input {
    font-size: 13px;
  }
}



@media (max-width: 640px) {
  .content-wrapper {
    margin-bottom: 32px;
  }
}
