@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
:root { --primary: #dc2626; --neo-bg: #05070a; --text-hi: #eef1f6; --text-mid: rgba(238, 241, 246, 0.65); --accent-glow: rgba(220, 38, 38, 0.4); --surface-1: rgba(255, 255, 255, 0.05); --border-subtle: rgba(255, 255, 255, 0.1); }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--neo-bg); color: var(--text-hi); overflow-x: hidden; }

/* Navbar - Space Between දැම්මම ලෝගෝ එක වමට, සර්ච් එක මැදට, මෙනු එක දකුණට යනවා */
.navbar { position: fixed; top: 0; width: 100%; padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(to bottom, rgba(5,7,10,0.9) 0%, transparent 100%); z-index: 1000; transition: 0.3s; }
.navbar.scrolled { background: rgba(5,7,10,0.95); backdrop-filter: blur(10px); }
.logo { font-size: 1.8rem; font-weight: 800; color: white; text-decoration: none; letter-spacing: -0.5px; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-link { color: var(--text-mid); text-decoration: none; font-weight: 600; font-size: 15px; transition: 0.3s; }
.nav-link:hover, .nav-link.active { color: white; }

.back-btn { display: flex; align-items: center; gap: 8px; color: white; text-decoration: none; font-size: 1.1rem; font-weight: 600; transition: 0.2s; background: rgba(255,255,255,0.1); padding: 8px 15px; border-radius: 20px; backdrop-filter: blur(10px);}
.back-btn:hover { background: rgba(255,255,255,0.2); }

/* පරණ සර්ච් එක (පල්ලෙහාට හැලෙන එක) - හැබැයි Navbar එකේ මැදට එන්න හැදුවා */
.search-container { position: relative; width: 100%; max-width: 500px; margin: 0 20px; flex: 1; }
.search-container input { width: 100%; padding: 12px 15px 12px 40px; border-radius: 30px; background: var(--surface-1); border: 1px solid var(--border-subtle); color: var(--text-hi); font-size: 14px; outline: none; transition: 0.3s; backdrop-filter: blur(10px); }
.search-container input:focus { border-color: var(--primary); background: rgba(0,0,0,0.8); }
.search-icon { position: absolute; left: 15px; top: 14px; color: var(--text-mid); }

.suggestions-box { position: absolute; top: 55px; left: 0; width: 100%; background: rgba(11, 15, 20, 0.95); border-radius: 12px; border: 1px solid var(--border-subtle); display: none; max-height: 350px; overflow-y: auto; z-index: 1001; backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0,0,0,0.7);}
.suggestion-item { padding: 10px 15px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-hi); text-decoration: none;}
.suggestion-item:hover { background: rgba(255,255,255,0.05); color: var(--primary);}
.suggestion-item img { width: 40px; border-radius: 6px; aspect-ratio: 2/3; object-fit: cover;}

.hero-section { position: relative; min-height: 80vh; width: 100%; display: flex; align-items: flex-end; padding-bottom: 40px; padding-top: 120px; overflow: hidden; box-sizing: border-box; }
.details-hero { min-height: 75vh; }
.hero-bg-container { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center 20%; z-index: 0; }
.hero-bg-container iframe { width: 100vw; height: 56.25vw; min-height: 100vh; min-width: 177.77vh; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.hero-vignette-side { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(5, 7, 10, 0.82) 0%, rgba(5, 7, 10, 0.45) 45%, transparent 70%); }
.hero-vignette-bottom { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 0%, rgba(5,7,10,0.7) 60%, var(--neo-bg) 100%); }
.hero-glow { position: absolute; top: -10%; right: -20%; width: 55%; height: 45%; background: radial-gradient(rgba(220, 38, 38, 0.16) 0%, rgba(220, 38, 38, 0.06) 30%, transparent 60%); filter: blur(40px); z-index: 2; pointer-events: none; }
.hero-content { position: relative; z-index: 10; margin-left: 5%; max-width: 700px; animation: slideUp 0.8s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.hero-title { font-size: 3rem; font-weight: 900; line-height: 1.1; text-transform: uppercase; text-shadow: 0 8px 24px rgba(0,0,0,0.8); margin-bottom: 15px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 15px; font-size: 14px; font-weight: 500; color: var(--text-hi); margin-bottom: 15px; align-items: center; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.rating { color: var(--primary); font-weight: 700; }
.hero-desc { font-size: 15px; line-height: 1.6; color: rgba(238,241,246,0.85); margin-bottom: 30px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 4px rgba(0,0,0,0.8);}
.details-page .hero-desc { -webkit-line-clamp: unset; line-clamp: unset; }
.hero-buttons { display: flex; gap: 15px; }
.btn { display: flex; align-items: center; gap: 10px; padding: 12px 30px; border-radius: 50px; font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.2s; border: none; text-decoration: none; }
.btn-play { background: var(--text-hi); color: var(--neo-bg); }
.btn-play:hover { background: white; box-shadow: 0 0 15px var(--accent-glow); transform: scale(0.98); }
.btn-info { background: rgba(255,255,255,0.15); border: 1px solid var(--border-subtle); color: var(--text-hi); backdrop-filter: blur(10px); }
.btn-info:hover { border-color: rgba(220,38,38,0.4); background: rgba(255,255,255,0.25); }
.mute-btn { position: absolute; right: 40px; top: 100px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-subtle); background: var(--surface-1); backdrop-filter: blur(20px); color: var(--text-hi); cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center;}

.main-content { padding: 0 5%; position: relative; z-index: 3; margin-top: 20px !important; display: flex; flex-direction: column; gap: 40px; }
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 15px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 15px; }
.section-note { color: var(--text-mid); font-size: 13px; line-height: 1.5; margin-top: -8px; }
.continue-section { margin-top: 10px; }
.continue-row { gap: 18px; padding-bottom: 6px; }
.resume-card { flex: 0 0 auto; width: 420px; display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)); border: 1px solid var(--border-subtle); box-shadow: 0 18px 40px rgba(0,0,0,0.28); overflow: hidden; }
.resume-poster { position: relative; display: block; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); text-decoration: none; }
.resume-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.resume-card:hover .resume-poster img { transform: scale(1.06); }
.resume-badge { position: absolute; left: 10px; top: 10px; background: rgba(5,7,10,0.72); color: white; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(10px); }
.resume-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.resume-kicker { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px; }
.resume-title { font-size: 22px; line-height: 1.1; font-weight: 800; margin-bottom: 10px; }
.resume-meta { color: var(--text-mid); font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.resume-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.resume-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 700; transition: 0.2s ease; border: 1px solid transparent; }
.resume-btn.primary { background: var(--text-hi); color: var(--neo-bg); }
.resume-btn.primary:hover { transform: translateY(-1px); background: white; }
.resume-btn.secondary { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: var(--text-hi); }
.resume-btn.secondary:hover { border-color: rgba(220,38,38,0.45); background: rgba(255,255,255,0.1); }
.row-posters { display: flex; overflow-y: hidden; overflow-x: auto; gap: 16px; padding-bottom: 15px; scroll-behavior: smooth; }
.row-posters::-webkit-scrollbar, .cast-list::-webkit-scrollbar { display: none; }
.movie-card { position: relative; flex: 0 0 auto; width: 180px; display: flex; flex-direction: column; cursor: pointer; text-decoration: none; color: var(--text-hi); transition: 0.3s; }
.card-img-container { position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-subtle); }
.card-img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.movie-card:hover .card-img-container img { transform: scale(1.08); }
.movie-card:hover .card-img-container { border-color: rgba(255,255,255,0.3); }
.top-badge { position: absolute; left: 0; top: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 32px; height: 42px; background: var(--primary); box-shadow: 0 4px 10px var(--accent-glow); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%); font-weight: 800; color: white; }
.top-text { font-size: 9px; text-transform: uppercase; line-height: 1; }
.top-num { font-size: 14px; line-height: 1; margin-top: 1px; }
.media-badge { position: absolute; right: 8px; top: 8px; background: rgba(5,7,10,0.8); color: white; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(8px); z-index: 4; }
.card-title { font-size: 14px; font-weight: 500; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.movie-card:hover .card-title { color: var(--primary); }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-mid); margin-top: 4px; }

.cast-list { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 10px; }
.cast-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle); padding: 10px; border-radius: 50px; min-width: 220px; flex: 0 0 auto; transition: 0.2s;}
.cast-card:hover { border-color: var(--primary); background: rgba(255,255,255,0.08); }
.cast-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.cast-info { display: flex; flex-direction: column; }
.cast-name { font-size: 14px; font-weight: 600; color: white; }
.cast-role { font-size: 12px; color: var(--text-mid); }

.season-dropdown { background: rgba(255,255,255,0.1); color: white; border: 1px solid var(--border-subtle); padding: 10px 20px; border-radius: 8px; font-size: 15px; outline: none; font-family: inherit; backdrop-filter: blur(10px); cursor: pointer;}
.season-dropdown option { background: var(--neo-bg); color: white; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.episode-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; cursor: pointer; transition: 0.2s; text-decoration: none; color: white; display: block;}
.episode-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.ep-img-wrapper { position: relative; width: 100%; aspect-ratio: 16/9; }
.ep-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.ep-play-icon { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; background: rgba(0,0,0,0.5); opacity: 0; transition: 0.2s; font-size: 30px; color: white;}
.episode-card:hover .ep-play-icon { opacity: 1; color: var(--primary); }
.ep-info { padding: 15px; }
.ep-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.ep-desc { font-size: 12px; color: var(--text-mid); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.category-wrapper { padding: 0 5% 20px 5%; position: relative; z-index: 20;}
.category-pills-container { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; scroll-behavior: smooth; }
.category-pills-container::-webkit-scrollbar { display: none; }
.cat-pill { padding: 8px 20px; border-radius: 30px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); color: var(--text-hi); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: 0.3s; }
.cat-pill:hover { background: rgba(255,255,255,0.1); }
.cat-pill.active { background: var(--text-hi); color: var(--neo-bg); border-color: var(--text-hi); font-weight: 600; }
.filtered-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; width: 100%; }
.filtered-grid .movie-card { width: 100%; }

@media (max-width: 768px) {
    .navbar { padding: 15px 20px; flex-wrap: wrap; gap: 15px; }
    .search-container { order: 3; max-width: 100%; margin: 0; }
    .nav-links { order: 2; }
    
    .hero-section { min-height: 85vh; padding-top: 160px; } 
    .hero-content { margin-left: 5%; margin-right: 5%; width: 90%; }
    .hero-title { font-size: 1.8rem; }
    
    .movie-card { width: 130px; }
    .section-header { align-items: flex-start; flex-direction: column; }
    .continue-row { gap: 16px; }
    .resume-card { width: 130px; grid-template-columns: 1fr; padding: 0; background: transparent; border: none; box-shadow: none; overflow: visible; }
    .resume-poster { width: 100%; border-radius: 10px; }
    .resume-copy { padding-top: 10px; }
    .resume-kicker, .resume-meta, .resume-actions { display: none; }
    .resume-title { font-size: 14px; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mute-btn { top: 130px; right: 20px; }
    .episode-grid { grid-template-columns: 1fr; }
    .filtered-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}