/* =============================================
   YLnime - Unified Netflix-Dark Theme
   Shared across all pages
   ============================================= */

/* --- CSS Variables (Dark Theme Only) --- */
:root, [data-theme="dark"] {
    --font-main: 'Poppins', sans-serif;
    --bg-body: #141414;
    --bg-card: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #E50914;
    --accent-hover: #b20710;
    --border-color: #2b2b2b;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.8);
    --nav-bg: rgba(20, 20, 20, 0.95);
    --hero-gradient: linear-gradient(180deg, rgba(0,0,0,0) 0%, #141414 100%);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #141414; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #E50914; }

/* --- Base --- */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    margin: 0;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--accent-color); }

/* --- Navbar (Netflix Style) --- */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: 0.4s ease;
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--accent-color) !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.nav-link {
    color: #e5e5e5 !important;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0 8px;
    transition: 0.3s;
    position: relative;
}
.nav-link:hover { color: #fff !important; transform: scale(1.05); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--accent-color);
    border: none;
    font-weight: 600;
    border-radius: 4px;
    padding: 0.6rem 1.5rem;
    transition: 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-outline-primary {
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    transition: 0.3s;
}
.btn-outline-primary:hover, .btn-outline-primary.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* --- Cards (Netflix Hover) --- */
.card { background-color: transparent; border: none; overflow: visible; }
.card-img-wrapper {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}
.card:hover .card-img-wrapper {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 15px 35px rgba(0,0,0,0.9);
    border: 2px solid rgba(255,255,255,0.1);
}
.card-img-top { height: 280px; object-fit: cover; width: 100%; transition: opacity 0.3s; }
.card-title { color: var(--text-primary); font-weight: 600; font-size: 0.95rem; margin-top: 10px; transition: 0.3s; }
.card:hover .card-title { color: var(--accent-color); }

/* --- Video Player --- */
.video-wrapper {
    position: relative;
    padding-top: 56.25%;
    background-color: #000;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}
#video-loader { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; background-color: #000; display: flex; justify-content: center; align-items: center; }
#player-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; }
#player-container iframe, #player-container video { width: 100%; height: 100%; border: none; }
.ylnime-watermark { position: absolute; bottom: 15px; left: 20px; z-index: 20; pointer-events: none; color: rgba(255, 255, 255, 0.4); font-weight: 900; text-shadow: 1px 1px 4px #000; font-size: 1.5rem; }

/* --- Lists & Episodes --- */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    transition: 0.2s;
    border-radius: 6px !important;
    margin-bottom: 5px;
}
.list-group-item:hover { background-color: #333; padding-left: 20px; }
.list-group-item.watched { background-color: rgba(229, 9, 20, 0.1); border-left: 4px solid var(--accent-color); }

/* --- Inputs & Modals --- */
.form-control { background-color: rgba(0,0,0,0.5); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 4px; padding: 12px; }
.form-control:focus { background-color: #000; border-color: var(--accent-color); color: var(--text-primary); box-shadow: none; }
.modal-content { background-color: #141414; color: var(--text-primary); border: 1px solid #333; border-radius: 8px; }
.btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* --- Banner / Carousel --- */
.banner-container { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 3rem; position: relative; }
.banner-img { width: 100%; height: 300px; object-fit: cover; transition: transform 10s ease; }
.carousel-item.active .banner-img { transform: scale(1.08); }
.banner-overlay { position: absolute; bottom: 0; left: 0; right: 0; top: 0; background: var(--hero-gradient); pointer-events: none; }

/* --- Section Headers --- */
.section-header {
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    color: var(--text-primary);
    padding-left: 15px;
    border-left: 4px solid var(--accent-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Genre Pills --- */
.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
}
.genre-pill {
    background: rgba(255,255,255,0.08);
    border: 1px solid #333;
    color: #ccc;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
}
.genre-pill:hover, .genre-pill.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* --- Footer --- */
footer {
    background-color: #080808;
    border-top: 1px solid #222;
    margin-top: 5rem;
    padding: 4rem 0;
    color: #777;
}
footer a { color: #777; }
footer a:hover { color: #fff; text-decoration: underline; }

/* --- Animations --- */
.fade-in { animation: fadeIn 0.6s ease-out forwards; opacity: 0; transform: translateY(15px); }
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* --- Profile --- */
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.avatar-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-color); box-shadow: 0 0 15px rgba(229,9,20,0.5); }

/* --- Day Header (Jadwal) --- */
.day-header {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-left: 5px solid var(--accent-color);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.day-header.today {
    background: linear-gradient(135deg, #E50914 0%, #b20710 100%);
    color: white;
    border: none;
}
.badge-count {
    background: rgba(0,0,0,0.2);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* --- Hype / Leaderboard --- */
.hero-rank-1 {
    position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); background: #000; display: flex; align-items: flex-end; min-height: 350px;
}
.hero-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; filter: blur(5px) scale(1.1); }
.hero-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 100%); }
.hero-content { position: relative; z-index: 2; padding: 2.5rem; width: 100%; display: flex; align-items: center; gap: 2rem; }
.hero-cover { width: 120px; border-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); border: 2px solid #fbbf24; }
.hero-text h2 { color: #fff; font-weight: 800; font-size: 2.5rem; margin-bottom: 0.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero-badge { background: linear-gradient(45deg, #fbbf24, #f59e0b); color: #000; padding: 5px 15px; border-radius: 30px; font-weight: 800; font-size: 0.9rem; display: inline-block; margin-bottom: 10px; }

.rank-item {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 15px 20px;
    display: flex; align-items: center; margin-bottom: 1rem; position: relative; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.rank-item:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); border-color: var(--accent-color); }

.rank-num { font-size: 1.8rem; font-weight: 900; width: 50px; text-align: center; color: var(--text-secondary); opacity: 0.5; }
.rank-item.rank-2 .rank-num { color: #94a3b8; opacity: 1; }
.rank-item.rank-3 .rank-num { color: #b45309; opacity: 1; }
.rank-thumb { width: 50px; height: 70px; object-fit: cover; border-radius: 6px; margin: 0 20px; }
.rank-details { flex-grow: 1; z-index: 2; }
.rank-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 2px; }
.rank-views { font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.popularity-bg { width: 150px; height: 6px; background: var(--border-color); border-radius: 10px; overflow: hidden; margin-left: 20px; }
.popularity-fill { height: 100%; background: var(--accent-color); border-radius: 10px; }
.rank-2 .popularity-fill { background: #94a3b8; }
.rank-3 .popularity-fill { background: #b45309; }

/* --- Hype Comments --- */
.hype-comments-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 2rem; margin-top: 4rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.comment-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-color); }
.comment-avatar-sm { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 2px solid var(--text-secondary); }
.comment-card { border-bottom: 1px solid var(--border-color); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.comment-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.reply-card { background: rgba(0,0,0,0.3); border-left: 3px solid var(--border-color); border-radius: 0 12px 12px 0; padding: 1rem; margin-top: 1rem; margin-left: 3.5rem; }
.action-btn { background: none; border: none; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: 0.2s; padding: 0; margin-right: 15px; }
.action-btn:hover { color: var(--accent-color); }
.action-btn.liked { color: #ef4444; }
.reply-form { display: none; margin-top: 1rem; margin-left: 3.5rem; }
.reply-form.active { display: block; animation: fadeIn 0.3s ease; }

/* --- Responsive --- */
@media (min-width: 768px) { .banner-img { height: 500px; } }
@media (max-width: 768px) {
    .card-img-top { height: 200px; }
    .hero-content { flex-direction: column; align-items: flex-start; text-align: left; padding: 1.5rem; gap: 1rem; }
    .hero-cover { width: 90px; }
    .hero-text h2 { font-size: 1.8rem; }
    .popularity-bg { display: none; }
    .rank-thumb { margin: 0 10px; }
    .hype-comments-section { padding: 1.5rem 1rem; }
    .reply-card, .reply-form { margin-left: 1rem; }
}

/* --- Dropdown Menu Dark --- */
.dropdown-menu {
    background: #141414 !important;
    border: 1px solid #333 !important;
}
.dropdown-item { color: #e5e5e5 !important; }
.dropdown-item:hover { background: rgba(229, 9, 20, 0.15) !important; color: #fff !important; }
