* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --bg-primary: #f8fafc; /* Slate 50 - Bersih & Modern */
    --bg-sidebar: #f1f5f9; /* Slate 100 */
    --text-main: #0f172a;  /* Slate 900 - Kontras Tinggi */
    --text-muted: #64748b; /* Slate 500 */
    --accent-color: #0d9488; /* Teal 600 - Keseimbangan Produktivitas & Spiritual */
    --border-color: #e2e8f0; /* Slate 200 */
    --font-size-base: 18px;
    --line-height-base: 1.8;
}

[data-theme="dark"] {
    --bg-primary: #020617; /* Slate 950 - Sangat Dalam */
    --bg-sidebar: #0f172a; /* Slate 900 */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-color: #2dd4bf; /* Teal 400 - Glow Modern */
    --border-color: #1e293b;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    width: 100%;
    /* Efek Grid Halus untuk Nuansa 'Algoritma' */
    background-image: 
        radial-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
    background-attachment: fixed;
}

/* Anti-Select Protections */
.secure-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Layout Structure using Flexbox for modern responsiveness */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar-cell {
    flex: 0 0 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
}

.content-cell {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Sidebar Internal Layout */
.sidebar-wrapper {
    display: block;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.sidebar-close-btn {
    display: none;
}

.book-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.book-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-container {
    margin-bottom: 24px;
}

#sidebarSearch {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#sidebarSearch:focus {
    border-color: var(--accent-color);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 16px;
}

.toc-chapter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    cursor: pointer;
}

.toc-sub-list {
    list-style: none;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
}

.toc-sub-item {
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s;
    text-align: start;
}

.toc-sub-item:hover, .toc-sub-item.active {
    color: var(--accent-color);
    font-weight: 500;
}

.toc-sub-item.active {
    position: relative;
    padding-left: 10px;
}

.toc-sub-item.active::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent-color);
}

/* Main Content Internal Layout */
.content-wrapper {
    display: block;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.top-navbar {
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
}

.lang-selector {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    outline: none;
    background-color: var(--bg-sidebar);
    transition: border-color 0.2s, color 0.2s;
}

.lang-selector:focus {
    border-color: var(--accent-color);
}

.nav-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.progress-container {
    width: 150px;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    overflow: hidden;
}

.progress-bar {
    width: 30%;
    height: 100%;
    background-color: var(--accent-color);
}

/* Reading Area Layout */
.reader-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 40px;
    position: relative;
}

/* Dynamic Visual Watermark Wrapper */
.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='250' height='250' viewBox='0 0 250 250'><text fill='rgba(13, 148, 136, 0.04)' font-size='13' font-family='sans-serif' x='20' y='100' transform='rotate(-25, 100, 100)'>USER: kaffahmedia_reader</text></svg>");
    z-index: 2;
}

.chapter-header {
    margin-bottom: 40px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 20px;
}

.chapter-category {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.chapter-main-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

.article-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    position: relative;
    z-index: 3;
}

.article-body p {
    margin-bottom: 24px;
    text-align: justify;
}

.article-body h2 {
    font-size: 28px;
    margin: 40px 0 30px 0;
    color: var(--text-main);
    background-color: var(--bg-sidebar);
    padding: 24px;
    border-left: 8px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.article-body h3 {
    font-size: 22px;
    margin: 35px 0 20px 0;
    color: var(--text-main);
    border-left: 4px solid var(--accent-color);
    padding: 10px 16px;
    background: linear-gradient(90deg, var(--bg-sidebar) 0%, transparent 100%);
    scroll-margin-top: 90px; /* agar tidak tertutup navbar sticky saat lompat */
}

.content-section {
    scroll-margin-top: 90px;
    border-radius: 6px;
}

/* Navigation Footer Inside Article */
.section-footer-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.btn-nav-page {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-nav-page:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-nav-page:disabled {
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Realistic highlight callout panel */
.insight-box {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--accent-color);
    padding: 28px;
    margin: 32px 0;
    border-radius: 4px 16px 16px 4px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.03);
}

.summary-box {
    background-color: rgba(13, 148, 136, 0.05);
    border: 1px solid var(--accent-color);
    padding: 24px;
    margin: 40px 0;
    border-radius: 8px;
}

.summary-box h4 {
    color: var(--accent-color);
    margin-bottom: 12px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prayer-box {
    background-color: rgba(13, 148, 136, 0.08);
    border: 2px dashed var(--accent-color);
    border-radius: 20px;
    padding: 25px;
    margin: 40px 0;
    text-align: center;
}

/* --- INTERACTIVE CHECKLIST COMPONENT --- */
.interactive-checklist {
    list-style: none;
    padding-left: 0;
}

.interactive-checklist li {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.interactive-checklist input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    flex-shrink: 0;
    margin-top: 3px;
    transition: background-color 0.2s, border-color 0.2s;
}

.interactive-checklist input[type="checkbox"]::before {
    content: "✔";
    font-size: 14px;
    color: #ffffff;
    transform: scale(0);
    transition: transform 0.15s ease-in-out;
}

.interactive-checklist input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.interactive-checklist input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.interactive-checklist input[type="checkbox"]:checked + div {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.8;
}

.prayer-arabic {
    font-size: 24px;
    line-height: 2;
    margin-bottom: 15px;
    color: var(--text-main);
    font-family: "Amiri", serif; /* Jika font ini tersedia atau fallback ke serif */
}

.insight-box p {
    margin-bottom: 0;
    font-style: italic;
    color: var(--text-main);
}

/* --- GAYA TEKS ARAB & TERJEMAHAN --- */
.arabic-text {
    font-family: "Amiri", "Traditional Arabic", "Scheherazade", serif;
    font-size: 26px;
    line-height: 2;
    text-align: right;
    direction: rtl;
    display: block;
    margin-bottom: 12px;
    color: var(--text-main);
}

.arabic-text::before {
    content: "﴿ ";
    color: var(--accent-color);
    font-family: "Amiri", serif;
    font-weight: normal;
}

.arabic-text::after {
    content: " ﴾";
    color: var(--accent-color);
    font-family: "Amiri", serif;
    font-weight: normal;
}

.translation {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    font-style: italic;
    display: block;
}

.quran-quote, .hadith-quote {
    background-color: rgba(13, 148, 136, 0.03);
    border-left: 4px solid var(--accent-color);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 12px 12px 0;
}

/* Toast Protection Alert Notification */
.security-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #c84343;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    z-index: 100;
    font-weight: 500;
}

/* Kelas untuk menyembunyikan sidebar secara total */
.sidebar-hidden {
    display: none !important;
}

/* Modifikasi tombol menu agar lebih interaktif */
.nav-btn-toggle {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.hidden-item {
    display: none !important;
}

/* --- RESPONSIVE MOBILE FIXES --- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .sidebar-cell {
        display: block !important;
        width: 300px;
        max-width: 85%;
        border-right: 1px solid var(--border-color);
        position: fixed;
        z-index: 1001;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translate3d(0, 0, 0);
        will-change: transform;
        backface-visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar-cell.sidebar-hidden {
        display: block !important;
        transform: translate3d(-100%, 0, 0);
        box-shadow: none;
    }

    .sidebar-close-btn {
        display: flex;
        position: absolute;
        top: 16px;
        right: 16px;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 28px;
        cursor: pointer;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background-color 0.2s;
        z-index: 10;
    }

    .sidebar-close-btn:active {
        background-color: var(--border-color);
    }

    .content-cell {
        width: 100%;
    }

    .top-navbar {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .top-navbar > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 12px;
    }

    .nav-controls {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        gap: 6px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar */
    }

    .nav-controls::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .nav-btn, .lang-selector {
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 12px;
    }

    .progress-container {
        width: 60px;
    }

    .reader-container {
        padding: 24px 16px;
    }

    .chapter-main-title {
        font-size: 22px;
    }

    .article-body h2 {
        font-size: 20px;
        padding: 16px;
        margin: 24px 0 16px 0;
        border-left-width: 6px;
    }

    .article-body h3 {
        font-size: 17px;
        margin: 20px 0 12px 0;
        padding: 8px 12px;
    }

    .article-body p {
        margin-bottom: 16px;
        font-size: 16px;
        line-height: 1.6;
    }

    .quran-quote, .hadith-quote {
        padding: 14px 16px;
        margin: 16px 0;
    }

    .arabic-text {
        font-size: 22px;
        line-height: 1.8;
    }

    .cover-page {
        align-items: flex-start;
        padding: 40px 16px;
        overflow-y: auto;
    }

    .cover-content {
        margin: auto 0;
    }

    #loginOverlay .cover-content {
        padding: 24px 16px !important;
        width: 95% !important;
        margin: auto;
    }

    .audio-player-control {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 8px !important;
        padding: 8px !important;
    }

    .audio-player-control button {
        flex: 1 1 auto;
        font-size: 13px;
        padding: 6px 12px !important;
    }

    #audioStatus {
        width: 100%;
        margin-top: 4px;
    }
}

/* --- COVER PAGE STYLES --- */
.cover-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.cover-content {
    text-align: center;
    max-width: 600px;
    padding: 20px;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cover-logo {
    width: 280px;
    max-width: 80%;
    margin-bottom: 20px;
}

.cover-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 40px;
    line-height: 1.2;
}

.enter-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.enter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cover-brand {
    margin-top: 60px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 14px;
}

/* --- Reference Page Specific Styles --- */
.ref-header-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
}

.ref-group {
    margin-bottom: 45px;
}

.group-title {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-title span { /* For the emoji icon */
    font-size: 1.5rem;
}

.ref-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.ref-card:hover {
    border-color: var(--accent-color);
}

.ref-citation {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    font-size: 1rem;
}

.ref-context {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ref-tag {
    display: inline-block;
    background: rgba(140, 120, 83, 0.1); /* Using accent-color with transparency */
    color: var(--accent-color);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 600;
}

/* --- Author Page Specific Styles --- */
.profile-card {
    text-align: center;
    padding: 30px;
    background-color: var(--bg-sidebar);
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background-size: cover;
    background-position: center;
    border: 4px solid var(--accent-color);
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.profile-title {
    font-size: 14px;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.profile-bio {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 25px !important;
    text-align: center !important;
}

.wa-button {
    display: inline-block;
    background-color: #25d366;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
}

.wa-button:hover {
    transform: scale(1.05);
}

.profile-card .socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.profile-card .icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.profile-card .icon-link:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
}

.profile-card .icon-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.info-section {
    margin-bottom: 30px;
}

.info-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: none;
    padding: 0;
    background: none;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-links a {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 13px;
    transition: all 0.2s;
}

.social-links a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Sembunyikan footer cetak di tampilan web biasa */
.print-footer {
    display: none;
}

/* --- INTERACTIVE JOURNALING BOX --- */
.interactive-journal-box {
    margin-top: 32px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.interactive-journal-box h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.interactive-journal-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.interactive-journal-box textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.interactive-journal-box textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* --- ETALASE WEB BOOK (TENTANG PENULIS) --- */
.other-books-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.other-books-section .section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.other-books-section .section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.other-books-section .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.other-books-section .item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 24px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.other-books-section .item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
    border-color: var(--accent-color);
}

.other-books-section .item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: grayscale(1) opacity(0.7);
    transition: filter 0.2s, opacity 0.2s;
}

[data-theme="dark"] .other-books-section .item img {
    filter: grayscale(1) invert(1) brightness(1.5) opacity(0.7);
}

.other-books-section .item:hover img {
    filter: none;
    opacity: 1;
}

.other-books-section .item h5 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.other-books-section .item p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
    flex-grow: 1;
}

.other-books-section .btn-mini {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    transition: all 0.2s;
}

.other-books-section .item:hover .btn-mini {
    background-color: var(--accent-color);
    color: #ffffff;
}

/* --- SIDEBAR BACKDROP OVERLAY --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

/* --- PRINT STYLES --- */
@media print {
    /* Sembunyikan elemen antarmuka yang tidak perlu */
    .sidebar-cell, 
    .top-navbar, 
    .nav-btn, 
    .progress-container, 
    .section-footer-nav, 
    .security-toast, 
    .cover-page, 
    #loginOverlay,
    .watermark-overlay {
        display: none !important;
    }

    /* Atur margin halaman cetak */
    @page {
        margin: 15mm 15mm 20mm 15mm;
    }

    /* Reset tata letak untuk memaksimalkan area kertas */
    body, .app-container, .content-cell, .content-wrapper {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Pastikan warna teks hitam di atas putih untuk menghemat tinta */
    body {
        background-color: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Menampilkan seluruh konten e-book (termasuk Ringkasan & Kesimpulan) saat diunduh ke PDF */
    #articleBody > * {
        display: block !important;
    }

    .content-section {
        page-break-after: always;
        break-after: page;
    }
}
.speech-highlight {
    background-color: rgba(16, 185, 129, 0.15);
    border-left: 3px solid #10b981;
    padding-left: 8px;
    transition: background-color 0.3s ease;
}

.speech-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 14px;
}

.speech-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-speech-action {
    background: #10b981;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* --- HIGHLIGHT KUNING AUTOMATIS UNTUK AUDIO PLAYER --- */
.audio-active-highlight {
    background-color: rgba(234, 179, 8, 0.25) !important; /* Kuning hangat dengan opasitas 25% */
    border-left: 4px solid #eab308;
    padding-left: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-left 0.3s ease;
}