/* ============================================================
   1. VARIABLES & BASE SETTINGS
   ============================================================ */
:root {
    --marun: #800000;
    --emas: #b8860b;
    --kertas: #f2e8cf;
    --krem: #fffcf2;
    --tinta: #2b1b17;
}

html, body { 
    overflow-x: hidden !important; 
    width: 100%; 
    margin: 0; 
    padding: 0; 
    background-color: var(--kertas);
}

body { 
    font-family: 'Lora', serif; 
    padding-top: 85px; 
    color: var(--tinta); 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   2. HEADER & NAVIGATION ATAS
   ============================================================ */
#control-block {
    position: fixed;
    top: 0;
    width: 100%;
    height: 75px;
    background: var(--krem);
    border-bottom: 3px solid var(--marun);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 20000;
}

#fixed-arabic-title {
    font-family: 'Amiri', serif;
    font-size: 2.6rem; 
    color: var(--marun);
    font-weight: bold;
    direction: rtl;
}

.dropbtn {
    background-color: var(--marun) !important;
    color: var(--emas) !important;
    border: 2px solid var(--emas);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--krem);
    min-width: 190px;
    border-radius: 20px;
    border: 2px solid var(--emas);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 20001;
    overflow: hidden;
    top: 65px;
    left: 20px;
}

.dropdown-content.show { display: block; }

.dropdown-content a {
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tinta);
    font-family: 'Montserrat', sans-serif;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.9rem;
}

/* ============================================================
   3. KARTU HADITS (KOMPONEN UTAMA)
   ============================================================ */
.hadith-card {
    background: var(--krem);
    margin: 15px auto;
    width: 92%;
    max-width: 750px;
    padding: 30px;
    border-radius: 12px;
    border-left: 10px solid var(--marun);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.hadith-no {
    color: var(--emas); 
    font-weight: 800; 
    font-size: 0.8rem; 
    margin-bottom: 10px;
    text-transform: uppercase;
}

.hadith-arabic {
    font-family: 'Amiri', serif; 
    font-size: 1.4rem; 
    text-align: right;
    line-height: 1.8; 
    color: #000; 
    direction: rtl; 
    margin-bottom: 20px;
    display: block;
}

.hadith-narator {
    display: block;
    color: var(--emas);
    font-family: 'Lora', serif;
}

.hadith-id-isi {
    display: block;
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: left;
    color: var(--tinta);
    /* SESUAI PERMINTAAN: TEBAL DAN MIRING */
    font-weight: bold;
    font-style: italic;
}

/* ============================================================
   4. KATA PENGANTAR & PENUTUP
   ============================================================ */
.preface-section {
    margin: 25px 15px; 
    padding: 30px; 
    background: #fff; 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    color: #333; 
    line-height: 1.6;
}

.preface-section.golden-border {
    border: 3px solid var(--emas) !important;
    background-color: var(--krem);
}

.preface-header { text-align: center; margin-bottom: 30px; }
.preface-header h3 { font-family: 'Amiri', serif; font-size: 1.8em; color: #8b4513; margin: 0; }
.divider { width: 50px; height: 2px; background: #8b4513; margin: 10px auto; }

.preface-signature { text-align: right; margin-top: 30px; }
.preface-signature img { width: 120px; height: auto; }

/* ============================================================
   5. HOME SCREEN
   ============================================================ */
.section-title {
    color: var(--marun);
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    text-align: center;
}

.home-cards {
    display: flex;
    gap: 10px;
    margin: 25px 0;
}

.home-card {
    flex: 1;
    background: #fdfaf0;
    padding: 15px;
    border-left: 5px solid var(--emas);
    border-radius: 8px;
    font-size: 0.85rem;
}

.start-btn {
    background: var(--marun);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
}

/* ============================================================
   6. FLOATING NAV & SEARCH
   ============================================================ */
#floating-nav {
    position: fixed;
    bottom: 15px;
    width: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 20000;
}

.side-btn {
    background-color: var(--marun) !important;
    color: var(--kertas) !important;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--emas);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-glass-box {
    background: #fff;
    border: 2.5px solid var(--emas);
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    width: 230px;
    height: 52px;
}

#jumpInput {
    border: none;
    outline: none;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: var(--marun);
    background: transparent;
}

.execute-btn {
    background-color: var(--marun) !important;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   7. SETTINGS DROPUPS
   ============================================================ */
.dropup { position: relative; display: inline-block; }

.dropup-content {
    display: none;
    position: absolute;
    bottom: 65px;
    left: 0;
    background-color: var(--krem);
    min-width: 200px;
    box-shadow: 0px -8px 16px 0px rgba(0,0,0,0.2);
    z-index: 21000;
    border: 2px solid var(--marun);
    border-radius: 12px;
    overflow: hidden;
}

.dropup-content.show { display: block !important; }

.dropup-content a {
    color: var(--tinta);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    border-bottom: 1px solid rgba(128,0,0,0.05);
}

.dropup-content a:hover {
    background-color: var(--marun);
    color: white;
}

/* ============================================================
   8. UTILITIES & DARK MODE
   ============================================================ */
.overlay { 
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 30000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-spinner { 
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid var(--emas);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.dark-mode {
    --kertas: #1a1a1a;
    --krem: #2d2d2d;
    --tinta: #f2e8cf;
}

.dark-mode .hadith-card {
    background-color: #2d2d2d !important;
    border-left-color: var(--emas) !important;
}

.dark-mode .hadith-arabic { color: #ffffff !important; }

.ornament { text-align: center; color: var(--emas); font-size: 1.5rem; margin: 15px 0; }
.text-center { text-align: center; }
.italic { font-style: italic; }
.quote { 
    font-style: italic; 
    color: #8b4513; 
    border-left: 4px solid var(--emas); 
    padding-left: 15px; 
    margin: 20px 0; 
}
