body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
}

.hidden,
.results-container.hidden {
    display: none !important;
}

.title {
    font-family: 'Poppins', sans-serif;
    font-size: 50px;
    color: rgb(46, 46, 46);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    padding-top: 5%;
}

.searchBar {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 1% auto;
    background-color: rgb(255, 255, 255);
    border-radius: 30px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 5px 20px;
    z-index: 2;
}

.searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #333;
    font-size: 1rem;
    padding: 10px;
}

.filterbtn,
.okbtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    filter: invert(1);
}

.filterbtn img,
.okbtn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.filter-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #333;
    padding: 20px 25px;
    /* Reduced padding for the overall menu */
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;

    width: 90vw;
    max-width: 1400px;
    /* Adjusted max-width for a more compact look */
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) translateX(-50%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s ease-out;
}

.filter-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(-50%);
}

#filterForm {
    display: flex;
    /* Make the form a flex container */
    flex-direction: row;
    /* Arrange its direct children (columns) horizontally */
    flex-wrap: wrap;
    /* Allow columns to wrap on smaller screens if necessary */
    justify-content: flex-start;
    /* Align columns to the start */
    align-items: flex-start;
    /* Align columns to the top */
    gap: 20px;
    /* Gap between the main columns (left-column and right-columns) */
    width: 100%;
    /* Ensure form takes full width of its parent (.filter-menu) */
}

.filter-left-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Gap between Released and Content Rating fieldsets */
    flex-shrink: 0;
    min-width: 150px;
    /* Further reduced min-width */
    max-width: 180px;
    /* Further reduced max-width */
}

.filter-menu fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    /* Reduced padding for all fieldsets */
    margin: 0;
}

.filter-genres,
.filter-themes,
.filter-countries {
    display: flex;
    flex-direction: row;
    /* Horizontal elements */
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    /* Reduced gap between internal elements for horizontal sections */

    flex: 1 1 250px;
    /* Adjusted flex-basis for compactness */
    min-width: 200px;
    /* Adjusted minimum width */
    max-width: 400px;
    /* Adjusted maximum width */
}

.filter-released,
.filter-content-rating {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    /* Vertical elements */
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 5px;
    /* Further reduced gap for vertical elements */
    padding: 10px 15px;
    min-width: unset;
}

.filter-menu legend {
    font-weight: bold;
    font-size: 0.95em;
    /* Slightly smaller font size */
    color: #333;
    padding: 0 8px;
    margin-bottom: 5px;
    /* Reduced margin below legend */
    margin-left: -5px;
}

.filter-menu label {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    /* Smaller label font size */
    color: #555;
    cursor: pointer;
    margin-bottom: 0;
    white-space: nowrap;
}

.filter-menu input[type="checkbox"] {
    margin-right: 5px;
    /* Reduced margin */
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    /* Smaller checkbox size */
    height: 14px;
    border: 1px solid #ccc;
    /* Thinner border */
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-menu input[type="checkbox"]:checked {
    background-color: #2196f3;
    border-color: #2196f3;
}

.filter-menu input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 8px;
    /* Smaller checkmark */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* Reduced gap between buttons */
    width: 100%;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.action-btn {
    background-color: #2196f3;
    color: white;
    padding: 6px 12px;
    /* Reduced button padding */
    border: none;
    border-radius: 4px;
    /* Smaller border radius */
    cursor: pointer;
    font-size: 0.85rem;
    /* Smaller button font size */
    display: flex;
    align-items: center;
    gap: 5px;
    /* Reduced gap with icon */
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: #1976d2;
}

.action-btn img {
    filter: brightness(0) invert(1);
    width: 14px;
    /* Smaller button icon */
    height: 14px;
}

.reset-btn {
    background-color: #f44336;
}

.reset-btn:hover {
    background-color: #d32f2f;
}

/* Sort Controls styles */
.sort-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1800px;
    margin: 1.5rem auto 0 auto;
    padding: 0 2rem;
    gap: 10px;
}

.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #b30000;
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
}

@media (max-width: 1200px) {
    .results-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.load-more-btn {
    grid-column: 1 / -1;
    display: block;
    margin: 0.5rem auto 1.5rem;
    padding: 0.75rem 2.5rem;
    background: transparent;
    border: 2px solid #b30000;
    color: #b30000;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.2s, color 0.2s;
}

.load-more-btn:hover {
    background: #b30000;
    color: #fff;
}

.movie-card {
    position: relative;
    border: none;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.movie-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.movie-card img.fallback {
    object-fit: contain;
    background: #f0f0f0;
}

/* Glassmorphic similarity badge at Top Right */
.similarity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 5;
}

/* Selected badge styling applied to the main card */
.selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff0055;
    color: #fff;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(255, 0, 85, 0.4);
}

.movie-card.selected {
    border: 3px solid #ff0055;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 0, 85, 0.2);
}

.movie-card.selected:hover {
    transform: scale(1.03) translateY(-5px);
}

/* Hover Overlay Styles (Title, Rating, Overview) */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.2) 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
}

.movie-card:hover .hover-overlay {
    opacity: 1;
}

.hover-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(15px);
    transition: transform 0.3s ease;
}

.movie-card:hover .hover-content {
    transform: translateY(0);
}

.hover-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hover-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #f5c518;
    /* IMDB Gold */
}

.hover-overview {
    font-size: 0.78rem;
    line-height: 1.4;
    color: #ddd;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Similar Movies Display Styles */
.similar-movies-header {
    width: 100%;
    padding: 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.similar-movies-header h2 {
    margin: 0 0 0.5rem 0;
    color: #2e2e2e;
    font-size: 1.8rem;
    font-weight: 700;
}

.similar-movies-header p {
    margin: 0;
    color: #555;
    font-size: 1rem;
}

.similar-movie-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    text-align: center;
}

.similar-movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #2e2e2e;
}

.similar-movie-card img {
    width: 140px;
    height: 210px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.similar-movie-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.similar-movie-title {
    font-weight: 600;
    color: #2e2e2e;
    font-size: 0.95rem;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.similar-movie-year {
    font-size: 0.85rem;
    color: #777;
}

.similar-movie-score {
    font-size: 0.8rem;
    color: #2e7d32;
    font-weight: 600;
}

.no-results {
    width: 100%;
    padding: 3rem 1rem;
    text-align: center;
    background: #f5f5f5;
    border-radius: 10px;
}

.no-results p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* ========================================================================= */
/* MOVIE DETAIL PAGE STYLES (Light Theme) */
/* ========================================================================= */

.detail-page-body {
    background-color: #f0f2f5;
    /* Matches index.html body */
    color: #333;
    min-height: 100vh;
}

.top-nav {
    position: absolute;
    top: 20px;
    left: 40px;
    z-index: 100;
}

.back-btn {
    background: #ffffff;
    border: 1px solid #ccc;
    color: #333;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.back-btn:hover {
    background: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-btn img {
    filter: invert(0);
    /* Black icon */
    width: 20px;
    height: 20px;
}

.movie-detail-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: auto;
    /* Allow scrolling */
}

.detail-backdrop {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    background-size: cover;
    background-position: center 20%;
    z-index: 0;
    opacity: 0.7;
    mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
}

.detail-content {
    position: relative;
    z-index: 10;
    display: flex;
    max-width: 1200px;
    margin: 55vh auto 80px auto;
    /* Centered card style, pushed down to reveal backdrop */
    padding: 35px;
    gap: 35px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.detail-poster {
    flex: 0 0 300px;
    /* Reduced poster size */
}

.detail-poster img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
}

.detail-info {
    flex: 1;
    min-width: 0; /* critical: prevents flex child overflowing parent */
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

#detailTitle {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: rgb(46, 46, 46);
    margin: 0;
    line-height: 1.1;
}

.detail-meta {
    display: flex;
    gap: 15px;
    font-size: 1rem;
    font-weight: 600;
    align-items: center;
    color: #555;
}

.meta-badge {
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.accent-badge {
    color: #b30000;
    /* Subtle dark red accent instead of gold */
    border-color: rgba(179, 0, 0, 0.2);
    background: rgba(179, 0, 0, 0.05);
}

.detail-genres {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

.detail-synopsis h3,
.detail-cast h3,
.detail-trailer h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: rgb(46, 46, 46);
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    display: inline-block;
}

.detail-synopsis p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Extra Info Section */
.detail-extra-info {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.extra-info-row {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: #444;
}

.extra-info-row strong {
    color: #2e2e2e;
    font-weight: 600;
    margin-right: 5px;
}

.tagline-text {
    font-size: 1.1rem;
    font-style: italic;
    color: #666;
    margin-bottom: 1rem;
    border-left: 4px solid #b30000;
    padding-left: 10px;
}

/* Keywords styles */
.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.keyword-badge {
    background: #e0e0e0;
    color: #333;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}

.keyword-badge:hover {
    background: #ccc;
}

/* Cast Cards */
.cast-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.cast-list::-webkit-scrollbar {
    height: 6px;
}

.cast-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.actor-card {
    flex: 0 0 120px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.actor-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.actor-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    padding: 8px 5px 2px 5px;
}

.actor-character {
    font-size: 0.75rem;
    color: #777;
    padding: 0 5px 8px 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: #000;
    border: 1px solid #eee;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: inherit;
    font-size: 1.2rem;
    color: #555;
}

@media (max-width: 900px) {
    .detail-backdrop {
        height: 45vh;
        /* Slightly larger backdrop for mobile */
    }

    .detail-content {
        flex-direction: column;
        margin: 40vh 15px 40px 15px;
        /* Pushed down further to reveal backdrop */
        padding: 25px;
    }

    .detail-poster {
        flex: 0 0 250px;
    }

    #detailTitle {
        font-size: 2.2rem;
        text-align: center;
    }

    .detail-meta,
    .detail-genres {
        justify-content: center;
        text-align: center;
    }
}

/* ── Genre Chips ──────────────────────────────────────────────────────────── */
.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-chip {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #444;
  transition: background 0.2s;
}

.genre-chip:hover {
  background: #e0e0e0;
}

/* ── Original Title ───────────────────────────────────────────────────────── */
.original-title {
  font-size: 0.95rem;
  color: #888;
  font-style: italic;
  margin-top: -12px;
}

/* ── Crew Grid ────────────────────────────────────────────────────────────── */
.detail-crew h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  color: rgb(46, 46, 46);
  margin-bottom: 12px;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  display: inline-block;
}

.crew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  overflow-x: auto;
}


.crew-cell {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.crew-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: #b30000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crew-name {
  font-size: 0.92rem;
  color: #333;
  font-weight: 500;
}

/* ── Extra Info Grid (Details section) ────────────────────────────────────── */
.detail-extra-info h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  color: rgb(46, 46, 46);
  margin-bottom: 12px;
  border-bottom: 2px solid #eee;
  padding-bottom: 5px;
  display: inline-block;
}

.extra-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.extra-info-cell {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.extra-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.extra-value {
  font-size: 0.92rem;
  color: #333;
  font-weight: 500;
}

/* ── Homepage Link ────────────────────────────────────────────────────────── */
.homepage-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.homepage-link:hover {
  background: #f0f0f0;
  border-color: #aaa;
}

/* ── Pool Mode Styles ──────────────────────────────────────────────────────── */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    margin: 10px auto 20px auto;
}

.mode-toggle {
    display: flex;
    background: #e0e0e0;
    border-radius: 30px;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-option {
    padding: 8px 24px;
    border-radius: 26px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.3s ease;
}

.toggle-option.active {
    background: #fff;
    color: #b30000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pool-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 20px auto;
    width: 90%;
    max-width: 1200px;
}

.pool-slots {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pool-slot {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.slot-card {
    width: 150px;
    aspect-ratio: 2/3;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slot-card.empty {
    border: 2px dashed #bbb;
    background: #f9f9f9;
    box-shadow: none;
}

.slot-card.empty:hover {
    border-color: #777;
    background: #f0f0f0;
}

.slot-card.empty .add-icon {
    font-size: 3rem;
    color: #ccc;
    font-weight: 300;
    pointer-events: none;
}

.slot-card.empty:hover .add-icon {
    color: #888;
}

.slot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slot-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    color: #fff;
    padding: 20px 10px 10px 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slot-actions {
    display: flex;
    gap: 15px;
    height: 30px;
    align-items: center;
}

.slot-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-action-btn:hover {
    color: #b30000;
    transform: scale(1.1);
}

.find-my-mix-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #b30000;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(179,0,0,0.3);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.find-my-mix-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.find-my-mix-btn:hover:not(:disabled) {
    background: #900000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(179,0,0,0.4);
}

.find-my-mix-btn:disabled {
    background: #ccc;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.find-my-mix-btn:disabled img {
    filter: none;
    opacity: 0.6;
}

.pool-warning {
    color: #b30000;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.pool-hint {
    color: #777;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: -15px;
}

/* ── Modal Styles ──────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
    opacity: 0;
}

.modal-content {
    background: #f0f2f5;
    width: 90%;
    max-width: 700px;
    height: 80vh;
    border-radius: 20px;
    position: relative;
    padding: 30px;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2.5rem;
    color: #555;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #b30000;
}

.modal-content h2 {
    font-family: 'Poppins', sans-serif;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.modal-search-bar {
    width: 60%;
    margin-bottom: 20px;
}



.movie-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.movie-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ── User Nav (top-right) ─────────────────────────────────────────────────── */
.user-nav {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-nav > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 16px;
    border-radius: 24px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.user-nav-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #bbb;
}

.user-email-display {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

/* ── Auth Modal (Google Sign-In) ─────────────────────────────────────────── */
.auth-modal-content {
    max-width: 380px !important;
    height: auto !important;
    padding: 35px 28px 28px 28px !important;
    text-align: center;
    border-radius: 24px;
}

.auth-modal-header {
    margin-bottom: 24px;
}

.auth-modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #111;
}

.auth-modal-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.auth-error {
    color: #b30000;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 1.2em;
    text-align: center;
    margin-top: 10px;
}

/* ── Google Sign-In & Auth Modal Enhancements ────────────────────────────── */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.google-signin-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0.8rem 0;
    min-height: 48px;
}

.google-config-hint {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-top: 6px;
    width: 100%;
    box-sizing: border-box;
}

.google-config-hint code {
    background: #e2e8f0;
    padding: 2px 5px;
    border-radius: 4px;
    color: #0f172a;
    font-weight: 600;
}

/* ── Watchlist Bookmark Button (on movie cards) ───────────────────────────── */
.watchlist-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.watchlist-btn .material-symbols-outlined {
    font-size: 1.2rem;
    color: #fff;
    transition: color 0.2s ease;
}

.watchlist-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.watchlist-btn.watchlist-active {
    background: #10b981;
    border-color: #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.watchlist-btn.watchlist-active .material-symbols-outlined {
    color: #ffffff;
    font-variation-settings: 'FILL' 1;
}

.watchlist-btn.watchlist-active:hover {
    background: #059669;
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
}

/* ── Watchlist Button on Detail Page ──────────────────────────────────────── */
.detail-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-watchlist-btn {
    flex-shrink: 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.detail-watchlist-btn .material-symbols-outlined {
    font-size: 1.6rem;
    color: #666;
    transition: color 0.2s ease;
}

.detail-watchlist-btn:hover {
    background: #eee;
    border-color: #ccc;
}

.detail-watchlist-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

.detail-watchlist-btn.active .material-symbols-outlined {
    color: #10b981;
    font-variation-settings: 'FILL' 1;
}

/* ── Empty Watchlist State ────────────────────────────────────────────────── */
.empty-watchlist {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-watchlist h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    color: #444;
    margin: 0 0 10px 0;
}

.empty-watchlist p {
    font-size: 1rem;
    color: #888;
    margin: 0;
}