/* =================================
   TEMA MODERN (Dark + Cyan)
   ================================= */
:root {
    --primary-color: #22D3EE; /* Cyan Cerah */
    --bg-color: #18181B;      /* Latar Belakang (Zinc 900) */
    --card-bg: #27272A;     /* Card (Zinc 800) */
    --text-color: #F4F4F5;    /* Teks (Zinc 100) */
    --text-muted: #A1A1AA;     /* Teks Muted (Zinc 400) */
    --border-color: #3F3F46;  /* Border (Zinc 700) */
    
    /* Font Modern (Inter) */
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* Reset dasar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    flex-grow: 1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}
a:hover {
    color: #67E8F9;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* Rounded corners modern */
}

h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

/* =================================
   PAGE LOADER
   ================================= */
.page-loader {
    /* Sembunyi secara default */
    opacity: 0;
    pointer-events: none;
    
    /* Tampilan Fullscreen */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* Paling atas */
    
    /* Warna tema (Dark Cyan) */
    background-color: rgba(24, 24, 27, 0.85); /* Zinc 900 + 85% opacity */
    backdrop-filter: blur(5px);
    
    /* Posisi konten (spinner & teks) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    
    transition: opacity 0.2s ease;
}

.page-loader.active {
    /* Tampilkan loader */
    opacity: 1;
    pointer-events: all;
}

.loader-text {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color); /* Abu-abu */
    border-top-color: var(--primary-color); /* Cyan */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =================================
   HEADER & NAVBAR MODERN
   ================================= */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 5%;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-color);
    letter-spacing: 0;
}
.navbar-brand:hover {
    color: #fff;
}
.navbar-version {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 5px;
    vertical-align: super;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 25px;
}
.navbar-links a,
.navbar-refresh {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.navbar-links a:hover,
.navbar-refresh:hover {
    color: var(--primary-color);
    text-decoration: none;
}
/* Tombol Login di-style seperti link biasa */
#login-button {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
#login-button:hover {
    color: #67E8F9;
}
#account-link {
    font-weight: 700;
}

.search-form {
    display: flex;
    margin-left: 20px;
}
.search-input {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 150px;
    transition: width 0.3s ease;
    border-radius: 6px 0 0 6px;
}
.search-input:focus {
    width: 200px;
    border-color: var(--primary-color);
    outline: none;
}
.search-button {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0;
    padding: 8px 12px;
    background-color: var(--primary-color);
    color: #000;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0 6px 6px 0;
    box-shadow: none;
}
.search-button:hover {
    background-color: #67E8F9;
}
.search-button:active {
    transform: none;
    box-shadow: none;
}

/* Tombol Hamburger (Default: Hidden) */
.navbar-toggler {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.navbar-toggler span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* =================================
   FLOATING BUTTONS (Modern)
   ================================= */
.floating-sponsor-pill {
    position: fixed;
    z-index: 1000;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary-color);
    color: #000;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 50px; /* Pill */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    text-decoration: none;
}
.floating-sponsor-pill:hover {
    color: #000;
    transform: scale(1.05);
}
.floating-refresh-circle {
    position: fixed;
    z-index: 1000;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}
.floating-refresh-circle:hover {
    border-color: var(--primary-color);
    transform: rotate(90deg) scale(1.05);
}
.floating-refresh-circle svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color); /* Ikon cyan */
}


/* =================================
   HERO SLIDER (V2 - MODERN)
   (KODE LAMA SUDAH DIHAPUS)
   ================================= */
.hero-swiper {
    width: 100%;
    height: 380px; /* Atur tinggi slider */
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}
.hero-slide-card {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    color: #fff;
}
.hero-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.7); /* Bikin gambar sedikit gelap */
}
.hero-slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(0deg, rgba(17,17,17,1) 0%, rgba(17,17,17,0) 100%);
    z-index: 2;
}
.hero-slide-content {
    position: relative;
    z-index: 3;
    padding: 25px;
    width: 100%;
}
.hero-slide-type {
    background: var(--primary-color);
    color: #111;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}
.hero-slide-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    /* Penting: Agar teks tidak terlalu panjang */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Batasi 2 baris */
    -webkit-box-orient: vertical;
}
.hero-slide-chapter {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}

/* Tombol Modern (Pill) */
.hero-button {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0;
    background-color: var(--primary-color);
    color: #000;
    padding: 10px 25px;
    margin-top: 15px;
    transform: none;
    border: none;
    border-radius: 50px; /* Pill shape */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.hero-button span {
    transform: none;
    letter-spacing: 0;
    display: inline-block;
}
.hero-button:hover:not(:disabled) {
    background-color: #67E8F9;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}
.hero-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.hero-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Tombol khusus di slider V2 */
.hero-slide-content .hero-button {
    background: #fff;
    color: #111;
    text-shadow: none;
    margin-top: 0; /* Hapus margin atas di slider */
}
.hero-slide-content .hero-button:hover {
    background: var(--primary-color);
}

/* Navigasi Swiper */
.hero-swiper .swiper-pagination-bullet {
    background: rgba(255,255,255,0.7);
}
.hero-swiper .swiper-pagination-bullet-active {
    background: var(--primary-color);
    width: 20px;
    border-radius: 5px;
}
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(0,0,0,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: var(--primary-color);
    color: #111;
}
.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
    font-size: 1.2rem;
    font-weight: 800;
}


/* =================================
   JUDUL SECTION
   ================================= */
.section-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 5px;
}
.section-view-all {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.section-view-all:hover {
    color: var(--primary-color);
}


/* =================================
   CARD KOMIK (Grid)
   ================================= */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.comic-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}
.card-image-wrapper {
    position: relative;
    aspect-ratio: 3 / 4;
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.card-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}
.card-content {
    padding: 15px;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-body);
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    height: 2.8em; /* 1.4em * 2 baris */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal; /* Izinkan wrapping */
}

/* =================================
   HALAMAN DETAIL
   ================================= */
.detail-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}
.detail-poster {
    width: 100%;
    max-width: 250px;
    align-self: center;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.detail-info {
    text-align: center;
}
.detail-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 3.5rem;
    color: var(--text-color);
    line-height: 1.2;
}
.detail-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.genres {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.genre-tag {
    background-color: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 50px; /* Pill */
    font-size: 0.85rem;
    font-weight: 500;
    transform: none;
}
#bookmark-button {
    margin-top: 15px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#bookmark-button.bookmarked {
    background-color: #28a745;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#bookmark-button.bookmarked:hover {
    background-color: #218838;
}
.synopsis {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    line-height: 1.7;
    margin-bottom: 30px;
    font-size: 0.95rem;
}
.chapter-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}
.chapter-list li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}
.chapter-list li:last-child {
    border-bottom: none;
}
.chapter-list li:hover {
    background-color: var(--bg-color);
}
.chapter-list li a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-color);
}
.chapter-list li:hover a {
    color: var(--primary-color);
}
.chapter-list li small {
    color: var(--text-muted);
}

/* =================================
   FITUR: LANJUTKAN MEMBACA (DETAIL)
   (KODE DUPLIKAT SUDAH DIHAPUS)
   ================================= */
.continue-reading-box {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-image: linear-gradient(90deg, var(--primary-color), #ffc107) 1;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}
.continue-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.continue-title-wrapper svg {
    width: 24px;
    height: 24px;
    fill: #ffc107;
}
.continue-title-wrapper h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}
.continue-reading-box p {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 15px 0;
}
.continue-reading-box p strong {
    color: #ffc107; 
    font-weight: 600;
}
.continue-reading-box .hero-button {
    display: inline-block;
    background: linear-gradient(90deg, var(--primary-color), #ffc107);
    color: #111;
    text-shadow: none;
    padding: 10px 20px;
}
.continue-reading-box .hero-button:hover {
    opacity: 0.9;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

/* Style untuk chapter yang sudah dibaca */
.chapter-list li a.read {
    color: var(--primary-color);
    font-weight: 700;
}
.chapter-list li a.read::before {
    content: '✓ '; /* Tambah tanda cek */
    color: var(--primary-color);
}

/* =================================
   REKOMENDASI (DETAIL)
   ================================= */
.recommendation-section {
    margin-top: 30px;
}

.recommendation-genre-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color); /* Ganti dari var(--primary-color-dark) */
    display: inline-block;
}

.recommendation-list {
    display: flex;
    overflow-x: auto; /* Ini yang bikin bisa scroll samping */
    gap: 15px;
    padding-bottom: 20px;
    -ms-overflow-style: none;  /* Sembunyikan scrollbar di IE/Edge */
    scrollbar-width: none;  /* Sembunyikan scrollbar di Firefox */
}

.recommendation-list::-webkit-scrollbar {
    display: none; /* Sembunyikan scrollbar di Chrome/Safari */
}

.recommendation-list .comic-card {
    flex: 0 0 160px; /* Lebar card 160px, tidak akan stretch */
    width: 160px;
}

/* =================================
   HALAMAN BACA
   ================================= */
.baca-title {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.5rem;
}
.reader-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}
.reader-nav .hero-button {
    font-size: 1.1rem;
    padding: 8px 20px;
}
.reader-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #000;
}
.reader-area img {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    border-radius: 0;
}

/* =================================
   HALAMAN RIWAYAT
   ================================= */
.history-item {
    display: flex;
    flex-direction: column; 
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    gap: 15px;
    padding: 15px;
    transition: border-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.history-item:hover {
    border-color: var(--primary-color);
}
.history-image-link {
    position: relative;
    width: 90px;
    flex-shrink: 0;
    align-self: center; 
}
.history-image-link img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
}
.history-type-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #28a745;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-body);
}
.history-type-badge.manga { background-color: #dc3545; }
.history-type-badge.manhwa { background-color: #28a745; }
.history-type-badge.manhua { background-color: #007bff; }
.history-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    text-align: center; 
}
.history-title-link h4 {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-title-link:hover h4 {
    color: var(--primary-color);
}
.history-chapter-link {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
}
.history-chapter-link:hover {
    color: #67E8F9;
}
.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}
.history-synopsis {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}


/* =================================
   HALAMAN GENRE
   ================================= */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.genre-button {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    padding: 12px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.genre-button span {
    transform: none;
    display: inline-block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.genre-button span .genre-count {
    font-family: var(--font-body);
    font-weight: 500;
    color: #000;
    opacity: 0.7;
    font-size: 0.9rem;
    margin-left: 5px;
}
.pagination-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}
.pagination-info p {
    margin: 5px 0;
}


/* =================================
   PAGINATION
   ================================= */
.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
}
.pagination-btn {
    font-size: 1rem;
    padding: 10px 20px;
}
.pagination-nav a:only-child {
    margin-left: auto;
}


/* =================================
   FOOTER (MODERN BARU)
   ================================= */
.site-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 5%;
    width: 100%;
    margin-top: 40px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}
.footer-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 5px 0;
}

/* =================================
   HALAMAN 404
   ================================= */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}
.error-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 8rem;
    color: var(--primary-color);
    line-height: 1;
    margin: 0;
}
.error-subtitle {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}
.error-page p {
    color: var(--text-color);
    margin-bottom: 30px;
    max-width: 400px;
}

/* =================================
   BACA - BOTTOM NAV BAR (Modern)
   ================================= */
.baca-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: stretch; 
    padding: 8px 0;
}

.baca-nav-button,
.baca-nav-control {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted); /* Abu-abu */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    flex: 1;
}
.baca-nav-button svg,
.baca-nav-control svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted); /* Abu-abu */
    transition: all 0.2s ease;
}
.baca-nav-button span,
.baca-nav-control > span {
    transition: all 0.2s ease;
}
.baca-nav-button:hover svg,
.baca-nav-button:hover span,
.baca-nav-button.active svg,
.baca-nav-button.active span,
.baca-nav-control:hover svg,
.baca-nav-control:hover > span,
.baca-nav-control.active svg,
.baca-nav-control.active > span {
    color: var(--primary-color); /* Jadi cyan */
    fill: var(--primary-color);
}

.scroll-speed-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 8px;
    visibility: hidden;
    opacity: 0;
    height: 0;
    transition: all 0.2s ease;
}
.scroll-speed-controls.hidden {
    visibility: hidden;
    opacity: 0;
    height: 0;
}
.scroll-speed-btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
}
.scroll-speed-btn:hover {
    background-color: #67E8F9;
}
#scroll-speed-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    padding: 0 12px;
}
.baca-nav-control.active .scroll-speed-controls {
    visibility: visible;
    opacity: 1;
    height: 28px;
    margin-bottom: 4px;
}

/* =================================
   BACA - MODAL CHAPTER (Modern)
   ================================= */
.baca-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.baca-modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.baca-modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.baca-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}
.baca-modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    letter-spacing: 0;
    margin: 0;
}
#chapter-modal-close {
    font-family: 'Arial', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.baca-modal-list {
    list-style: none;
    overflow-y: auto;
    padding: 10px;
    margin: 0;
}
.baca-modal-list li {
    margin-bottom: 5px;
}
.baca-modal-list a {
    display: block;
    padding: 10px 15px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    border-radius: 6px;
}
.baca-modal-list a:hover {
    background-color: #3F3F46;
    color: var(--text-color);
}
.baca-modal-list a.current {
    background-color: var(--primary-color);
    color: #000;
    font-weight: 700;
}
.baca-modal-list a.read {
    color: var(--text-muted);
}
.baca-modal-list a.read:not(.current) {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}


/* =================================
   FITUR HAPUS (Bookmark & Riwayat)
   ================================= */

/* Tombol "Hapus Riwayat" */
.clear-history-btn {
    font-size: 0.9rem; /* Kecilkan tombol */
    padding: 6px 15px;
    margin-left: auto; /* Dorong ke kanan */
    background-color: #dc3545; /* Merah */
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.clear-history-btn:hover {
    background-color: #c82333;
    color: #fff;
}

/* Card di Halaman Bookmark (untuk posisi tombol X) */
.bookmark-card {
    position: relative; /* Penting untuk tombol X */
}

/* Tombol "X" Hapus Bookmark */
.bookmark-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 26px; /* Center 'x' */
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bookmark-delete-btn:hover {
    background-color: #dc3545; /* Merah saat hover */
    color: #fff;
    transform: scale(1.1);
}

/* Link judul di card bookmark */
.card-content .card-title-link {
    text-decoration: none;
    color: var(--text-color);
}
.card-content .card-title-link:hover .card-title {
    color: var(--primary-color);
}

/* =================================
   MODAL KONFIRMASI
   ================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gunakan warna tema, tapi lebih transparan */
    background-color: rgba(24, 24, 27, 0.7); 
    backdrop-filter: blur(5px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    transform: scale(1);
    transition: transform 0.3s ease;
}
.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.modal-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-color);
    margin: 0;
}
.modal-body {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.modal-btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal-btn-cancel {
    background-color: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.modal-btn-cancel:hover {
    background-color: var(--bg-color);
}
/* Tombol Hapus pakai warna merah */
.modal-btn-confirm {
    background-color: #dc3545;
    color: #fff;
}
.modal-btn-confirm:hover {
    background-color: #c82333;
}

/* =================================
   HALAMAN DOWNLOAD PWA
   ================================= */
.download-content {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.download-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 25px;
}
#install-pwa-button {
    font-size: 1.2rem;
    padding: 12px 25px;
    width: 100%;
}
.ios-instructions {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.ios-instructions h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}
.ios-instructions ol {
    color: var(--text-muted);
    padding-left: 20px;
}
.ios-instructions li {
    margin-bottom: 10px;
    line-height: 1.6;
}
.ios-instructions svg {
    vertical-align: middle;
    margin: 0 4px;
}
/* Style link "Download App" di header */
.download-app-link {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}
/* =================================
   MODAL LOGIN (BARU)
   ================================= */
.modal-close-btn {
    font-family: 'Arial', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.auth-btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.auth-btn.google {
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
}
.auth-btn.google:hover { background-color: #f1f1f1; }
.auth-btn.github {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}
.auth-btn.github:hover { background-color: #444; }
/* =================================
   HALAMAN AKUN (BARU)
   ================================= */
.account-info {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
}
.account-info p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}
.account-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.account-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    transition: all 0.2s ease;
}
.account-menu-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.account-menu-item span {
    font-size: 1.5rem;
}
.logout-btn {
    width: 100%;
    cursor: pointer;
    color: #dc3545; /* Merah */
}
.logout-btn:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}
.account-info-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 kolom di HP */
    gap: 15px;
    margin-bottom: 20px;
}
.account-info-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}
.account-info-item .info-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}
.account-info-item p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    /* Biar bisa wrap jika IP-nya panjang */
    word-break: break-all;
}
.status-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}
.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-item.status-online .status-indicator {
    background-color: #28a745; /* Hijau */
    box-shadow: 0 0 10px #28a745;
}
.status-item.status-error .status-indicator {
    background-color: #dc3545; /* Merah */
    box-shadow: 0 0 10px #dc3545;
}

.status-info .status-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}
.status-item.status-error .status-name {
    color: #dc3545;
}

.status-info .status-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}
/* Style untuk indikator "Loading..." */
.status-indicator.loading {
    background-color: var(--text-muted); /* Warna abu-abu */
    animation: pulse-animation 1.5s infinite;
}

/* Animasi berdenyut untuk loading */
@keyframes pulse-animation {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Pastikan judul yang error tetap merah (JS akan bantu) */
.status-item.status-error .status-name {
    color: #dc3545;
}
/* =================================
   HALAMAN DOWNLOAD (V2)
   ================================= */
.download-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: var(--card-shadow);
}
.download-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin-bottom: 20px;
    background: #333; /* Fallback jika logo tidak ada */
}
.download-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}
.download-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 450px;
    margin-bottom: 30px;
    line-height: 1.6;
}
.download-container .hero-button {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 1.1rem;
}
.download-container .hero-button:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.7;
}
.ios-instructions {
    margin-top: 25px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.ios-instructions p {
    margin: 0;
}
.sticky-banner-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    z-index: 998; /* Di bawah loader, tapi di atas konten */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-height: 70px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
}
.sticky-banner-ad .ad-content {
    flex-grow: 1;
    text-align: center;
    color: var(--text-muted);
}
.ad-close-btn {
    position: absolute;
    top: -15px; /* Tepat di atas border */
    right: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}
.ad-close-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.ad-interstitial {
    /* Sudah di-style oleh .modal-overlay, kita hanya kustomisasi konten */
    z-index: 9998; /* Di bawah loader, tapi di atas banner */
}
.ad-interstitial-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.ad-interstitial-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    min-height: 100px; /* Tempat iklan */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 4px;
    margin-bottom: 20px;
}
.ad-interstitial-footer {
    color: var(--text-muted);
    margin-bottom: 15px;
}
.ad-interstitial-footer #ad-countdown {
    color: var(--primary-color);
    font-size: 1.2rem;
}
.ad-skip-btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transition: all 0.2s ease;
}
.ad-skip-btn:not(:disabled) {
    cursor: pointer;
    background: var(--primary-color);
    color: #111;
    border-color: var(--primary-color);
}
/* =================================
   SEMBUNYIKAN FLOAT BUTTONS
   ================================= */
   .user-logged-in .ad-container {
    display: none !important;
}
body.baca-page-active .floating-refresh-circle,
body.baca-page-active .floating-sponsor-pill {
    display: none !important;
}

/* =================================
   RESPONSIVE (HP - Navbar)
   ================================= */
@media (max-width: 768px) {
    .navbar-toggler {
        display: block;
    }
    .account-info-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* === INI YANG DIUBAH (BAGIAN 1) === */
    .navbar-links {
        /* display: none; */ /* <-- DIHAPUS */
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 67px;
        left: 0;
        right: 0;
        background-color: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        box-shadow: 0 8px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;

        /* KODE ANIMASI BARU */
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: all 0.3s ease-out;
    }
    
    /* === INI YANG DIUBAH (BAGIAN 2) === */
    .navbar-links.active {
        /* display: flex; */ /* <-- DIHAPUS */
        
        /* KODE ANIMASI BARU */
        max-height: 500px; /* Cukup untuk semua menu */
        opacity: 1;
    }
    
    /* === INI YANG DIUBAH (BAGIAN 3) === */
    .navbar-links a,
    .navbar-refresh,
    #login-button,
    #account-link {
        padding: 15px 5%;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        font-size: 1.1rem;
        font-weight: 500;
        
        /* Tambahan agar rata kiri */
        text-align: left;
        box-sizing: border-box;
    }
    
    .navbar-links a:hover {
        background-color: var(--bg-color);
    }
    
    .navbar-toggler.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .navbar-toggler.active span:nth-child(2) {
        opacity: 0;
    }
    .navbar-toggler.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .search-form {
        width: 100%;
        padding: 10px 5%;
        margin-left: 0;
        border-bottom: 1px solid var(--border-color);
    }
    .search-input {
        width: 100%;
        flex-grow: 1;
    }
    .search-input:focus {
        width: 100%;
    }

    /* Bug overflow di HP */
    .genre-button,
    #bookmark-button {
        width: 100%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* Hapus shadow horizontal */
    }

}


/* =================================
   RESPONSIVE (PC / Desktop)
   ================================= */
@media (min-width: 768px) {
    
    /* KODE LAMA SLIDER PC DIHAPUS 
    */

    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 25px;
    }

    .detail-header {
        flex-direction: row; 
        text-align: left;
    }
    .detail-poster {
        width: 300px; 
        flex-shrink: 0;
        align-self: flex-start;
    }
    .detail-info {
        text-align: left;
    }
    .detail-title {
        font-size: 4rem;
    }
    .genres {
        justify-content: flex-start;
    }
    #bookmark-button {
        width: auto;
    }

    .reader-area img {
        max-width: 800px;
    }
    .reader-nav {
        justify-content: space-between;
    }

    .history-item {
        flex-direction: row;
        align-items: flex-start;
    }
    .history-image-link {
        align-self: flex-start;
    }
    .history-info {
        text-align: left;
    }
    
    .genre-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .genre-button {
        width: auto;
    }
}