/* =====================================
   GLOBAL
===================================== */

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f6f2;
    color: #333;

    display: flex;
    justify-content: center;
}

/* =====================================
   MAIN CONTAINER
===================================== */

.container {
    max-width: 750px;
    width: 100%;
    padding: 20px;
    text-align: center;
}

/* =====================================
   HEADER
===================================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 16px;
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #e6e6e6;
}
/* top row */
.site-title a {
    text-decoration: none;
    color: inherit;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.site-title {
    font-size: 22px;
    font-weight: 600;
}

.meta-info {
    text-align: right;
    font-size: 14px;
    line-height: 1.4;
}

/* =====================================
   NAVIGATION
===================================== */

/* navigation row */

.nav-bar {
    display: flex;
    justify-content: center;
}

.nav-selectors {
    display: flex;
    width: 100%;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.nav-selectors > div {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 150px;
}

.nav-selectors label {
    font-size: 13px;
    color: #666;
}

.nav-selectors select {
    min-width: 160px;
}

/* =====================================
   FORM INPUTS
===================================== */

select,
input {
    padding: 8px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* =====================================
   QURAN VERSE DISPLAY
===================================== */

.verse {
    font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
    font-size: 42px;
    line-height: 2.1;
    direction: rtl;
    text-align: center;

    padding: 28px 30px;

    background: #ffffff;

    border-radius: 16px;

    /* mushaf style frame */

    border: 1px solid #d8d2c3;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 12px 30px rgba(0, 0, 0, 0.08);

    margin: 18px 0;

    position: relative;
}

.verse::before {
    content: "";

    position: absolute;

    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;

    border: 1px solid #e8e2d5;

    border-radius: 12px;

    pointer-events: none;
}

background: linear-gradient(to bottom, #ffffff, #fbfaf6);

/* =====================================
   TOOLBAR (EMOJI CONTROLS)
===================================== */

.toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
}

.toolbar button {
    font-size: 26px;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;

    padding: 10px 12px;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

    transition: all 0.15s ease;
}

.toolbar button:hover {
    background: #f1f1f1;
    transform: translateY(-1px);
}

/* =====================================
   BUTTONS (GENERAL UI)
===================================== */

button {
    padding: 12px 16px;
    font-size: 15px;
    border: none;
    border-radius: 8px;

    background: #2c5e4a;
    color: #ffffff;

    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover {
    background: #1e4033;
}

/* =====================================
   PANELS / SECTIONS
===================================== */

.section {
    background: #ffffff;
    padding: 15px;

    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

    margin-bottom: 20px;
}

/* =====================================
   TABS
===================================== */

.tabs {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tabButton {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

    border: none;
    border-radius: 10px;

    background: #444;
    color: #fff;

    cursor: pointer;

    transition: all 0.15s ease;
}

.tabButton:hover {
    background: #333;
}

.tabButton.active {
    background: #2c5e4a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tabPanel {
    display: none;
    margin-top: 15px;
}

.tabPanel.active {
    display: block;
}

/* =====================================
   LOOP CONTROLS
===================================== */

.loopbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.loopbar input {
    width: 50px;
    text-align: center;
}

/* =====================================
   TAJWEED COLORS
===================================== */

.tj-ghunnah {
    color: #b00020;
    font-weight: 700;
}

.tj-qalqalah {
    color: #1565c0;
    font-weight: 700;
}

.tj-madd {
    color: #2e7d32;
    font-weight: 700;
}

/* =====================================
   MOBILE
===================================== */

.meta-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
}

.verse-area {
    margin-top: 10px;
    touch-action: manipulation;
    position: relative;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.footer-note {
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

#madinahStart,
#madinahEnd {
    width: 60px;
    text-align: center;
}

.madinah-description {
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: #555;
    text-align: center;
}

.madinah-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#madinahTab button {
    font-size: 26px;
    color: #333;

    line-height: 1;

    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;

    width: 50px;
    height: 50px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

    transition: all 0.15s ease;
}

.madinah-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.page-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#pageNumber {
    width: 70px;
    text-align: center;
}

#pageTab button {
    font-size: 26px;
    color: #333;

    line-height: 1;

    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;

    width: 50px;
    height: 50px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

    transition: all 0.15s ease;
}

/* =====================================
   MOBILE NAV SELECTORS
===================================== */

/* =====================================
   FLOATING DRAWER ICON
===================================== */

.nav-wrapper {
    position: relative;
}

.drawer-toggle {
    position: absolute;
    right: 10px;
    top: 10px;

    width: 36px;
    height: 36px;

    font-size: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #2c5e4a;
    color: white;

    border-radius: 8px;
    border: none;

    cursor: pointer;
}

/* =====================================
   BOTTOM DRAWER
===================================== */

.bottom-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -80vh;
    background: white;

    border-top-left-radius: 14px;
    border-top-right-radius: 14px;

    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35), 0 -2px 8px rgba(0, 0, 0, 0.2);

    transition: bottom 0.45s cubic-bezier(0.25, 1.25, 0.5, 1);
    border-top: 1px solid #e5e5e5;

    z-index: 999;
}

.bottom-drawer::before {
    content: "";

    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;

    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0)
    );
}

.bottom-drawer.open {
    bottom: 90px;
}

.drawer-content {
    padding: 20px;
    max-height: 60vh;
    overflow: auto;
}

@media (max-width: 600px) {
    .nav-selectors {
        display: flex;
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    /* remove vertical stacking */
    .nav-selectors > div {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: auto;
    }

    .nav-bar {
        display: flex;
        justify-content: flex-start;
        padding-right: 40px; /* room for hamburger */
    }

    /* shrink labels slightly */
    .nav-selectors label {
        font-size: 12px;
        margin: 0;
    }

    /* shrink dropdown width */
    .nav-selectors select {
        width: 90px;
        padding: 4px 6px;
        font-size: 12px;
    }

    #ayahSelect {
        width: 7ch;
        min-width: 7ch;
    }

    #surahSelect {
        width: 20ch;
        min-width: 0;
    }

    #madinahStart,
    #madinahEnd {
        width: 55px;
        min-width: 0;
        padding: 4px;
        box-sizing: border-box;
    }

    .madinah-range {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    /* smaller inputs */
    #madinahStart,
    #madinahEnd {
        width: 42px;
        min-width: 0;
        padding: 2px;
        font-size: 12px;
        text-align: center;
    }

    /* shrink buttons for phone */
    .madinah-range button {
        font-size: 12px;
        padding: 3px 6px;
        min-width: auto;
    }

    /* hide description on phone to save space */
    .madinah-description {
        display: none;
    }

    .madinah-range label {
        font-size: 11px;
    }
}

/* =====================================
BOTTOM SHEET IMPROVEMENTS
===================================== */

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0, 0, 0, 0.35);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.25s ease;

    z-index: 998;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* drawer animation improvement */

.bottom-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;

    background: white;

    border-top-left-radius: 16px;
    border-top-right-radius: 16px;

    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);

    transition: bottom 0.45s cubic-bezier(0.25, 1.25, 0.5, 1);

    z-index: 999;
}

/* grab handle */

.drawer-handle {
    width: 42px;
    height: 5px;

    background: #ccc;

    border-radius: 5px;

    margin: 10px auto 5px auto;
}

/* smoother drawer */

.bottom-drawer.open {
    bottom: 0;
}

body.drawer-open .container > *:not(.bottom-drawer) {
    opacity: 0.9;
    transition: opacity 0.25s ease;
}

/* =====================================
WORD REVEAL ANIMATION
===================================== */

.reveal-word {
    opacity: 0;
    display: inline-block;
    animation: wordFade 0.35s ease forwards;
}

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

.verse.reveal-active {
    word-spacing: 6px;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.bookmark-item span:hover {
    color: #2c7be5;
}

.bookmark-card {
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.bookmark-ref {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.bookmark-text {
    font-family: "Amiri", serif;
    font-size: 26px;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

.bookmark-delete {
    position: absolute;
    top: 8px;
    left: 10px;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
}

.bookmark-delete:hover {
    color: #c62828;
}

#bookmarkList {
    max-height: 55vh;
    overflow-y: auto;
    padding: 6px;
}

#bookmarkBtn {
    font-size: 22px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.15s ease;
}

#bookmarkBtn:hover {
    transform: scale(1.15);
}

.bookmark-floating {
    position: absolute;
    top: 10px;
    right: 10px;

    z-index: 20; /* ADD THIS */

    font-size: 22px;
    border: none;
    background: white;

    border-radius: 50%;
    width: 36px;
    height: 36px;

    cursor: pointer;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform 0.15s ease;
}

.bookmark-floating:hover {
    transform: scale(1.1);
}

@keyframes bookmarkPulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.45);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.bookmark-pulse {
    animation: bookmarkPulse 0.45s ease;
}

#bookmarkBtn[style*="f4b400"] {
    box-shadow: 0 0 10px rgba(244, 180, 0, 0.5);
}

.tab-description {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-top: 10px;
}

.bookmark-surah {
    margin-bottom: 18px;
}

.bookmark-surah-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    color: #444;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.bookmark-surah-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #333;
}

/* rotate colors */
.bookmark-surah:nth-child(4n + 1) .bookmark-surah-title {
    background: #e8f4ff;
}

.bookmark-surah:nth-child(4n + 2) .bookmark-surah-title {
    background: #eaf7ea;
}

.bookmark-surah:nth-child(4n + 3) .bookmark-surah-title {
    background: #fff4e5;
}

.bookmark-surah:nth-child(4n + 4) .bookmark-surah-title {
    background: #f3eaff;
}

.bookmark-card {
    border-bottom: 1px solid #eee;
    padding: 6px 0;
}

.bookmark-surah-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bookmark-arrow {
    font-size: 12px;
    color: #666;
}

.bookmark-group {
    margin-top: 6px;
}

.bookmark-surah-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
}

.bookmark-surah-title:hover {
    background: #f2f2f2;
}

.info-grid{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
gap:12px;
margin-top:10px;
}

.info-card{
display:block;
padding:14px;
background:#f7f7f7;
border-radius:10px;
text-decoration:none;
color:#333;
border:1px solid #e5e5e5;
transition:.2s;
}

.info-card:hover{
background:#eef6ff;
border-color:#c9defc;
}

.info-title{
font-weight:600;
margin-bottom:4px;
}

.info-desc{
font-size:13px;
color:#666;
}

#speedSelect {
    font-size: 16px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e3e3e3;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
