/* TMDB Filter v3.0 - Modern Discovery Hub */

/* ===== VARIABLES ===== */
:root {
    --filter-primary: #e50914;
    --filter-secondary: #b81d24;
    --filter-bg: rgba(20, 20, 20, 0.95);
    --filter-card-bg: rgba(30, 30, 30, 0.9);
    --filter-glass: rgba(255, 255, 255, 0.05);
    --filter-border: rgba(255, 255, 255, 0.1);
    --match-excellent: #46d369;
    --match-good: #f5c518;
    --match-fair: #ff9800;
    --match-low: #e50914;
    --hub-accent: #6366f1;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes progressGlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ============================================ */
/* ===== DISCOVERY HUB — PAGE WRAPPER ===== */
/* ============================================ */

.discovery-hub {
    min-height: 100vh;
    background: #0a0a0a;
}

/* --- Hub Hero --- */
.hub-hero {
    position: relative;
    text-align: center;
    padding: 60px 20px 40px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
}

.hub-hero-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

.hub-hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hub-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #a5b4fc;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.hub-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
}

.hub-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    font-weight: 400;
}

/* --- Tool Cards Grid --- */
.hub-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px;
    transition: opacity 0.3s ease;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
    font-family: inherit;
    color: #fff;
}

.tool-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    cursor: pointer;
}

.tool-card.active:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.tool-card.coming-soon {
    opacity: 0.4;
}

.tool-card-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    flex-shrink: 0;
}

.tool-card-info {
    flex: 1;
}

.tool-card-info h3 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.tool-card-info p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.4;
}

.tool-card-status {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.coming-badge {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================ */
/* ===== QUIZ CARD — MODERNIZED ===== */
/* ============================================ */

.tmdb-question-card {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 2.5rem;
    border-radius: 24px;
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

/* Subtle top accent line */
.tmdb-question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--hub-accent), transparent);
    border-radius: 0 0 2px 2px;
    opacity: 0.6;
}

/* --- Progress Bar --- */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--hub-accent), #a78bfa, var(--hub-accent));
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressGlow 3s linear infinite;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.question-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.question-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    line-height: 1.35;
    color: #fff;
}

/* --- Back Button (in question header) --- */
.quiz-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 0;
    flex-shrink: 0;
}

.quiz-back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.quiz-back-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================ */
/* ===== AI FINDER STYLES ===== */
/* ============================================ */

.ai-finder-card {
    background: rgba(20, 20, 35, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.ai-finder-card.result-card {
    max-width: 850px;
}

.ai-finder-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ai-finder-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.ai-finder-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.ai-finder-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}

/* --- Tag Input --- */
.tag-input-area {
    margin-bottom: 1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    min-height: 52px;
    cursor: text;
    transition: border-color 0.2s;
    align-items: center;
}

.tags-container:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    color: #c7d2fe;
    animation: slideDown 0.2s ease;
}

.tag-chip.small {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

.tag-remove:hover {
    color: #f87171;
}

.tag-text-input {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 4px 0;
    font-family: inherit;
}

.tag-text-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.tag-hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    text-align: center;
    margin: 0 0 1.5rem;
}

.ai-finder-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ai-finder-submit:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.ai-finder-submit.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- Loading --- */
.ai-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.ai-loading-icon {
    font-size: 3rem;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.ai-loading h3 {
    margin: 1rem 0;
    font-weight: 500;
}

.ai-loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 1.5rem auto;
    overflow: hidden;
}

.ai-loading-progress {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 4px;
    animation: loadingSlide 1.5s ease-in-out infinite;
}

@keyframes loadingSlide {
    0% {
        transform: translateX(-100%);
        width: 30%;
    }

    50% {
        width: 60%;
    }

    100% {
        transform: translateX(350%);
        width: 30%;
    }
}

.ai-loading-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

/* --- Result Header --- */
.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ai-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    color: #a5b4fc;
}

.ai-restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}

.ai-restart-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* --- Result Movie Card --- */
.ai-result-movie {
    margin-bottom: 1.5rem;
}

.ai-result-trailer {
    margin-bottom: 1.5rem;
    border-radius: 14px;
    overflow: hidden;
}

.ai-result-info {
    display: flex;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.ai-result-poster {
    width: 140px;
    height: auto;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

@media (max-width: 768px) {
    .ai-result-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .ai-result-poster {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    .ai-result-meta,
    .ai-result-genres {
        justify-content: center;
    }

    .ai-result-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-watch,
    .btn-similar {
        width: 100%;
        justify-content: center;
    }

    .ai-result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

.ai-result-details {
    flex: 1;
}

.ai-result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.ai-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.meta-badge {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
}

.meta-badge.score {
    background: rgba(250, 204, 21, 0.1);
    color: #fbbf24;
}

.ai-result-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.genre-chip {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.45);
}

.genre-chip.small {
    font-size: 0.65rem;
    padding: 2px 6px;
}

.ai-result-overview {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.ai-result-not-found-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 4px 12px;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 100px;
    color: #fb923c;
    margin-bottom: 1rem;
}

/* --- Result Actions --- */
.ai-result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-watch:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-similar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-similar:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
}

/* --- Keywords --- */
.ai-keywords-section {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-keywords-section.compact {
    padding-top: 0;
    border-top: none;
    margin-bottom: 1.5rem;
}

.ai-keywords-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 0.75rem;
}

.ai-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword-chip {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    color: #6ee7b7;
}

/* --- Similar Movies Grid --- */
.similar-movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.similar-movie-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease forwards;
    opacity: 0;
}

.similar-movie-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.similar-movie-poster {
    width: 80px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.similar-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-movie-poster .no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    font-size: 2rem;
}

.match-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.8);
    border-radius: 6px;
    color: #fff;
}

.similar-movie-info {
    flex: 1;
    min-width: 0;
}

.similar-movie-info h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-movie-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
}

.similar-movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.similar-movie-overview {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.4;
    margin: 0;
}

/* --- Empty / Error States --- */
.ai-empty-state,
.ai-error {
    text-align: center;
    padding: 3rem 1rem;
}

.ai-empty-icon,
.ai-error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.ai-empty-state h3,
.ai-error h3 {
    margin: 0 0 0.5rem;
}

.ai-empty-state p,
.ai-error p {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 1.5rem;
}

/* ===== OPTIONS — MODERNIZED ===== */
.tmdb-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tmdb-option-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

/* Subtle gradient shine on hover */
.tmdb-option-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.tmdb-option-btn:hover::after {
    opacity: 1;
}

.tmdb-option-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(6px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.tmdb-option-btn.selected {
    background: linear-gradient(135deg, var(--hub-accent), #7c3aed);
    border-color: transparent;
    transform: scale(0.98);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.option-icon {
    font-size: 1.4rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.tmdb-option-btn:hover .option-icon {
    background: rgba(99, 102, 241, 0.2);
}

.tmdb-option-btn.selected .option-icon {
    background: rgba(255, 255, 255, 0.15);
}

.option-label {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

/* ===== LOADING ===== */
.filter-loading,
.featured-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.7);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--hub-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* ===== RANDOM PICKER ===== */
.random-init-state {
    text-align: center;
    padding: 4rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

.random-hero-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    display: inline-block;
}

.random-init-state h2 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.random-init-state p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
}

.btn-spin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.btn-spin:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px rgba(236, 72, 153, 0.4);
}

.random-spinning-state {
    text-align: center;
    padding: 5rem 1rem;
}

.roulette-box {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(236, 72, 153, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(236, 72, 153, 0.2);
}

.roulette-box::before,
.roulette-box::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    z-index: 2;
}

.roulette-box::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.roulette-box::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.roulette-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(236, 72, 153, 0.8);
    white-space: nowrap;
    display: block;
    /* Rapid slight vertical vibration to simulate spinning slot */
    animation: slotVibrate 0.1s infinite alternate;
}

@keyframes slotVibrate {
    0% {
        transform: translateY(-3px);
        opacity: 0.8;
    }

    100% {
        transform: translateY(3px);
        opacity: 1;
    }
}

.spinning-hint {
    color: #a5b4fc;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

.random-result-anim {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESULTS PAGE LAYOUT ===== */
.filter-results-page,
.discovery-hub .filter-section {
    background: transparent;
}

.filter-section {
    padding: 2rem;
}

.filter-container {
    max-width: 900px;
    margin: 0 auto;
}

.results-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== FEATURED PANEL ===== */
.featured-panel {
    flex: 2;
    min-width: 0;
}

.featured-card {
    background: var(--filter-card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--filter-border);
}

.featured-content {
    display: flex;
    flex-direction: column;
}

.featured-trailer {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.featured-trailer iframe {
    width: 100%;
    height: 100%;
}

.featured-poster-fallback {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center top;
}

.featured-info {
    padding: 2rem;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.featured-match {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    min-width: 80px;
}

.match-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.match-text {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Match Colors */
.match-excellent {
    background: linear-gradient(135deg, #46d369, #2d8f4e);
}

.match-good {
    background: linear-gradient(135deg, #f5c518, #c9a00c);
    color: #000;
}

.match-fair {
    background: linear-gradient(135deg, #ff9800, #e65100);
}

.match-low {
    background: linear-gradient(135deg, #e50914, #b81d24);
}

.featured-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.featured-overview {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.featured-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-watched {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--filter-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--filter-secondary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover,
.btn-secondary.added {
    background: var(--match-excellent);
    border-color: var(--match-excellent);
    color: #000;
}

.btn-watched {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-watched:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ===== SIDEBAR PANEL ===== */
.sidebar-panel {
    flex: 1;
    max-width: 350px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.list-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.movies-sidebar-list {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.sidebar-movie-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--filter-glass);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    animation: slideInRight 0.4s ease-out forwards;
}

.sidebar-movie-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-movie-item.active {
    border-color: var(--hub-accent);
    background: rgba(99, 102, 241, 0.15);
}

.sidebar-movie-item.watched {
    opacity: 0.5;
}

.sidebar-movie-item.watched::after {
    content: '✓ Watched';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.sidebar-poster {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
}

.sidebar-movie-info {
    flex: 1;
    min-width: 0;
}

.sidebar-movie-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.match-percent {
    font-weight: 700;
}

.match-label {
    opacity: 0.8;
}

/* ===== SIDEBAR ACTIONS ===== */
.sidebar-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-save-all,
.btn-restart {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    font-family: inherit;
}

.btn-save-all {
    background: linear-gradient(135deg, var(--hub-accent), #7c3aed);
    color: #fff;
}

.btn-save-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.btn-restart {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-restart:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: rgba(25, 25, 30, 0.98);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content h3 {
    margin: 0 0 0.5rem 0;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.list-name-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}

.list-name-input:focus {
    outline: none;
    border-color: var(--hub-accent);
}

.list-name-input.error {
    border-color: #e50914;
    animation: shake 0.3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.btn-confirm,
.btn-cancel {
    flex: 1;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-confirm {
    background: var(--hub-accent);
    color: #fff;
}

.btn-confirm:hover {
    background: #4f46e5;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ===== TOAST ===== */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--match-excellent);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification.error {
    background: var(--filter-primary);
    color: #fff;
}

/* ===== MESSAGES ===== */
.all-watched-message,
.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.completion-icon,
.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ============================================ */
/* ===== RESPONSIVE ===== */
/* ============================================ */

@media (max-width: 900px) {
    .hub-title {
        font-size: 2rem;
    }

    .hub-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }

    .results-container {
        flex-direction: column;
        padding: 1rem;
        gap: 2rem;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .featured-panel {
        order: -1;
        width: 100%;
    }

    .featured-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .featured-trailer {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .featured-trailer iframe {
        width: 100%;
        height: 100%;
    }

    .sidebar-panel {
        max-width: 100%;
        order: 2;
    }

    .movies-sidebar-list {
        max-height: none;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-right: 2rem;
    }

    .sidebar-movie-item {
        flex-direction: column;
        align-items: center;
        min-width: 130px;
        width: 38vw;
        max-width: 180px;
        flex-shrink: 0;
        scroll-snap-align: start;
        margin-right: 0;
        text-align: center;
        padding: 0.75rem;
    }

    .sidebar-movie-item .sidebar-poster {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 3;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    .sidebar-movie-item .sidebar-movie-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        width: 100%;
    }

    .sidebar-movie-item .sidebar-movie-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .sidebar-movie-item .sidebar-meta {
        justify-content: center;
        margin-bottom: 0.2rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .hub-hero {
        padding: 40px 16px 30px;
    }

    .hub-title {
        font-size: 1.6rem;
    }

    .hub-subtitle {
        font-size: 0.95rem;
    }

    .hub-tools-grid {
        padding: 0 16px 30px;
    }

    .tool-card {
        padding: 16px;
        gap: 12px;
    }

    .tool-card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.6rem;
    }

    .tmdb-question-card {
        padding: 1.5rem;
        margin: 0 1rem;
        width: auto;
        border-radius: 20px;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .tmdb-option-btn {
        padding: 14px 16px;
    }

    .option-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .featured-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .featured-actions button,
    .featured-actions a {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    .featured-info {
        padding: 1.5rem;
    }
}