/*
Theme Name: KumaStream Theme - Modern Edition
Version: 1.4
*/

/* --- 1. GLOBAL RESET & VARIABLES --- */
:root {
    --primary: #ff0055;
    --primary-hover: #ff2e70;
    --bg-dark: #0b0c2a;
    --bg-card: #151f2e;
    --bg-nav: rgba(21, 31, 46, 0.85);
    --text-main: #ffffff;
    --text-muted: #b2bdcd;
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

a { text-decoration: none; color: inherit; transition: 0.3s; }
.container { max-width: 1200px; margin: auto; padding: 0 15px; }

/* --- 2. MODERN HEADER & NAVIGATION (CLEAN) --- */
/* --- NAVIGATION BASE (MOBILE & ALL) --- */
nav {
    background: rgba(21, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Container utama yang mengikuti lebar layar */
.nav-flex {
    display: flex;
    flex-direction: column; /* Default HP: Susun ke bawah */
    align-items: center;
    gap: 12px;
}

/* --- LOGO STYLING --- */
.logo a {
    font-size: 24px;
    font-weight: 800;
    color: #ff0055; /* Warna untuk kata KUMA */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Ini adalah bagian yang akan mengubah kata STREAM menjadi putih */
.logo a span {
    color: #ffffff; 
    margin-left: 2px; /* Memberi sedikit jarak antara KUMA dan STREAM */
    font-weight: 400; /* Opsional: membuat STREAM sedikit lebih tipis agar variatif */
}

.logo a:hover {
    opacity: 0.8;
}

/* Responsif Logo di HP */
@media (max-width: 768px) {
    .logo a {
        font-size: 20px;
    }
}

.nav-right {
    display: flex;
    flex-direction: column; /* Default HP: Susun ke bawah */
    width: 100%;
    gap: 12px;
    align-items: center;
}

/* Kotak Pencarian agar lebar penuh di HP */
.search-box {
    width: 100%;
    position: relative;
}

.search-box input {
    width: 100%;
    box-sizing: border-box; /* Agar padding tidak merusak lebar */
    padding: 10px 15px 10px 40px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0b0c2a;
    color: #fff;
    font-size: 14px;
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

/* Menu Links di HP dibuat berjajar rata */
.header-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
}

.header-links a {
    color: #b2bdcd;
    padding: 5px 0;
}

/* --- TABLET (Lebar 768px ke atas) --- */
@media (min-width: 768px) {
    .nav-flex {
        flex-direction: row; /* Berjajar menyamping */
        justify-content: space-between;
    }

    .nav-right {
        flex-direction: row; /* Search & Menu berjajar menyamping */
        width: auto;
        flex-grow: 1;
        justify-content: flex-end;
    }

    .search-box {
        max-width: 300px; /* Batasi lebar search di layar besar */
    }

    .logo a {
        font-size: 24px;
    }
}

/* --- DESKTOP (Lebar 1024px ke atas) --- */
@media (min-width: 1024px) {
    .search-box {
        max-width: 400px;
    }
    
    .header-links {
        gap: 25px;
        font-size: 14px;
    }
    
    nav {
        padding: 15px 0;
    }
}

/* --- 3. ANIME GRID SYSTEM --- */
.anime-grid { 
    display: grid; 
    gap: 15px; 
    margin: 25px 0;
    grid-template-columns: repeat(6, 1fr); 
}

.anime-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.anime-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 12px 25px rgba(255, 0, 85, 0.2); 
}

.anime-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

/* --- 4. UNIVERSAL LABELS --- */
.score-tag, .type-tag, .ep-tag {
    position: absolute;
    z-index: 10;
    font-weight: 800;
    border-radius: 4px;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.score-tag { top: 8px; left: 8px; background: #ffb400; color: #000; padding: 2px 8px; font-size: 11px; }
.type-tag  { top: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; padding: 2px 8px; font-size: 10px; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(4px); }
.ep-tag    { bottom: 50px; right: 8px; color: #fff; padding: 2px 7px; font-size: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.anime-card h3 {
    margin: 0;
    padding: 12px 8px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: var(--bg-card);
}

/* --- 5. ANIME DETAIL PAGE --- */
.anime-detail { display: flex; gap: 30px; background: var(--bg-card); padding: 30px; border-radius: 12px; margin: 30px 0; border: 1px solid var(--glass-border); }
.anime-poster {
    width: 100%;
    max-width: 300px; /* Sesuaikan dengan desain */
    aspect-ratio: 3/4; /* Sangat penting untuk menjaga ruang gambar */
    background: #151f2e; /* Placeholder warna sebelum gambar muncul */
    border-radius: 12px;
    overflow: hidden;
}
.fixed-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.info-title { color: var(--primary); margin: 0 0 15px 0; font-size: 32px; font-weight: 800; }
.meta-row { margin-bottom: 12px; font-size: 15px; color: var(--text-muted); }
.meta-row strong { color: var(--primary); min-width: 90px; display: inline-block; }
.genre-badge { background: #2a3a4f; color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 12px; margin: 0 5px 5px 0; display: inline-block; border: 1px solid transparent; }
.genre-badge:hover { background: var(--primary); border-color: rgba(255,255,255,0.2); }
.synopsis-content {
    contain: content; 
    will-change: max-height;
}
/* --- 6. EPISODE LIST & PLAYER --- */
.ep-scroll-container { 
    background: var(--bg-card); 
    border-radius: 8px; 
    max-height: 450px; 
    overflow-y: auto; 
    border: 1px solid #2a3a4f; 
    margin: 15px 0; 
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-card);
}

.ep-item { 
    background: #1c293d; 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #2a3a4f; 
    transition: 0.2s; 
}
.ep-item:hover { background: #25344a; border-left: 4px solid var(--primary); color: var(--primary); }

.btn-watch-now { 
    background: var(--primary); 
    color: #fff !important; 
    padding: 12px 28px; 
    border-radius: 50px; 
    font-weight: bold; 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    box-shadow: 0 4px 15px rgba(255,0,85,0.3); 
}
.btn-watch-now:hover { transform: scale(1.05); background: var(--primary-hover); }

/* --- 7. RESPONSIVE BREAKPOINTS --- */

@media (max-width: 1024px) {
    .anime-grid { grid-template-columns: repeat(4, 1fr); }
    .anime-detail { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
    .fixed-poster { width: 100%; max-width: 260px; height: auto; margin-bottom: 20px; }
    .meta-row { text-align: left; }
}

@media (max-width: 768px) {
    .anime-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .nav-flex { flex-direction: column; gap: 15px; }
    .nav-right { width: 100%; flex-direction: column; }
    .info-title { font-size: 26px; }
    .header-links { width: 100%; justify-content: center; padding-top: 10px; border-top: 1px solid var(--glass-border); }
}

@media (max-width: 480px) {
    .anime-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .anime-card h3 { font-size: 11px; padding: 10px 5px; }
    .score-tag, .type-tag { font-size: 9px; padding: 1px 6px; }
    .ep-tag { bottom: 42px; font-size: 9px; right: 5px; }
    .btn-watch-now { width: 100%; justify-content: center; }
}

.pagination-container .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #151f2e;
    color: #fff;
    border-radius: 4px;
    transition: 0.3s;
}

.pagination-container .page-numbers.current {
    background: #ff0055;
    font-weight: bold;
}

.pagination-container .page-numbers:hover:not(.current) {
    background: #2a3a4f;
}

/* --- GENRE LIST PAGE --- */
.genre-list-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 50px;
}

.genre-card-item {
    background: #151f2e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.genre-card-item:hover {
    background: #1c293d;
    border-color: #ff0055;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.genre-name {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.genre-count {
    color: #ff0055;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Penyesuaian Mobile */
@media (max-width: 480px) {
    .genre-list-wrapper {
        grid-template-columns: repeat(2, 1fr); /* 2 Kolom di HP */
    }
}

/* --- SCHEDULE PAGE STYLING --- */
.schedule-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.schedule-section .anime-card h3 {
    background: #1c293d; /* Warna sedikit berbeda agar kontras */
}

/* Sorot Hari Ini (Optional JS diperlukan untuk mendeteksi hari) */
.is-today h2 {
    background: var(--primary) !important;
    border-left-color: #fff !important;
}

/* --- A-Z LIST STYLING --- */
.az-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    background: #151f2e;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.char-item {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0c2a;
    color: #b2bdcd;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s;
}

.char-item:hover, .char-item.active {
    background: #ff0055;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(255, 0, 85, 0.3);
}

@media (max-width: 480px) {
    .char-item {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

.btn-bookmark {
    background: #1c293d;
    color: #fff;
    border: 1px solid #1c293d;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-bookmark.active {
    background: #ff0055;
}

.btn-bookmark:hover {
    transform: scale(1.05);
}

/* Menyesuaikan struktur menu WordPress agar tetap horizontal */
.header-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 18px; /* Jarak antar menu */
}

.header-links ul li a {
    color: #b2bdcd;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
    text-transform: uppercase;
}

/* --- MODERN FOOTER --- */
.main-footer {
    background: #151f2e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 60px;
    padding-top: 50px;
    color: #b2bdcd;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-about p {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.8;
}

.footer-links h4, .footer-social h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links ul li a:hover { color: #ff0055; padding-left: 5px; }

.social-icons { display: flex; flex-direction: column; gap: 10px; }
.social-icons a {
    background: rgba(255,255,255,0.05);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 13px;
    text-align: center;
}
.social-icons a:hover { background: #ff0055; color: #fff; }

.footer-bottom {
    background: #0b0c2a;
    padding: 25px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 13px;
}

.footer-bottom span { opacity: 0.5; display: block; margin-top: 5px; }

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .footer-links ul { display: inline-block; text-align: left; }
}

.header-links ul li a:hover {
    color: #ff0055;
}

/* Penyesuaian Mobile agar tidak berantakan */
@media (max-width: 768px) {
    .header-links ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Update Grid Footer menjadi 4 Kolom di Desktop */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.2fr 1fr 1fr; /* Penyesuaian lebar kolom */
    gap: 30px;
    padding-bottom: 50px;
}

/* Styling Tag Genre di Footer */
.footer-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-genre-tags a {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    color: #b2bdcd;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.footer-genre-tags a:hover {
    background: #ff0055;
    color: #fff;
    border-color: #ff0055;
}

/* Penyesuaian Mobile (Tablet) */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* Menjadi 2 baris x 2 kolom */
    }
}

/* Penyesuaian Mobile (HP) */
@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Menjadi 1 kolom memanjang */
        text-align: center;
    }
    .footer-genre-tags {
        justify-content: center;
    }
}

/* --- BACK TO TOP BUTTON --- */
#backToTop {
    display: none; /* Sembunyi secara default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    border: none;
    outline: none;
    background-color: rgba(0, 0, 0, 0);
    color: white;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.4);
}

#backToTop:hover {
    background-color: rgba(0, 0, 0, 0);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 0, 85, 0.6);
}

/* Penyesuaian untuk HP agar tidak menutupi konten */
@media (max-width: 480px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Container pembungkus ikon play */
.play-button-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7);
    transition: all 0.3s ease;
    animation: pulse-red 2s infinite; /* Efek berdenyut */
}

/* Ikon sedikit geser ke kanan agar benar-benar di tengah secara visual */
.play-button-wrapper i {
    margin-left: 0px;
}

#p-trigger:hover .play-button-wrapper {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.8);
}

/* Animasi berdenyut agar menarik perhatian user */
@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 0, 85, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0);
    }
}

/* --- BUTTON WATCH MODERN --- */
.btn-watch-now {
    background: #1c293d;
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px; /* Membuat bentuk pil */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.3);
}

.btn-watch-now:hover {
    background: #2a3a4f;
    color: #ff0055;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 0, 85, 0.5);
}

/* Tombol Update Berbeda Warna */
.btn-update {
    background: #1c293d;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-update:hover {
    background: #2a3a4f;
    color: #fff;
    border-color: #2a3a4f;
}

/* Animasi halus untuk ikon saat di-hover */
.btn-watch-now:hover i {
    transform: rotate(360deg);
    transition: transform 0.5s ease;
}

/* --- RESPONSIVE TYPOGRAPHY --- */

/* Judul di Halaman Episode */
.entry-title-episode {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 800;
    line-height: 1.3;
    /* Formula: clamp(UkuranMinimal, UkuranFleksibel, UkuranMaksimal) */
    font-size: clamp(1.2rem, 5vw, 2rem); 
    padding: 0 15px;
}

/* Judul di Halaman Detail Anime (single-anime.php) */
.info-title {
    color: #fff;
    font-weight: 800;
    line-height: 1.2;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    margin-bottom: 15px;
}

/* Judul Section (Daftar Episode, Rekomendasi) */
h3 {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    color: #fff;
    margin-top: 30px;
}

/* Penyesuaian Khusus Perangkat Sangat Kecil (Mobile Portrait) */
@media (max-width: 480px) {
    .entry-title-episode {
        margin-top: 20px;
        letter-spacing: -0.5px; /* Merapatkan teks sedikit agar tidak terlalu memakan ruang */
    }
    
    .info-title {
        text-align: center; /* Judul di tengah khusus di HP */
    }
}

/* Tingkatkan kecerahan teks abu-abu agar lolos kontras */
p, .synopsis-content {
    color: #cbd5e1; /* Lebih terang dari sebelumnya */
}

/* Pastikan semua link memiliki focus state (penting untuk navigasi keyboard) */
a:focus, button:focus {
    outline: 2px solid #ff0055;
    outline-offset: 3px;
}

/* Beri deskripsi pada ikon yang hanya berupa gambar */
.fa-circle-play {
    cursor: pointer;
}

/* Menghindari gambar gepeng */
.anime-card img {
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Animasi zoom saat dihover */
.anime-card:hover img {
    transform: scale(1.1);
}

/* Memperbaiki tampilan scrollbar daftar episode agar sesuai tema */
.ep-scroll-container::-webkit-scrollbar {
    width: 6px;
}
.ep-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Overlay Loading KumaStream */
#kuma-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 30, 0.9); /* Gelap transparan */
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px); /* Efek blur background */
}

/* Munculkan loader */
#kuma-loader.show {
    display: flex !important;
}

/* Animasi Spinner */
.kuma-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 0, 85, 0.1);
    border-top: 5px solid #ff0055; /* Warna pink khas Kuma */
    border-radius: 50%;
    animation: kumaSpin 1s linear infinite;
}

#kuma-loader p {
    color: #fff;
    margin-top: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 12px;
}

@keyframes kumaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.site-notice {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 5px solid #ff0055; /* Warna pink sesuai section 'Terbaru' */
    margin: 20px auto 0;
    max-width: 1200px; /* Sesuaikan dengan lebar container Anda */
    border-radius: 4px;
    overflow: hidden;
}

.notice-wrapper {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    position: relative;
}

.notice-badge {
    background: #ff0055;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 3px;
    margin-right: 15px;
    text-transform: uppercase;
}

.notice-content {
    flex-grow: 1;
    color: #eee;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.notice-content strong {
    color: #00ff88; /* Warna hijau neon untuk penekanan */
}

.notice-close {
    background: transparent;
    border: none;
    color: #777;
    font-size: 20px;
    cursor: pointer;
    margin-left: 10px;
    transition: 0.3s;
}

.notice-close:hover {
    color: #fff;
}

/* Responsif untuk Mobile */
@media (max-width: 768px) {
    .site-notice {
        margin: 10px;
    }
    .notice-badge {
        display: none; /* Sembunyikan badge di layar kecil agar hemat ruang */
    }
}