/* adabiyah.my.id
/* alwiefuad@live.com
/* --- 1. VARIABEL & DASAR --- */
:root {
    --primary-bg: #f9f9f9;
    --card-bg: #ffffff;
    --text-main: #222;
    --accent: #2196f3;
}

body.dark {
    --primary-bg: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ddd;
    --accent: #00ff88;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--primary-bg);
    margin: 0; 
    padding: 0; /* Ubah ke 0 agar kontainer bisa maksimal ke pinggir di HP */
    color: var(--text-main);
    transition: all 0.3s ease;
    text-align: center;
    /* KUNCI: Mencegah font menyusut otomatis di mobile */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.quran-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px; /* Padding dipindah ke sini agar lebih aman */
}

/* --- 2. TATA LETAK HEADER & CARD --- */
.header-section {
    padding: 20px 0;
    margin-bottom: 20px;
}

.controls-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

body.dark .controls-card {
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* --- 3. INPUT & DROPDOWN --- */
select, input {
    font-size: 1rem;
    padding: 12px;
    margin: 10px 0;
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    border: 2px solid #eee !important;
    background: var(--card-bg);
    color: var(--text-main);
    transition: border-color 0.3s ease;
}

select:focus, input:focus {
    border-color: var(--accent) !important;
    outline: none;
}

/* --- 4. TEKS ARAB & AYAT (ANTI-NYUSUT) --- */
.arabic-text {
    /* Menggunakan font-size yang besar untuk mobile secara default */
    font-size: 34px !important; 
    line-height: 2.2 !important; 
    font-family: 'MeQuran', 'Amiri Quran', serif;
    direction: rtl;
    text-align: right;
    padding: 15px 5px;
    word-wrap: break-word;
    display: block;
}

/* Ukuran untuk Desktop/Layar Lebar */
@media (min-width: 768px) {
    .arabic-text {
        font-size: 48px !important;
    }
}

/* Mencegah tajweed merusak baris */
.arabic-text tajweed, .arabic-text span {
    font-size: 1em !important;
    font-family: inherit !important;
    display: inline !important;
    line-height: inherit !important;
}

/* --- 5. SISTEM TAJWID & TOOLTIP --- */
.ghn { color: #FF7E1E !important; font-weight: bold; } 
.qlq { color: #DD0008 !important; font-weight: bold; } 
.idgh_ghn, .idghm_shfw, .idgh_w_ghn { color: #169200 !important; } 
.iqlb { color: #26BFFD !important; } 
.ikhf, .ikhf_shfw { color: #9400A8 !important; } 
.slnt, .ham_wasl, .idgh_mus { color: #AAAAAA !important; } 

.madda_necessary, .madda_obligatory, .madda_pbligatory, .madda_permissible, .madda_normal { 
    color: #4050FF !important; 
}

/* Interaksi Tajwid (Klik/Sentuh di HP) */
tajweed:active, tajweed:hover {
    background-color: rgba(33, 150, 243, 0.15);
    border-radius: 4px;
    cursor: help;
}

/* --- 5. SISTEM TAJWID (DENGAN TOOLTIP FIX) --- */
.arabic-text tajweed {
    position: relative; /* WAJIB: Agar tooltip tahu harus muncul di mana */
    display: inline;    /* UBAH KE INLINE: Agar huruf Arab tetap tersambung */
    cursor: help;
}

/* Warna Tajwid */
.ghn { color: #FF7E1E !important; font-weight: bold; }
.qlq { color: #DD0008 !important; font-weight: bold; }
.idgh_ghn, .idghm_shfw, .idgh_w_ghn { color: #169200 !important; }
.iqlb { color: #26BFFD !important; }
.ikhf, .ikhf_shfw { color: #9400A8 !important; }
.slnt, .ham_wasl, .idgh_mus { color: #AAAAAA !important; }
.madda_necessary, .madda_obligatory, .madda_pbligatory, .madda_permissible, .madda_normal {  
    color: #4050FF !important;  
}

/* Tooltip: Muncul saat Hover (Desktop) atau Hold (Mobile) */
tajweed[data-description]:hover::after {
    content: attr(data-description);
    position: absolute;
    bottom: 130%; /* Muncul tepat di atas huruf */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    z-index: 9999; /* Pastikan tidak tertutup elemen lain */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    pointer-events: none; /* Agar tooltip tidak mengganggu klik */
}

/* Panah kecil di bawah tooltip */
tajweed[data-description]:hover::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    z-index: 9999;
}


body.dark .arabic-text span, body.dark tajweed {
    filter: brightness(1.4) saturate(1.3);
}

/* --- 6. TOMBOL & AYAH CARD --- */
.ayah {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: right;
    border-left: 5px solid transparent;
}

.highlight-ayah {
    background-color: rgba(33, 150, 243, 0.15) !important;
    border-left: 5px solid var(--accent) !important;
}

button {
    margin: 5px;
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.audio-btn { background: #28a745; color: white; }
.bookmark-btn { background: #007bff; color: white; }

.toggle-dark-btn { 
    position: sticky;
    top: 15px;
    float: left;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.footer-copy {
    margin-top: 40px;
    padding-bottom: 20px;
    font-size: 12px;
    color: #888;
}
.reading-now {
    background-color: rgba(33, 150, 243, 0.1) !important;
    border-right: 5px solid #2196F3 !important;
    transition: all 0.3s ease;
    transform: scale(1.01);
}

.controls-container {
    padding: 15px;
    background: var(--primary-bg);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid rgba(0,0,0,0.1);
}