﻿:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-elevated: #1a1a25;
    --surface: #252535;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-2: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
}

main {
    flex: 1 0 auto;
    /* Pushes footer down but lets content flow naturally */
    width: 100%;
    /* Ensures it spans full width for the grid */
}

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    background:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(217, 70, 239, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    pointer-events: none;
}

header {
    padding: 2rem 0;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.brand-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.brand-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.hero {
    text-align: center;
    padding: 4rem 0 3rem;
    max-width: 700px;
    margin: 0 auto;
}

.hero h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero h2 span {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2.5rem;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
}

.search-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-lg);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

.search-wrapper:focus-within .search-icon {
    color: var(--primary-light);
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1rem 1rem 1rem 3.5rem;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
}

.btn {
    padding: 0.875rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-glow:hover::before {
    left: 100%;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.card:hover::before {
    opacity: 0.05;
}

.card-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
    z-index: 2;
}

.card-content {
    padding: 1rem;
    position: relative;
    z-index: 2;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating {
    color: var(--accent);
}

/* FIXED TIMELINE - Perfectly Centered Dots */
.timeline {
    position: relative;
    padding-left: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* The vertical line - 2px wide, positioned at left: 0 */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-1);
    border-radius: 2px;
    /* Center the line in the padding area */
    margin-left: 0;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    /* Center the dot on the line */
    top: 1.5rem;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 3px solid var(--primary);
    border-radius: 50%;
    transform: translateX(calc(-50% + 1px));
    box-sizing: border-box;
    z-index: 2;
}

.timeline-item.active::before {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--primary-light);
    transform: translateX(8px);
}

.timeline-poster {
    width: 100px;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.timeline-info {
    flex: 1;
}

.timeline-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.timeline-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.detail-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.detail-backdrop {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.detail-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-card) 100%);
}

.detail-info {
    position: relative;
    margin-top: -150px;
    padding: 0 3rem 3rem;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.detail-poster {
    width: 200px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--bg-card);
    flex-shrink: 0;
}

.detail-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.detail-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: translateX(-4px);
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
}

.close-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.trailer-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: var(--bg-dark);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.active {
    display: flex;
}

.movie-content-wrapper {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.movie-poster {
    width: 300px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.movie-info-text {
    flex: 1;
}

.movie-info-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--primary-light);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.overview {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.movie-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.movie-meta p {
    color: var(--text-secondary);
}

.movie-meta strong {
    color: var(--text-primary);
}

.streaming-info {
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.streaming-info p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.streaming-info strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.5rem;
    }

    .detail-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 1.5rem 2rem;
    }

    .detail-poster {
        width: 150px;
        margin-top: -75px;
    }

    .detail-text h2 {
        font-size: 1.75rem;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .timeline-content {
        flex-direction: column;
        text-align: center;
    }

    .movie-content-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .movie-poster {
        width: 200px;
    }

    /* Mobile timeline adjustment */
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* =========================================
   Footer Styles (Slim & Centered)
   ========================================= */

footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    flex-shrink: 0;
    /* Prevents the footer from squishing */
    width: 100%;
    display: flex;
    justify-content: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.status-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-muted);
}

.status-link:hover {
    background: var(--surface);
    color: var(--success);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.status-link::before {
    content: '';
    width: 5px;
    height: 5px;
    background-color: var(--text-muted);
    border-radius: 50%;
}

.status-link:hover::before {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

@media (max-width: 768px) {
    footer {
        padding: 1.25rem 0;
        margin-top: 2rem;
    }
}