/* 1. Global Variables & Reset */
:root {
    --bg-dark: #000000;
    --bg-card: #141414;
    --netflix-red: #E50914;
    --text-main: #ffffff;
    --text-dim: #b3b3b3;
    --border: rgba(255, 255, 255, 0.1);
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 50px;
}

/* --- Navbar Premium Styling --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(0, 0, 0, 0.85); /* කළු පැහැය */
    backdrop-filter: blur(15px); /* පිටුපස blur වෙන effect එක */
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Logo Animation */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #E50914; /* Netflix Red */
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.logo span { color: #fff; }

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(229, 9, 20, 0.6); /* Glow Effect */
}

/* Nav Links & Underline Animation */
.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li a {
    color: #e5e5e5;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

/* Underline එක ඇඳීගෙන යන Animation එක */
.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #E50914;
    transition: width 0.3s ease;
}

.nav-links li a:hover::after, 
.nav-links li a.active::after {
    width: 100%;
}

.nav-links li a:hover, 
.nav-links li a.active {
    color: #fff;
}

/* Search Bar Animation */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    width: 180px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Click කළාම පළල් වීම */
.nav-search input:focus {
    width: 280px;
    background: rgba(0, 0, 0, 0.8);
    border-color: #E50914;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.nav-search i {
    position: absolute;
    left: 12px;
    color: #b3b3b3;
    transition: color 0.3s;
}

.nav-search input:focus + i {
    color: #E50914;
}

/* Mobile Responsive Fix */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    .nav-search input {
        width: 100%;
    }
}

.logo {
    font-size: 1.8rem; font-weight: 800; color: var(--netflix-red);
    letter-spacing: -1px; text-transform: uppercase; cursor: pointer;
}
.logo span { color: #fff; }

.nav-links { display: flex; list-style: none; gap: 20px; align-items: center; }
.nav-links li a {
    color: #e5e5e5; text-decoration: none; font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links li a:hover, .nav-links li a.active {
    color: #fff; font-weight: 600;
}

/* Search Box in Nav */
.nav-search {
    position: relative; display: flex; align-items: center;
}
.nav-search input {
    background: rgba(0,0,0,0.5); border: 1px solid #fff;
    color: white; padding: 5px 10px 5px 35px; border-radius: 4px;
    font-size: 0.8rem; outline: none; width: 200px;
}
.nav-search i {
    position: absolute; left: 10px; color: #ccc; font-size: 0.8rem;
}

/* --- Hero Section (Reduced Height & Centered) --- */
.hero {
    height: 50vh; /* උස 80vh සිට 50vh දක්වා අඩු කළා */
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('https://images.unsplash.com/photo-1626814026160-2237a95fc5a0?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex; 
    align-items: center; 
    justify-content: center; /* හරස් අතට මැදට ගැනීමට */
    text-align: center; /* අකුරු මැදට කිරීමට */
    padding: 0 4%;
    margin-bottom: 40px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto; /* Content එක මැදට ගැනීමට */
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); /* අකුරු පැහැදිලිව පෙනීමට */
}

.hero-content p {
    font-size: 1.1rem;
    color: #e5e5e5;
    margin: 0 auto 25px auto;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center; /* Buttons මැදට ගැනීමට */
}

/* Play & Info Buttons Netflix Style */
.play-btn, .info-btn {
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    transition: 0.3s;
}

.play-btn { background: #fff; color: #000; }
.play-btn:hover { background: rgba(255,255,255,0.8); }

.info-btn { background: rgba(109, 109, 110, 0.7); color: #fff; }
.info-btn:hover { background: rgba(109, 109, 110, 0.4); }
/* 4. Filter Section (Movies/TV Pages) */
.filter-container {
    padding: 0 4%; margin: 20px 0;
    display: flex; gap: 15px; align-items: center; flex-wrap: wrap;
}
.pill {
    background: #222; color: white; border: none; padding: 8px 20px;
    border-radius: 4px; cursor: pointer; transition: 0.3s; font-size: 0.9rem;
}
.pill.active, .pill:hover { background: #fff; color: #000; }

#yearSelect {
    background: #000; color: white; border: 1px solid #555;
    padding: 8px; border-radius: 4px; outline: none;
}

/* 5. Movie Card Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px; padding: 20px 4%;
}

.movie-card {
    background: var(--bg-card);
    border-radius: 4px; overflow: hidden;
    position: relative; cursor: pointer;
    transition: transform 0.4s ease;
}

.movie-card:hover {
    transform: scale(1.1); z-index: 5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}

.card-thumb {
    width: 100%; height: 300px; position: relative;
    background: #1a1a1a; display: flex; align-items: center; justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Info shown on hover */
.card-info {
    padding: 15px; background: var(--bg-card);
}
.card-info h4 { font-size: 0.95rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.meta-row { display: flex; gap: 10px; font-size: 0.8rem; color: #46d369; font-weight: 700; }
.card-rating-pill { 
    margin-top: 5px; font-size: 0.8rem; color: #fff; opacity: 0.8;
}

/* Buttons on Card */
.fav-btn, .remove-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.3);
    color: white; width: 35px; height: 35px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.3s; z-index: 2;
}
.fav-btn:hover { background: var(--netflix-red); border-color: var(--netflix-red); }
.remove-btn:hover { background: #ff4444; }

/* 6. Footer Styles */
.site-footer {
    padding: 60px 4% 30px; border-top: 1px solid var(--border);
    margin-top: 50px; color: var(--text-dim); font-size: 0.85rem;
}
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-links h4 { color: #fff; margin-bottom: 15px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.footer-bottom { 
    display: flex; justify-content: space-between; align-items: center; 
    padding-top: 20px; border-top: 1px solid var(--border);
}
.creator-tag { font-weight: 700; color: #fff; }

/* 7. Favourites Specific */
.empty-message {
    text-align: center; grid-column: 1 / -1; padding: 100px 0; color: var(--text-dim);
}
.clear-btn {
    background: var(--netflix-red); color: white; border: none;
    padding: 12px 25px; border-radius: 4px; font-weight: 700; cursor: pointer;
}

/* 8. Responsive Design */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .hero-content h1 { font-size: 2.2rem; }
    .footer-top { grid-template-columns: 1fr; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-search input { width: 100%; }
}

.genre-filter {
    display: flex;
    justify-content: center; /* හරස් අතට මැදට ගැනීමට */
    flex-wrap: wrap;        /* පොඩි screen වලදී පේළි කිහිපයකට යාමට */
    gap: 10px;              /* බට්න් අතර පරතරය */
    margin-bottom: 40px;
    width: 100%;
}

/* Movie Card Improvements */
.movie-card {
    background: #0f141a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.05);
}

.movie-card:hover {
    transform: translateY(-10px);
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.card-thumb {
    position: relative;
    overflow: hidden;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.movie-card:hover .card-overlay { opacity: 1; }

.play-mini-btn {
    background: #fff; color: #000;
    width: 45px; height: 45px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; font-size: 1.2rem;
    transition: 0.3s;
}

.play-mini-btn:hover { transform: scale(1.1); background: #E50914; color: #fff; }

/* Meta Info Styling */
.card-info { padding: 15px; }
.meta-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; margin-top: 8px; color: #94a3b8; }
.rating { margin-left: auto; color: #f7a824; font-weight: 700; }

/* --- Advanced Footer --- */
.site-footer {
    background: #05070a;
    padding: 80px 5% 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 100px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand { flex: 1; min-width: 300px; }
.footer-brand p { color: #94a3b8; margin: 20px 0; font-size: 0.95rem; line-height: 1.7; max-width: 400px; }

.social-links { display: flex; gap: 15px; }
.social-links a {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: #fff; display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: 0.3s;
}
.social-links a:hover { background: #E50914; transform: translateY(-5px); }

.footer-links-group { display: flex; gap: 80px; }
.footer-links h4 { font-size: 0.9rem; letter-spacing: 2px; margin-bottom: 25px; color: #fff; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #94a3b8; text-decoration: none; transition: 0.3s; font-size: 0.9rem; }
.footer-links a:hover { color: #E50914; padding-left: 5px; }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05);
    color: #64748b; font-size: 0.85rem;
}

.creator-badge span { color: #fff; font-weight: 700; }