/* Surah Page Styles */

/* Floating Decorations */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-star,
.floating-lantern {
    position: absolute;
    font-size: 2rem;
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Surah Hero */
.surah-hero {
    background: linear-gradient(135deg, var(--cobalt-deep) 0%, var(--teal-500) 50%, var(--emerald-500) 100%);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.surah-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--girih);
    background-size: 80px 80px;
    opacity: 0.16;
    -webkit-mask-image: radial-gradient(ellipse 75% 80% at 50% 50%, #000 30%, transparent 75%);
            mask-image: radial-gradient(ellipse 75% 80% at 50% 50%, #000 30%, transparent 75%);
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.surah-hero-content {
    position: relative;
    z-index: 1;
}

.surah-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.surah-hero h1 {
    font-family: 'Baloo 2', cursive;
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.surah-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Amiri', serif;
    margin-bottom: 1.5rem;
}

.surah-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.info-badge {
    /* A light pill over the teal hero left white 15px text at 3.59:1, under the
       4.5:1 AA needs for normal-size text. Darkening the pill instead of
       lightening it keeps the glass feel and clears the bar. */
    background: rgba(0, 0, 0, 0.34);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

/* Main Content */
.surah-main {
    background: linear-gradient(135deg, var(--parchment) 0%, var(--cobalt-wash) 100%);
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

.surah-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--emerald-500);
    margin: 3rem 0 2rem;
}

/* Intro Section */
.intro-section {
    margin-bottom: 3rem;
}

.intro-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--emerald-500);
}

.intro-card.highlight {
    border-left-color: var(--gold);
    background: linear-gradient(135deg, var(--amber-50) 0%, var(--gold-wash) 100%);
}

.intro-card h2 {
    color: var(--emerald-500);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.intro-card.highlight h2 {
    color: var(--amber-600);
}

.intro-card p {
    color: var(--slate-700);
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.intro-card ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.intro-card li {
    padding: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--slate-700);
}

/* Story Cards */
.story-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.story-card.special {
    background: linear-gradient(135deg, var(--cobalt-wash) 0%, var(--cobalt-pale) 100%);
    border: 3px solid var(--cobalt-mid);
}

.story-card.special h2 {
    color: var(--cobalt);
}

.story-card.healing {
    background: linear-gradient(135deg, var(--parchment-deep) 0%, var(--slate-200) 100%);
    border: 3px solid var(--emerald-500);
}

.story-card.healing h2 {
    color: var(--turquoise-deep);
}

.story-card h2 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.story-card p {
    color: var(--slate-700);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.lights-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.light-badge {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(192, 138, 46, 0.3);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 5px 15px rgba(192, 138, 46, 0.3); }
    50% { box-shadow: 0 5px 25px rgba(192, 138, 46, 0.6); }
}

/* Bismillah Section */
.bismillah-section {
    margin: 3rem 0;
}

.bismillah-card {
    position: relative;
    background: var(--ink);
    padding: 2.75rem 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--gold);
}

.bismillah-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--girih);
    background-size: 80px 80px;
    opacity: 0.12;
    pointer-events: none;
}

.bismillah-card > * { position: relative; z-index: 1; }

.arabic-large {
    font-family: 'Amiri', serif;
    font-size: clamp(1.9rem, 4.4vw, 2.8rem);
    color: var(--gold-light);
    margin-bottom: 1rem;
    direction: rtl;
    line-height: 2;
}

.transliteration {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.translation {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Verses Section */
.verses-section {
    margin: 3rem 0;
}

/* An illuminated text panel.
   The Arabic leads, a gold rosette marks the ayah, and a hairline
   rule separates revelation from commentary - the way a mushaf
   separates the text block from the margin. */
.verses-section { counter-reset: ayah; }

.verse-card {
    position: relative;
    counter-increment: ayah;
    background: var(--card);
    padding: 1.5rem 2rem 1.6rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: block;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.verse-card:hover {
    border-color: var(--rule-strong);
    box-shadow: var(--shadow-md);
}

/* The ayah rosette: a gold roundel carrying the verse number,
   set at the start of the line as a marginal ornament. */
.verse-number {
    background: var(--parchment);
    color: var(--gold-text);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--rule-strong);
    box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    margin: 0 0 0.35rem auto;  /* sits to the right, where RTL begins */
}

.verse-content { flex: 1; }

/* Scripture: the largest, calmest thing on the page. */
.verse-content .arabic {
    font-family: 'Amiri', serif;
    font-size: clamp(1.75rem, 3.6vw, 2.4rem);
    color: var(--ink);
    direction: rtl;
    text-align: right;
    margin-bottom: 1.15rem;
    padding-bottom: 1.15rem;
    line-height: 1.95;
    border-bottom: 1px solid var(--rule);
}

/* Commentary: quieter, and clearly a different register. */
.verse-content .transliteration {
    color: var(--slate-500);
    font-size: 0.95rem;
    font-style: italic;
    letter-spacing: 0.01em;
    margin-bottom: 0.45rem;
}

.verse-content .translation {
    color: var(--ink);
    font-family: 'Baloo 2', cursive;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.55;
    margin-bottom: 1.1rem;
}

.verse-explanation {
    background: var(--parchment);
    border: 1px solid var(--rule);
    padding: 1rem 1.1rem;
    border-radius: 12px;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.explanation-icon {
    font-size: 1.25rem;
    line-height: 1.5;
}

.verse-explanation p {
    color: var(--slate-700);
    margin: 0;
    line-height: 1.65;
    font-size: 0.97rem;
}

/* Ameen Card */
.ameen-card {
    background: linear-gradient(135deg, var(--gold-wash) 0%, var(--gold-pale) 100%);
    padding: 2.5rem;
    border-radius: 25px;
    text-align: center;
    margin: 2rem 0;
    border: 3px solid var(--gold);
}

.ameen-text {
    font-family: 'Amiri', serif;
    font-size: 4rem;
    color: var(--gold-ink);
    margin-bottom: 0.5rem;
}

.ameen-transliteration {
    font-size: 2rem;
    color: var(--amber-600);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ameen-meaning {
    color: var(--gold-ink-strong);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ameen-note {
    color: var(--gold-ink);
    font-size: 1rem;
}

/* Full Surah Section */
.full-surah-section {
    margin: 3rem 0;
}

.full-surah-card {
    background: var(--ink);
    padding: 3.25rem 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--gold), inset 0 0 0 1px rgba(192,138,46,0.35);
}

/* Girih watermark, held well back so the script stays first */
.full-surah-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--girih);
    background-size: 80px 80px;
    opacity: 0.14;
    pointer-events: none;
}

/* The gold frame rule, inset from the edge like a manuscript border */
.full-surah-card::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(192, 138, 46, 0.45);
    border-radius: 12px;
    pointer-events: none;
}

.arabic-full {
    position: relative;
    z-index: 1;
    font-family: 'Amiri', serif;
    font-size: clamp(1.6rem, 3.4vw, 2.15rem);
    color: var(--gold-light);
    line-height: 2.6;
    direction: rtl;
}

/* Video Section */
.video-section {
    margin: 3rem 0;
}

.video-intro {
    text-align: center;
    color: var(--slate-500);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.video-container {
    background: linear-gradient(135deg, var(--cobalt-deep) 0%, var(--teal-500) 100%);
    padding: 1.5rem;
    border-radius: 20px;
}

.video-frame {
    border-radius: 15px;
    overflow: hidden;
}

.video-frame iframe {
    border-radius: 15px;
    display: block;
}

/* Reply Section */
.reply-section {
    margin: 3rem 0;
}

.reply-card {
    background: linear-gradient(135deg, var(--amber-50) 0%, var(--gold-pale) 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 3px solid var(--gold);
    text-align: center;
}

.reply-card p {
    color: var(--gold-ink);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.reply-card .hadith {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    font-style: italic;
    margin-top: 1rem;
}

/* Fun Facts Section */
.fun-facts-section {
    margin: 3rem 0;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.fact-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(26, 143, 128, 0.2);
}

.fact-number {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fact-card p {
    color: var(--slate-700);
    margin: 0;
    line-height: 1.5;
}

/* Quiz Section */
.quiz-section {
    margin: 3rem 0;
    background: white;
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.quiz-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.quiz-intro h2 {
    color: var(--emerald-500);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quiz-intro p {
    color: var(--slate-500);
}

.quiz-card {
    background: var(--parchment);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.quiz-card.hidden {
    display: none;
}

.question-number {
    background: linear-gradient(135deg, var(--emerald-500) 0%, var(--teal-500) 100%);
    color: white;
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quiz-question {
    color: var(--slate-800);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quiz-option {
    background: white;
    color: var(--slate-700);
    padding: 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background: var(--emerald-500);
    color: white;
    border-color: var(--emerald-500);
}

.quiz-option.correct {
    background: var(--emerald-500);
    color: white;
    border-color: var(--emerald-500);
}

.quiz-option.incorrect {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.quiz-feedback {
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
}

.quiz-results {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--gold-wash) 0%, var(--gold-pale) 100%);
    border-radius: 20px;
}

.quiz-results.hidden {
    display: none;
}

.results-icon {
    font-size: 4rem;
}

.results-content h2 {
    color: var(--gold-ink);
    margin: 1rem 0;
}

.results-score {
    color: var(--gold-ink-strong);
    font-size: 1.2rem;
}

.results-message {
    color: var(--gold-ink);
    margin-top: 0.5rem;
}

/* Tips Section */
.tips-section {
    margin: 3rem 0;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(26, 143, 128, 0.2);
}

.tip-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tip-card h3 {
    color: var(--emerald-500);
    margin-bottom: 0.5rem;
}

.tip-card p {
    color: var(--slate-500);
    font-size: 0.95rem;
}

/* Credit Section */
.credit-section {
    margin: 2rem 0;
}

.credit-card {
    background: var(--parchment-warm);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
}

.credit-card p {
    color: var(--slate-500);
    margin: 0;
}

/* Navigation */
.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--slate-200);
}

.nav-btn {
    background: linear-gradient(135deg, var(--emerald-500) 0%, var(--teal-500) 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(26, 143, 128, 0.3);
}

.nav-btn.next {
    background: linear-gradient(135deg, var(--gold) 0%, var(--amber-600) 100%);
}

/* Footer Dua */
.footer-dua {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.footer-dua p {
    color: var(--gold-pale);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .surah-hero h1 {
        font-size: 2.5rem;
    }

    .arabic-large {
        font-size: 2rem;
    }

    .verse-card {
        flex-direction: column;
        text-align: center;
    }

    .verse-number {
        margin: 0 auto;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .page-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-btn {
        text-align: center;
    }

    .info-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}


/* `.hadith` styles a quoted saying. These modifiers record what the quote
   actually is, so the markup does not imply a hadith where there is none:
   `.quran-quote` is a verse of the Quran, `.scholar-quote` is an athar - a
   saying of a scholar, not of the Prophet ﷺ. */
.hadith.quran-quote,
.hadith.scholar-quote {
    /* inherits .hadith presentation; the class is a semantic label */
}


/* ============================================
   Training wheels: Read -> Practice -> Recite
   A child who always sees the transliteration reads the transliteration.
   Each stage removes one prop, so the Arabic is the last thing standing.
   ============================================ */

.stage-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    background: var(--gold-wash);
    border: 1px solid var(--rule);
    border-radius: var(--radius-full);
}

.stage-label {
    font-weight: 700;
    color: var(--gold-ink);
    font-size: 0.95rem;
}

.stage-buttons {
    display: flex;
    gap: 0.35rem;
    background: var(--card);
    padding: 0.3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--rule);
}

.stage-btn {
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--slate-700);
    padding: 0.5rem 1.15rem;
    min-height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.stage-btn:hover {
    color: var(--turquoise-deep);
}

.stage-btn[aria-pressed="true"] {
    background: var(--turquoise);
    color: #fff;
}

.stage-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Practice: the transliteration crutch comes away. */
.verses-section[data-stage="practice"] .transliteration,
.verses-section[data-stage="recite"] .transliteration {
    display: none;
}

/* Recite: only the Arabic is left, with the meaning one tap away. */
.verses-section[data-stage="recite"] .translation,
.verses-section[data-stage="recite"] .verse-explanation {
    display: none;
}

.verse-reveal {
    display: none;
    margin-top: 0.75rem;
    border: 1px dashed var(--rule-strong);
    background: none;
    color: var(--gold-ink);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1.1rem;
    min-height: 44px;
    border-radius: var(--radius-full);
    cursor: pointer;
}

.verses-section[data-stage="recite"] .verse-reveal {
    display: inline-block;
}

.verse-card.revealed .translation {
    display: block !important;
}

.verse-card.revealed .verse-reveal {
    display: none;
}

.verse-reveal:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .stage-picker {
        border-radius: var(--radius-lg);
    }
    .stage-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }
}


/* ============================================
   A card written to the parent, not the child: one question to ask at the
   pause, and one line to close the night with.
   ============================================ */
.parent-note {
    margin: 3rem 0 2rem;
    padding: 1.5rem 1.75rem;
    background: var(--cobalt-wash);
    border: 1px solid var(--cobalt-pale);
    border-left: 5px solid var(--cobalt);
    border-radius: var(--radius-lg);
}

html[lang="ar"] .parent-note {
    border-left: none;
    border-right: 5px solid var(--cobalt);
    text-align: right;
}

.parent-note h2 {
    font-family: 'Baloo 2', cursive;
    font-size: 1.15rem;
    color: var(--cobalt-deep);
    margin: 0 0 0.75rem;
}

.parent-note p {
    margin: 0 0 0.5rem;
    color: var(--slate-700);
    line-height: 1.7;
}

.parent-note strong {
    color: var(--cobalt-deep);
}


/* ============================================
   Per-verse listen controls
   ============================================ */

.verse-listen {
    display: inline-block;
    margin-top: 0.85rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--turquoise-deep);
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius-full);
    padding: 0.45rem 1.1rem;
    min-height: 44px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.verse-listen:hover {
    background: var(--gold-wash);
    color: var(--gold-ink);
}

.verse-listen[aria-pressed="true"] {
    background: var(--turquoise);
    border-color: var(--turquoise-deep);
    color: #fff;
}

.verse-listen:focus-visible,
.surah-listen-all:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.surah-listen-all {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background: var(--turquoise);
    border: 1px solid var(--turquoise-deep);
    border-radius: var(--radius-full);
    padding: 0.5rem 1.2rem;
    min-height: 44px;
    cursor: pointer;
}

.surah-listen-all[aria-pressed="true"] {
    background: var(--gold);
    border-color: var(--gold-light);
    color: var(--ink);
}
