@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700;800;900&display=swap');

:root {
    --primary: #e50914;
    --primary-glow: rgba(229, 9, 20, 0.5);
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(15, 15, 15, 0.7);
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.logo,
.hero-title {
    font-family: 'Outfit', sans-serif;
}

/* Background Backdrop Effect */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 50% -20%, #2a0a0a 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, #0a0a1a 0%, transparent 40%);
    opacity: 0.6;
    transition: var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    height: 70px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    color: var(--primary);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    text-shadow: 0 0 20px var(--primary-glow);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: #fff;
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    width: 280px;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 18px;
}

/* Hero Section */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 4%;
    background-size: cover;
    background-position: center 20%;
    margin-bottom: -50px;
    background-image: url('https://images.unsplash.com/photo-1626814026160-2237a95fc5a0?auto=format&fit=crop&q=80&w=2000');
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #0a0a0a 0%, rgba(10, 10, 10, 0.8) 30%, transparent 100%),
        linear-gradient(to top, #0a0a0a 0%, transparent 30%);
    z-index: 1;
}

.hero-content {
    max-width: 650px;
    z-index: 10;
    position: relative;
}

.hero-tag {
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: block;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 20px;
    font-weight: 900;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Content Grid */
.row {
    margin: 40px 0;
}

.row-header {
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.row-container {
    position: relative;
    width: 100%;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 200;
    /* Increased to be above card hover (z-index: 100) */
    transition: var(--transition);
    user-select: none;
    opacity: 0;
}

.row-container:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn:hover {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn.left {
    left: 10px;
}

.scroll-btn.right {
    right: 10px;
}

.row-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.posters {
    display: flex;
    gap: 15px;
    padding: 0 4% 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.posters::-webkit-scrollbar {
    display: none;
}

.card {
    min-width: 280px;
    height: 158px;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.card:hover {
    transform: scale(1.1) translateY(-10px);
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--primary);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card-info {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.card:hover .card-info {
    opacity: 1;
    transform: translateY(0);
}

/* Main Body Styles */
body {
    background-color: var(--bg-dark);
    color: #fff;
    overflow-x: hidden;
}

/* Admin Sidebar Update */
.sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
}

.sidebar-link.active {
    background: linear-gradient(90deg, var(--primary), transparent);
    border-left: 4px solid var(--primary);
    color: #fff;
}

/* Custom Dropdown Styles */
.custom-select-wrapper {
    position: relative;
    user-select: none;
}

.custom-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.custom-select:hover {
    background: rgba(255, 255, 255, 0.08);
}

.custom-select.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.custom-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: fadeInScale 0.2s ease-out;
}

.custom-options.show {
    display: block;
}

.custom-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: 0.2s;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.custom-option.selected {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary);
    font-weight: bold;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Media Picker Specifics */
.media-preview-container {
    width: 200px;
    height: 112px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    margin-top: 15px;
    display: none;
}

.media-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .scroll-btn {
        display: none !important;
        /* Hide scroll buttons on mobile */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .navbar {
        height: 60px;
        padding: 0 15px;
        /* Reduced padding */
    }

    .nav-links {
        display: none;
        /* Hide navigation links on mobile to prevent overflow */
    }

    .nav-left {
        gap: 15px;
        /* Reduce gap */
    }

    .logo {
        font-size: 1.5rem;
        /* Smaller logo */
    }

    .search-input {
        width: 120px;
        /* Smaller search bar */
    }

    .search-input:focus {
        width: 160px;
    }

    .hero-content {
        width: 100%;
    }

    .hero-btns {
        flex-direction: column;
        /* Stack buttons on mobile */
        width: 100%;
    }

    .btn {
        width: 100%;
        /* Full width buttons */
        justify-content: center;
    }

    .posters {
        padding-bottom: 20px;
        /* Ensure space for scrollbar on mobile too if needed */
        gap: 10px;
        /* Smaller gap on mobile */
    }

    .card {
        width: 160px;
        /* Force fixed width to prevent expansion */
        min-width: 160px;
        height: 90px;
        /* Maintain approx 16:9 ratio */
    }

    .card:hover {
        transform: none;
        /* Disable scale effect on mobile to prevent glitches */
        box-shadow: none;
        border-color: var(--glass-border);
    }

    .card-info {
        padding: 10px;
        /* Smaller padding */
    }

    .card-info div:first-child {
        font-size: 0.8rem;
        /* Smaller title */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Profile Dropdown */
.profile-dropdown-container {
    position: relative;
    margin-left: 10px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.profile-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.4);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 260px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
}

.profile-avatar-large {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 12px;
}

.profile-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.profile-info p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: 0.2s;
}

.profile-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.profile-dropdown a span {
    font-size: 20px;
    color: var(--text-muted);
}