:root {
    --bg-dark: #0a0a0b;
    --bg-card: #141417;
    --bg-glass: rgba(20, 20, 23, 0.7);
    --primary: #e50914;
    --primary-hover: #b20710;
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --glow: 0 0 15px rgba(229, 9, 20, 0.3);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.font-outfit {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Glassmorphism */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #000;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.5);
}

/* Movie Card Styles */
/* Movie Card Styles */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px 20px;
    /* Increase vertical gap for titles */
}

.movie-card {
    position: relative;
    border-radius: 18px;
    /* overflow: hidden; Removed to allow text below */
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    /* Ensure no underline on hover */
    display: block;
}

.poster-wrapper {
    position: relative;
    width: 100%;
    /* aspect-ratio: 2/3; Replaced with padding hack for robustness */
    padding-bottom: 150%;
    /* 2:3 ratio */
    height: 0;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 10px;
    background-color: var(--bg-card);
    /* Placeholder while loading */
}

.movie-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    /* Override global max-width */
    object-fit: cover;
    transition: var(--transition);
}

/* Hover effect on poster wrapper */
.movie-card:hover .movie-poster {
    transform: scale(1.05);
    /* Zoom effect */
    filter: brightness(0.8);
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 10px;
    /* Top padding for gradient fade */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.movie-info-float {
    /* position: absolute; Removed */
    /* bottom: 0; */
    /* left: 0; */
    /* right: 0; */
    padding: 0 5px;
    /* background: linear-gradient(transparent, rgba(0, 0, 0, 0.9)); Removed */
    opacity: 1;
    /* Always visible */
    transform: none;
    transition: none;
}

.movie-card:hover .movie-info-float {
    opacity: 1;
    transform: none;
}

.movie-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    padding: 0 5px;
    text-align: left;
}

.movie-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}

.rating-badge {
    background: var(--primary);
    color: #000;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.8s ease forwards;
}

/* Navbar Classes */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links li a {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: #fff;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    box-shadow: var(--glow);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

@media (max-width: 992px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
        border-top: none;
        gap: 15px;
    }

    .nav-logo {
        order: 1;
    }

    .nav-right {
        order: 2;
        flex: 1;
        justify-content: flex-end;
    }

    .nav-search-input {
        width: 180px !important;
    }
}

@media (max-width: 768px) {
    .nav-search-input {
        width: 140px !important;
    }

    .nav-links {
        gap: 15px;
        font-size: 0.9rem;
    }

    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (min-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}