/* Core Design Tokens & Theme Variables */
:root {
    --bg-primary: #060814;
    --bg-secondary: #0b0f19;
    --bg-card: rgba(20, 26, 46, 0.6);
    --bg-card-hover: rgba(30, 38, 64, 0.85);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
    --match-gradient: linear-gradient(135deg, #f43f5e 0%, #d946ef 100%);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --star: #fbbf24;
    
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.8);
    --glass: rgba(10, 14, 28, 0.8);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Background Glowing Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.orb-1 {
    top: -100px;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 80%);
}
.orb-2 {
    top: 400px;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #ec4899 0%, transparent 80%);
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: all 0.3s ease;
    width: 80%;
    margin: 0 auto;
    border-radius: 50px;
    
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    color: var(--accent);
    width: 28px;
    height: 28px;
    transition: transform 0.4s ease;
}
.logo:hover .logo-icon {
    transform: rotate(20deg) scale(1.1);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.accent-text {
    background: var(--match-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    background-color: var(--accent-light);
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
    padding: 1px 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 100px 24px 80px;
    overflow: hidden;
    text-align: center;
    height: 100vh;
}

.hero-bg-gradient {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.hero-container {
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 52px;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.hero-title span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 14px 22px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), var(--shadow-xl);
}

.search-icon {
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    margin-right: 14px;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.clear-btn svg {
    width: 18px;
    height: 18px;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 50;
    max-height: 380px;
    overflow-y: auto;
    text-align: left;
    padding: 10px 0;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background-color: var(--bg-card-hover);
}

.suggestion-item.active {
    background-color: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 21px; /* 24 - 3 offset */
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    padding-right: 12px;
}

.suggestion-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.suggestion-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.suggestion-genres {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 250px;
}

.suggestion-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--star);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.suggestion-rating i {
    width: 11px;
    height: 11px;
    fill: var(--star);
}

.suggestion-no-results {
    padding: 20px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Sections Global */
.details-section, .recommendations-section, .info-section {
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.section-header {
    margin-bottom: 36px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header.centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 32px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 6px;
}

.divider {
    height: 4px;
    width: 56px;
    background: var(--accent-gradient);
    border-radius: 2px;
    margin-top: 12px;
}

.divider.center {
    margin: 12px auto 0;
}

/* Movie Showcase Card */
.movie-showcase-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.5s ease;
}

@media (max-width: 768px) {
    .movie-showcase-card {
        grid-template-columns: 1fr;
    }
    .movie-poster-wrapper {
        height: 380px;
    }
}

.movie-poster-wrapper {
    background-color: #111827;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 360px;
    border-right: 1px solid var(--border);
}

@media (max-width: 768px) {
    .movie-poster-wrapper {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

.poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: imageFadeIn 0.4s ease;
}

.fallback-poster {
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.fallback-poster-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.fallback-poster-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
}

.movie-info-pane {
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 576px) {
    .movie-info-pane {
        padding: 24px;
    }
}

.movie-badge-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.badge {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-year {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-rating {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--star);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-rating svg {
    width: 14px;
    height: 14px;
    fill: var(--star);
}

.movie-showcase-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 38px;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .movie-showcase-title {
        font-size: 28px;
    }
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.genre-pill {
    font-size: 13px;
    font-weight: 600;
    background-color: var(--accent-light);
    color: #a5b4fc;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.movie-meta-item {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.movie-meta-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.text-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.text-link:hover {
    color: #818cf8;
    text-decoration: underline;
}

.action-row {
    margin-top: 36px;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 28px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5);
}

.primary-btn:active {
    transform: translateY(1px);
}

.primary-btn svg {
    width: 18px;
    height: 18px;
}

/* Recommendations Section */
.calc-time-badge {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.calc-time-badge svg {
    width: 14px;
    height: 14px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

/* Movie Recommendation Card */
.movie-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.movie-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.1) inset;
}

.movie-card-poster {
    height: 320px;
    background-color: #111827;
    position: relative;
    overflow: hidden;
}

.match-percentage-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 4px;
}

.match-percentage-badge i {
    width: 11px;
    height: 11px;
    color: var(--success);
    fill: var(--success);
}

.movie-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.movie-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.movie-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 19px;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
}

.movie-card-genres span {
    font-size: 11px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Info / Model Section */
.info-section {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 36px;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background-color: rgba(20, 26, 46, 0.8);
}

.feature-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.feature-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.feature-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    opacity: 0.9;
}

.technical-details-box {
    margin-top: 56px;
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 44px;
}

@media (max-width: 576px) {
    .technical-details-box {
        padding: 24px;
    }
}

.tech-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

.tech-list {
    list-style-type: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.tech-list li {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
}

.tech-list li strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

/* Skeletons and Loaders */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonShine 1.5s infinite linear;
}

@keyframes skeletonShine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skeleton-poster {
    height: 320px;
    width: 100%;
}

.skeleton-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.skeleton-text {
    height: 14px;
    border-radius: 4px;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    border-radius: 4px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background-color: var(--bg-secondary);
    padding: 40px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        justify-content: center;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo svg {
    color: var(--accent);
    width: 22px;
    height: 22px;
}

.footer-logo .logo-text {
    font-size: 20px;
}

.footer-credits {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-credits strong {
    color: var(--text-secondary);
}
