/* ==========================================================================
   PREMIUM MUSHAF STYLESHEET
   ========================================================================== */

:root {
    /* Light Theme (Paper feel) */
    --bg-color: #fcf9f2; /* Warm paper color */
    --text-primary: #2d2d2d;
    --text-arabic: #1a1a1a;
    --accent-color: #8b6d43; /* Classic gold/brown */
    --border-color: #e0d5c1;
    --surah-header-bg: #f4ecdf;
    
    --font-arabic: 'KFGQPC Uthmanic Script HAFS', 'Amiri', serif;
    --font-ui: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg-color: #1a1b1e;
    --text-primary: #e4e5e8;
    --text-arabic: #ffffff;
    --accent-color: #d4af37; /* Bright gold */
    --border-color: #3f4044;
    --surah-header-bg: #2c2d30;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: inherit;
}
.brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
}
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
}

/* Page Container (The Book) */
.mushaf-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
}
[data-theme="dark"] .mushaf-container {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Surah Header Banner */
.surah-header {
    background: var(--surah-header-bg);
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 1rem;
    margin: 2rem 0;
    border-radius: 4px;
    position: relative;
}
.surah-name-ar {
    font-family: var(--font-arabic);
    font-size: 2rem;
    color: var(--accent-color);
}
.bismillah {
    font-family: var(--font-arabic);
    font-size: 1.8rem;
    text-align: center;
    margin: 1rem 0 2rem 0;
    color: var(--text-arabic);
}

/* Arabic Text Flow */
.arabic-text-container {
    direction: rtl;
    text-align: justify;
    text-justify: inter-word;
    line-height: 2.5;
    font-family: var(--font-arabic);
    font-size: 2.2rem;
    color: var(--text-arabic);
    padding: 0 1rem;
}
.ayah {
    display: inline;
}
.ayah-end {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%238b6d43" stroke-width="4"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    font-size: 1rem;
    color: var(--accent-color);
    margin: 0 8px;
    position: relative;
    top: -5px;
}
[data-theme="dark"] .ayah-end {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23d4af37" stroke-width="4"/></svg>');
}

/* Translations Area */
.translations-wrapper {
    margin-top: 3rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 2rem;
    direction: ltr;
    text-align: left;
}
.ayah-translation {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}
[data-theme="dark"] .ayah-translation {
    background: rgba(255,255,255,0.02);
}
.ayah-translation .ref {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Loader */
.loader {
    text-align: center;
    padding: 2rem;
    color: var(--accent-color);
    display: none;
}

/* Navigation Buttons */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}
.nav-btn {
    padding: 0.8rem 1.5rem;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: opacity 0.2s;
}
.nav-btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   TAJWEED COLORS
   These only apply when 'Tajweed Mode' is toggled on
   ========================================================================== */
.tajweed-mode tajweed { font-family: inherit; }
.tajweed-mode tajweed.ham_wasl { color: #AAAAAA; } /* Silent/Grey */
.tajweed-mode tajweed.laam_shamsiyah { color: #AAAAAA; } /* Silent/Grey */
.tajweed-mode tajweed.slnt { color: #AAAAAA; } /* Silent/Grey */
.tajweed-mode tajweed.madda_normal { color: #537DEF; } /* Blue */
.tajweed-mode tajweed.madda_permissible { color: #4050FF; } /* Light Blue */
.tajweed-mode tajweed.madda_necessary { color: #000080; } /* Dark Blue */
.tajweed-mode tajweed.madda_obligatory { color: #2144C1; } /* Blue */
.tajweed-mode tajweed.qalaqah { color: #DD0008; } /* Red */
.tajweed-mode tajweed.ghunnah { color: #FF7E1E; } /* Orange */
.tajweed-mode tajweed.ikhafa { color: #9400A8; } /* Purple */
.tajweed-mode tajweed.idgham_wo_ghunnah { color: #AAAAAA; } /* Grey */
.tajweed-mode tajweed.idgham_ghunnah { color: #169200; } /* Green */
.tajweed-mode tajweed.iqlab { color: #26BFFD; } /* Light Blue */

/* End markers spacing */
span.end { margin: 0 5px; color: var(--accent-color); font-size: 1.5rem; }
