/* ================= QURAN PAGE STYLING ================= */

/* General Layout */
main {
    text-align: center;
    padding: 40px 20px;
    margin: 0 auto;
    margin-top: 150px; /* Reduced margin for better spacing */
}

/* Page Title */
.page-title {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 40px;
}




/* Extra Spacing */
.extra-space {
    height: 100px;
}

/* ================= SURAH NAVIGATION BUTTONS ================= */

.quran-nav {
    text-align: center;
    margin: 30px 0;
}

.quran-btn {
    display: inline-block;
    margin: 10px;
    padding: 8px 15px; /* Reduced padding */
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s;
    width: 120px; /* Fixed smaller width */
}

/* Hover Effect */
.quran-btn:hover {
    background-color: var(--blue-color);
    transform: scale(1.05);
}

/* ================= COMING SOON SECTION ================= */
.coming-soon {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    background: var(--primary-color);
    padding: 15px 30px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    margin-top: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease-in-out;
}

/* Hover Effect */
.coming-soon:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--secondary-color);
    transform: scale(1.05);
}


/* ================= RESPONSIVE DESIGN ================= */

.quran-container {
    max-width: 800px;
    margin: 100px auto;
    padding: 0 20px;
    
}

.ayah-block {
    text-align: center;
    margin-bottom: 20px;
}

.arabic-text {
    font-size: 1.9rem;
    font-family: 'Quran-Hafs';
    direction: rtl;
    color: black;
    margin-bottom: 30px;
    margin-top: 35px;
    text-align: right;
    
}

.translation-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
    text-align: left;
}

.bismillah {

    font-family: "Amiri";
    font-size: 1.5rem;
}

.ayah-separator {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 20px 0;
}


.word {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 4px;
    white-space: nowrap;
}

/* Default hover if no class applied (fallback) */
.word:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

/* If audio file found */
.audio-found:hover {
    background-color: var(--blue-color);
    color: var(--primary-color);
}

/* If audio file missing */
.audio-missing:hover {
    background-color: var(--red-color); /* Bootstrap's 'danger' red (#dc3545) fits your palette */
    color: var(--primary-color);
}

.popup {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #fff;
    padding: 2em;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    right: 1em;
    top: 0.5em;
    font-size: 1.5em;
    cursor: pointer;
}

.tajweed-rule {
    margin: 8px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.color-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}


.tajweed-btn {
    background-color: var(--accent-color); /* Bootstrap blue */
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: center;
    margin-top: 30px;
}

.tajweed-btn:hover {
    background-color: #7494b5;
}


.diff-from-hafs-box { background-color: #f703f6; }
.ra-muraqqaqah-box { background-color: #44e53f; }
.lam-mulaghazhah-box { background-color: #0273fd; }
.mad-badal-box { background-color: #00ccff; }
.taqlil-word-box { background-color: red; }
.silah-meem-box { background-color: orange; }
.mad-lin-box { background-color: #9acc00; }
.idgham-box { background-color: #4a23f1; }

.tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 8px 12px; /* slightly larger */
    border-radius: 8px; /* more rounded */
    font-size: 15px; /* slightly bigger text */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: Calibri;
    user-select: none;
    direction: ltr;
}


.word:hover .tooltip {
    opacity: 1;
    visibility: visible;
    
}

/* Responsive Design for Quran Pages */
@media only screen and (max-width: 1024px) {
    .quranbg {
        width: 90%; /* Scale down for tablets */
        height: auto; /* Allow flexible height */
        padding: 15px;
    }

    .quransvg {
        width: 95%; /* Adjust SVG width */
    }
}

@media only screen and (max-width: 768px) {
    .page-title {
        font-size: 2.2rem;
        margin-bottom: 30px; /* Reduce spacing */
    }

    .quranbg {
        width: 100%; /* Full width for better adaptation */
        max-width: 95vw; /* Prevent overflow */
        height: auto; /* Adjust height dynamically */
        padding: 10px;
        border-radius: 8px;
    }

    .quransvg {
        width: 100%;
        max-height: 100%;
    }

    .page-number {
        font-size: 1.3rem;
    }

    .quran-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
        width: 110px;
    }
}

@media only screen and (max-width: 480px) {
    .quranbg {
        width: 100%;
        max-width: 90vw; /* Ensure it doesn’t exceed viewport */
        height: auto;
        padding: 8px;
        border-radius: 5px;
    }

    .quransvg {
        width: 100%;
    }

    .page-number {
        font-size: 1.1rem;
    }

    .quran-btn {
        font-size: 0.8rem;
        padding: 6px 8px;
        width: 90px;
    }

    .coming-soon {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
}

