/* ========================================================
   IMPORT FONT INTERNET (Sora, Montserrat, Poppins)
   ======================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&family=Poppins:wght@400;600;700&family=Sora:wght@800;900&display=swap');

/* ========================================================
   GLOBAL RESET & ATURAN FONT & PALET WARNA SOLID LIGHT FLAT
   ======================================================== */
:root {
    --font-logo: 'Sora', sans-serif;
    --font-heading: 'Sora', sans-serif;
    --font-meta: 'Montserrat', sans-serif;
    --font-body: 'Poppins', sans-serif;

    --bg-canvas: #F0FFF0;       /* HONEYDEW */
    --bg-header: #FFDAB9;       /* SOFT PEACH */
    --accent-primary: #FF7F50;  /* CORAL GLOW */
    --accent-hover: #C23B22;    /* TOMATO JAM */
    --accent-secondary: #87CEEB;/* SKY BLUE */
    
    --bg-card: #FFFFFF;         
    --bg-input: #FFFFFF;
    --border-color: #E0E0E0;
    --text-main: #2C3E50;       
    --text-muted: #7F8C8D;
    --text-on-accent: #FFFFFF;

    --fs-logo: clamp(1.2rem, 2.5vw, 2.2rem);
    --fs-title: clamp(1.1rem, 2vw, 1.5rem);
}

html, body {
    background-color: var(--bg-canvas) !important;
    color: var(--text-main) !important;
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh; overflow-x: hidden;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none; color: inherit; }

/* ========================================================
   💥 HIGH-CONTRAST SOLID FLAT SCROLLBAR SYSTEMS (JELAS & TEGAS)
   ======================================================== */
::-webkit-scrollbar {
    width: 14px; /* Dipertebal agar jelas terlihat di HP */
    height: 14px;
}
::-webkit-scrollbar-track {
    background: #E2E8F0 !important; /* Warna track abu kontras terang */
    border-left: 3px solid var(--text-main);
}
::-webkit-scrollbar-thumb {
    background: var(--text-main) !important; /* Batangan thumb gelap pekat biar kelihatan jelas */
    border: 2px solid #FFFFFF;
    border-radius: 4px !important;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover) !important;
}

/* ========================================================
   HEADER STYLE (FIXED PATEN MELAYANG)
   ======================================================== */
header {
    background: var(--bg-header) !important;
    padding: 0 16px;
    position: fixed !important;
    top: 0; left: 0; right: 0; width: 100%;
    z-index: 1000;
    height: 65px; display: flex; align-items: center;
    border-bottom: 4px solid var(--text-main) !important;
    border-radius: 0px 0px 20px 6px !important;
    box-shadow: 0 4px 0px rgba(44, 62, 80, 0.15);
}

.nav-container {
    max-width: 2400px; margin: 0 auto; display: flex;
    justify-content: space-between; align-items: center; width: 100%;
}

.logo {
    font-family: var(--font-logo); font-size: var(--fs-logo); font-weight: 900;
    text-transform: uppercase; color: var(--accent-hover); cursor: pointer;
    letter-spacing: -0.5px; text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
}
.logo span { color: var(--text-main); }

/* KOTAK PENCARIAN MEKAR */
.search-box {
    display: flex; align-items: center; background: var(--bg-input);
    border: 3px solid var(--text-main) !important; 
    border-radius: 14px 30px 14px 30px !important;
    width: 44px; height: 44px; overflow: hidden;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#search-input {
    width: 0; opacity: 0; background: transparent; border: none; padding: 0;
    color: var(--text-main); font-size: 0.88rem; outline: none; font-family: var(--font-body);
    transition: width 0.35s, opacity 0.25s;
}

#search-btn {
    background: transparent !important; 
    color: var(--text-main) !important; 
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 38px; height: 38px; min-width: 38px; display: flex;
    align-items: center; justify-content: center; cursor: pointer; z-index: 2;
}

#search-btn svg {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
}

.search-box:focus-within {
    width: clamp(160px, 50vw, 250px);
    border-color: var(--accent-hover) !important;
    padding-left: 12px;
    background: #ffffff;
}
.search-box:focus-within #search-input { width: 100%; opacity: 1; }

.search-box:focus-within #search-btn svg {
    transform: rotate(360deg);
    color: var(--accent-hover);
}

/* ========================================================
   LAYOUT CONTAINER & FLOATING BOTTOM NAV
   ======================================================== */
.app-layout { display: flex; flex-direction: column; width: 100%; padding-top: 80px; }
.content-section { flex: 1; padding: 12px 14px 20px 14px; }

.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-header);
    z-index: 9999;
    display: flex; justify-content: space-around; align-items: center;
    padding: 12px 6px;
    border-top: 4px solid var(--text-main) !important;
    border-radius: 24px 8px 0px 0px !important;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
}
.nav-menu-title { display: none; }

.nav-shortcut-btn {
    background: transparent !important; 
    border: none !important; 
    color: var(--text-main);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: 0.72rem; font-family: var(--font-meta); font-weight: 800;
    cursor: pointer; padding: 6px 12px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.nav-shortcut-btn svg { transition: color 0.2s ease, transform 0.2s ease; }

.nav-shortcut-btn.active {
    color: var(--accent-hover) !important;
    background: transparent !important;
    transform: translateY(-2px);
}
.nav-shortcut-btn.active svg { 
    color: var(--accent-hover) !important; 
    transform: scale(1.1); 
}

/* ========================================================
   FLAG SCROLLER BENDERA (DI BAWAH CAROUSEL BANNER)
   ======================================================== */
.flag-filter-section { margin-bottom: 22px; width: 100%; }
.flag-scroller {
    display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px;
    white-space: nowrap; -webkit-overflow-scrolling: touch;
}
.flag-scroller::-webkit-scrollbar { display: none; }

.flag-capsule {
    background: var(--bg-card);
    border: 3px solid var(--text-main) !important;
    border-radius: 6px 16px 4px 12px !important;
    color: var(--text-main); padding: 9px 15px;
    font-family: var(--font-meta); font-weight: 800; font-size: 0.76rem;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
.flag-capsule.active, .flag-capsule:hover {
    background: var(--accent-primary) !important;
    color: white !important;
    border-color: var(--text-main) !important;
    transform: scale(1.04) rotate(-1deg);
    box-shadow: 3px 3px 0px var(--text-main);
}

/* ========================================================
   DAFTAR KARTU GRID & PENATAAN MARGIN BARU (ANTI-DEMPET)
   ======================================================== */
.grid-section {
    margin-bottom: 35px;
}

.section-title {
    font-family: var(--font-heading); font-size: var(--fs-title); font-weight: 900;
    margin-bottom: 26px; 
    color: var(--text-main); text-transform: uppercase;
    display: inline-block; position: relative; letter-spacing: -0.3px;
}
.section-title::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 35px; height: 4px; background: var(--accent-hover);
}

.dynamic-asymmetric-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}

.comic-card {
    background: var(--bg-card);
    border: 3px solid var(--text-main) !important;
    border-radius: 20px 4px 16px 4px !important;
    overflow: hidden; position: relative; display: flex; flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
    cursor: pointer;
}
.comic-card:hover, .comic-card:active {
    transform: translateY(-5px);
    box-shadow: 5px 5px 0px var(--text-main);
    border-color: var(--accent-hover) !important;
}

.poster-frame { width: 100%; aspect-ratio: 2/3; overflow: hidden; background: #e5e7eb; position: relative; }
.comic-cover {
    width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important;
    transition: transform 0.5s ease;
    image-rendering: -webkit-optimize-contrast !important; image-rendering: high-quality !important;
}
.comic-card:hover .comic-cover { transform: scale(1.05); }

.comic-info { padding: 10px 8px; display: flex; flex-direction: column; flex-grow: 1; }
.comic-title {
    font-family: var(--font-heading); font-size: 0.84rem; font-weight: 800; line-height: 1.25;
    color: var(--text-main); margin-bottom: 6px; overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; height: 2.5em;
}

.comic-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; font-family: var(--font-meta); margin-top: auto; }
.comic-meta span:first-child { color: var(--accent-hover); font-weight: 800; }
.comic-meta span:last-child { background: var(--bg-canvas); color: var(--text-muted); padding: 1px 5px; border-radius: 4px; font-weight: 600; }

.card-badge {
    font-family: var(--font-meta); position: absolute; top: 8px; left: 8px;
    padding: 3px 7px; font-size: 0.55rem; font-weight: 900; border-radius: 4px 8px 4px 8px;
    z-index: 5; text-transform: uppercase; color: #FFFFFF; border: 2px solid var(--text-main);
}
.manga { background: var(--accent-hover) !important; }
.manhwa { background: var(--accent-secondary) !important; color: var(--text-main) !important; }
.manhua { background: var(--accent-primary) !important; }

/* ========================================================
   BOX KLASEMEN TOP 10 GLOBAL LEADERBOARD
   ======================================================== */
.leaderboard-vertical-stack {
    display: flex; flex-direction: column; gap: 10px; background: var(--bg-card);
    border: 3px solid var(--text-main) !important; 
    border-radius: 16px 4px 16px 4px !important; padding: 14px;
}
.leader-row {
    display: flex; align-items: center; gap: 12px; padding: 8px;
    border-bottom: 2px dashed var(--border-color); cursor: pointer;
    transition: transform 0.2s ease;
}
.leader-row:last-child { border-bottom: none; }
.leader-row:hover { transform: translateX(5px); }

.leader-rank {
    font-family: var(--font-heading); font-size: 0.95rem; font-weight: 900;
    color: white; background: var(--text-main); width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.leader-row:nth-child(1) .leader-rank { background: #FFD700; color: #000; }
.leader-row:nth-child(2) .leader-rank { background: #C0C0C0; color: #000; }
.leader-row:nth-child(3) .leader-rank { background: #CD7F32; color: #fff; }

.leader-thumb { width: 34px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; border: 2px solid var(--text-main); }
.leader-info { flex: 1; min-width: 0; }
.leader-title { font-size: 0.82rem; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-stat { font-size: 0.68rem; font-family: var(--font-meta); color: var(--accent-hover); font-weight: 700; margin-top: 1px; }

/* ========================================================
   CONTINUE READING WIDGET STRIP
   ======================================================== */
.continue-card-strip {
    display: flex; align-items: center; gap: 12px; background: var(--bg-card);
    border: 3px solid var(--accent-primary) !important; 
    border-radius: 12px 4px 12px 4px !important; padding: 10px; cursor: pointer;
    transition: transform 0.2s;
}
.continue-card-strip:hover { transform: translateY(-2px); }
.continue-thumb { width: 38px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; border: 1px solid var(--text-main); }
.continue-details h4 { font-size: 0.84rem; font-weight: 800; color: var(--text-main); }
.continue-details p { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-meta); }

/* ========================================================
   CAROUSEL HERO SLIDER COMPONENT
   ======================================================== */
.hero-container { 
    width: 100%; height: 165px; background: var(--bg-header); 
    border: 3px solid var(--text-main) !important; 
    border-radius: 16px 4px 16px 4px !important; 
    position: relative; overflow: hidden; margin-bottom: 20px; 
}
.slider { width: 100%; height: 100%; position: relative; }
.slide-item { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s ease; display: flex; align-items: center; background-size: cover; background-position: center; }
.slide-item.active { opacity: 1; z-index: 10; }
.slide-item::before { content: ''; position: absolute; inset: 0; background: rgba(240,255,240,0.82); }
.slide-content { position: relative; z-index: 20; padding: 14px; width: 100%; }
.slide-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 900; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-desc { font-size: 0.72rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 10px 0; line-height: 1.3; }
.hero-read-btn { background: var(--accent-hover); color: white; border: 2px solid var(--text-main); padding: 6px 14px; border-radius: 4px 10px; font-weight: 800; font-family: var(--font-meta); font-size: 0.68rem; cursor: pointer; }

/* INDIKATOR BULAT DI BAWAH CAROUSEL */
.slider-dots { display: flex; justify-content: center; gap: 5px; margin: -10px 0 20px 0; position: relative; z-index: 40; }
.dot { width: 7px; height: 7px; background: #d1d5db; border-radius: 50%; transition: all 0.2s; cursor: pointer; }
.dot.active { background: var(--accent-hover); width: 18px; border-radius: 4px; }

.load-more-container { display: flex; justify-content: center; margin: 18px 0; }
.load-more-trigger {
    background: var(--text-main); color: white; border: none; padding: 11px 22px;
    font-family: var(--font-meta); font-weight: 900; font-size: 0.78rem; border-radius: 4px 12px;
    cursor: pointer; border: 2px solid var(--text-main); box-shadow: 3px 3px 0px var(--accent-primary);
}

/* ========================================================
   💥 FOOTER RESMI FULL LAYAR (JEBOL CONTAINER RULES)
   ======================================================== */
footer {
    width: 100% !important;
    background: var(--bg-header) !important;
    border-top: 4px solid var(--text-main) !important;
    padding: 30px 16px 110px 16px; 
    margin-top: 50px;
    text-align: center;
    box-sizing: border-box;
}
.footer-inner h3 {
    font-family: var(--font-logo); font-size: 1.3rem; font-weight: 900;
    color: var(--accent-hover); text-transform: uppercase; margin-bottom: 6px;
}
.footer-inner h3 span { color: var(--text-main); }
.footer-inner p {
    font-size: 0.76rem; color: var(--text-main); font-weight: 600;
    max-width: 450px; margin: 0 auto 15px auto; line-height: 1.4;
}
.footer-copyright {
    font-family: var(--font-meta); font-size: 0.68rem; font-weight: 800;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

/* SYSTEM UTILITIES MODALS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 99999; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.modal-visible { opacity: 1; pointer-events: auto; }
.modal-card { width: 88%; max-width: 380px; background: white; border: 3px solid var(--text-main); border-radius: 12px; padding: 15px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-color); padding-bottom: 6px; margin-bottom: 10px; }
.modal-header h3 { font-family: var(--font-heading); font-size: 0.9rem; color: var(--accent-hover); }
.close-modal-btn { background: transparent; border: none; font-size: 1.3rem; cursor: pointer; }
.modal-body-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.modal-item-row { display: flex; gap: 10px; align-items: center; background: var(--bg-canvas); padding: 6px; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; }
.modal-item-row img { width: 28px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; }
.modal-item-info h5 { font-size: 0.76rem; font-weight: 800; color: var(--text-main); }
.modal-item-info p { font-size: 0.65rem; color: var(--accent-hover); font-weight: 700; }

/* SPINNER ROTATING CIRCLE */
.spinner-container {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 0; gap: 6px; font-size: 0.72rem;
    font-family: var(--font-meta); color: var(--text-muted);
}
.spinner {
    width: 26px; height: 26px;
    border: 3px solid var(--border-color) !important;
    border-top: 3px solid var(--accent-hover) !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (min-width: 1024px) {
    .app-layout { flex-direction: row; padding: 30px 40px 0 40px; gap: 30px; padding-top: 90px; }
    .bottom-nav { position: sticky; top: 110px; width: 190px; height: fit-content; flex-direction: column; padding: 15px; border-radius: 12px; border: 3px solid var(--text-main); gap: 12px; bottom: auto; left: auto; right: auto; }
    .dynamic-asymmetric-grid { grid-template-columns: repeat(4, 1fr); }
    .hero-container { height: 240px; }
    .slider-dots { margin: 10px 0 25px 0; }
    footer { padding: 30px 40px; }
}
.hidden { display: none !important; }