/* Google Fonts - Outfit */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-gradient: radial-gradient(circle at top left, #1e1b4b, #101010),
        radial-gradient(circle at bottom right, #312e81, #101010);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(15px);

    --accent-purple: #a855f7;
    --accent-blue: #3b82f6;
    --accent-gradient: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);

    --card-radius: 16px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #0a0a0c;
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Header & Branding */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 2rem 0 2rem;
    gap: 1.5rem;
}

.brand-logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.2));
}

/* Navbar - Pill Style */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    gap: 0.5rem;
    z-index: 1000;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.8rem 1.8rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--accent-purple);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.logout-nav {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
}

/* Mobile Navigation (Bottom Bar) */
@media (max-width: 768px) {
    .main-header {
        padding-top: 1rem;
    }

    .brand-logo {
        font-size: 2.5rem;
    }

    .navbar-container {
        position: fixed;
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        z-index: 1000;
    }

    .navbar {
        background: rgba(10, 10, 12, 0.9);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .nav-link {
        flex: 1;
        justify-content: center;
        padding: 0.8rem;
        font-size: 0.8rem;
        border-radius: 100px;
    }

    .logout-nav {
        top: 1rem;
        right: 1rem;
    }
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Search Section */
.search-hero {
    text-align: center;
    padding: 3rem 1rem;
}

.search-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.8rem;
    font-size: 1.1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: white;
    outline: none;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

/* Grid & Cards */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.section-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--accent-purple);
    font-size: 1.2rem;
}

.section-title::after {
    display: none;
    /* Removed the line from previous version */
}

.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    scroll-snap-type: x mandatory;
}

.media-card {
    flex: 0 0 160px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
    scroll-snap-align: start;
    animation: fadeUp 0.6s ease backwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-card:hover {
    transform: scale(1.05);
    border-color: var(--accent-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.1);
}

.poster-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    background: #151515;
}

.poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 0.8rem;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal - Cosmic Glass */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    padding: 1rem;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(20, 20, 25, 0.8);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    width: 100%;
    max-width: 1000px;
    border-radius: 24px;
    max-height: 90vh;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

.modal-poster {
    width: 40%;
    object-fit: cover;
}

.modal-info {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.modal-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-overview {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: #ef4444;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(168, 85, 247, 0.4);
}

.btn-imdb {
    background: #f5c518;
    color: #000;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    padding: 3.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.login-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.06);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .modal-content {
        flex-direction: column;
        max-height: 85vh;
        width: 95%;
    }

    .modal-poster {
        width: 100%;
        height: 350px;
    }

    .modal-info {
        padding: 2rem;
    }

    .modal-title {
        font-size: 1.8rem;
    }
}