:root {
    --bg-color: #0c1421;
    --card-bg: transparent;
    --text-main: #f8f9fa;
    --text-muted: #a0aab2;
    --accent: #28a745; /* green like NetMirror */
    --accent-hover: #f40612;
    --border-color: #2a2e39;
    --focus-ring: #ffffff;
    --font-family: 'Inter', 'Roboto', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.focusable:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4%;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.9) 0%, rgba(11, 15, 25, 0) 100%);
    z-index: 100;
    transition: background 0.3s;
}

/* Hide top nav items on mobile */
@media (max-width: 768px) {
    nav {
        display: none !important;
    }
}

header.scrolled {
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.3s, background 0.3s;
}

nav a:hover, nav a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    padding: 0 4% 5%;
    background-size: cover;
    background-position: center;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-color) 0%, transparent 100%),
                linear-gradient(to right, var(--bg-color) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.hero-overview {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-color);
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.9);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Rows & Grids */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 4% 1rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.btn-view-all {
    background: linear-gradient(to right, #f89e21, #e83e8c);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.row-container {
    position: relative;
    padding: 0 4%;
}

.media-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.media-row::-webkit-scrollbar {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 0 4% 2rem;
}

.media-card {
    position: relative;
    cursor: pointer;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    width: 160px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.poster-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 2/3;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.poster-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.media-card:hover .poster-container img,
.media-card:focus .poster-container img {
    transform: scale(1.05);
}

.rating-badge {
    position: absolute;
    bottom: -15px;
    left: 10px;
    background: white;
    color: black;
    font-weight: bold;
    font-size: 0.8rem;
    border: 3px solid #28a745;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
}

.language-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e83e8c;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

.media-card-info {
    padding: 0 5px;
    margin-top: 10px;
}

.media-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.media-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Bottom Navigation (Mobile Only) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #1a2233;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 200;
    border-top: 2px solid #e50914; /* red top border like image */
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #a0aab2;
    font-size: 0.75rem;
    gap: 0.3rem;
}

.bottom-nav a.active {
    color: white;
}

.bottom-nav a svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Details Page */
.details-container {
    display: flex;
    flex-direction: column;
    padding: 6rem 4% 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.details-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.details-poster {
    width: 300px;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.details-info {
    flex-grow: 1;
}

/* Search */
.search-container {
    padding: 6rem 4% 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    border-radius: 30px;
    border: none;
    background: var(--card-bg);
    color: white;
    margin-bottom: 2rem;
}

.search-input:focus {
    outline: 2px solid var(--focus-ring);
}

/* Loader */
.loader {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px; /* space for bottom nav */
    }
    .bottom-nav {
        display: flex;
    }
    header {
        flex-direction: row; /* Keep logo horizontal */
        justify-content: space-between;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .details-header {
        flex-direction: column;
        align-items: center;
    }
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .media-card {
        width: 130px;
    }
}
