@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&family=Amiri:wght@400;700&display=swap');

:root {
    --bg: #f0f4f8;
    --bg2: #e8eef5;
    --card: #ffffff;
    --navy: #1e3a5f;
    --navy2: #0f2d5c;
    --navy3: #163156;
    --blue: #2563eb;
    --blue2: #1d4ed8;
    --cyan: #0ea5e9;
    --cyan2: #0284c7;
    --purple: #7c3aed;
    --text: #1e293b;
    --text2: #475569;
    --text3: #94a3b8;
    --border: #dde5ef;
    --border2: #c4d0e0;
    --shadow: 0 2px 12px rgba(30, 58, 95, 0.08);
    --shadow2: 0 4px 20px rgba(30, 58, 95, 0.12);
    --gold: #c9a84c;
    --green: #059669;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 16px 80px;
}

/* ===== زر الوضع ===== */
#dark-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border2);
    background: var(--card);
    color: var(--navy);
    cursor: pointer;
    z-index: 1000;
    transition: 0.2s;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

#dark-btn:hover {
    background: var(--bg2);
    border-color: var(--blue);
}

.page {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hidden {
    display: none !important;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 36px 0 20px;
    position: relative;
}

.mic-icon {
    font-size: 52px;
    margin-bottom: 14px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.2));
}

.hero h1 {
    font-family: 'Amiri', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.hero p {
    color: var(--text2);
    font-size: 15px;
}

.hero::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    border-radius: 2px;
    margin: 14px auto 0;
}

/* ===== الكروت ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow2);
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ===== Labels & Inputs ===== */
.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 10px;
}

.len-tooltip {
    cursor: help;
    position: relative;
    color: var(--cyan);
}

.len-tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    top: 26px;
    background: var(--navy);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: pre;
    z-index: 99;
    width: 200px;
    line-height: 1.6;
}

.field-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border2);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-input option {
    background: white;
    color: var(--text);
}

.btn-random {
    padding: 11px 13px;
    background: var(--bg2);
    border: 1.5px solid var(--border2);
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.2s;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-random:hover {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

/* ===== Checkboxes ===== */
#checks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 6px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    transition: all 0.15s;
    user-select: none;
    background: var(--bg);
}

.check-item:hover {
    border-color: var(--blue);
    background: rgba(37, 99, 235, 0.05);
    color: var(--navy);
}

.check-item input {
    accent-color: var(--blue);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.check-icon {
    color: var(--blue);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.check-icon svg {
    stroke: var(--blue);
}

.btn-best {
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    border: 1.5px solid rgba(37, 99, 235, 0.3);
    padding: 7px 14px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-best:hover,
.btn-best.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

/* ===== الأزرار الرئيسية ===== */
.btn-main {
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-main:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-main:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-back-setup {
    background: var(--bg2);
    color: var(--text2);
    border: 1.5px solid var(--border2);
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-back-setup:hover {
    border-color: var(--blue);
    color: var(--navy);
}

/* ===== صفحة النمط ===== */
.mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-option input {
    display: none;
}

.mode-card {
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.mode-option input:checked+.mode-card {
    border-color: var(--blue);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mode-card h3 {
    font-size: 15px;
    margin-bottom: 5px;
    color: var(--navy);
    font-weight: 700;
}

.mode-card p {
    font-size: 13px;
    color: var(--text2);
}

/* ===== الطلاب ===== */
.student-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.student-sec-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    min-width: 140px;
}

.student-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border2);
    border-radius: 9px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: 0.2s;
}

.student-input:focus {
    border-color: var(--blue);
    background: white;
}

.student-input[readonly] {
    background: #f8fafc;
    color: var(--text3);
}

.presenter-badge {
    background: rgba(37, 99, 235, 0.1);
    color: var(--blue);
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 700;
    margin-right: 6px;
}

/* ===== التحميل ===== */
.loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.loading-title {
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
}

.loading-sub {
    font-size: 14px;
    color: var(--text2);
}

/* ===== النتيجة ===== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.result-header h2 {
    font-family: 'Amiri', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
}

.result-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-live {
    flex: 1;
    padding: 13px;
    background: linear-gradient(135deg, var(--navy), var(--purple));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.btn-live:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-print,
.btn-new {
    padding: 12px 18px;
    border-radius: 11px;
    border: 1.5px solid var(--border2);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: var(--card);
    color: var(--text2);
    transition: 0.2s;
}

.btn-print:hover,
.btn-new:hover {
    border-color: var(--blue);
    color: var(--navy);
}

.btn-back {
    padding: 8px 16px;
    border-radius: 9px;
    border: 1.5px solid var(--border2);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    cursor: pointer;
    background: var(--card);
    color: var(--text2);
    transition: 0.2s;
}

.btn-back:hover {
    border-color: var(--blue);
    color: var(--navy);
}

/* ===== كروت الفقرات ===== */
.section-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.section-title {
    font-family: 'Amiri', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-icon {
    color: var(--blue);
    display: flex;
    align-items: center;
}

.sec-icon svg {
    stroke: var(--blue);
}

.presenter-intro {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06), rgba(5, 150, 105, 0.02));
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-right: 3px solid var(--green);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.presenter-intro-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
}

.presenter-intro-text {
    font-style: italic;
    color: #065f46;
    font-size: 14px;
    line-height: 1.7;
}

.section-content {
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    line-height: 2;
    color: var(--text);
    white-space: pre-wrap;
}

/* ===== القرآن ===== */
.quran-surah-name {
    font-family: 'Amiri', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* الآيات بجانب بعض في صف أفقي */
.quran-imgs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    background: #f8f6f0;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #e8e0cc;
}

.quran-img {
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    background: white;
}

.quran-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quran-controls label {
    font-size: 13px;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px 10px;
    border: 1.5px solid var(--border2);
    border-radius: 8px;
    background: var(--bg);
    transition: 0.15s;
}

.quran-controls label:hover {
    border-color: var(--blue);
}

.quran-controls input[type=checkbox] {
    accent-color: var(--blue);
}

/* ===== أزرار الفقرات ===== */
.section-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-copy-sec,
.btn-expand,
.btn-shrink,
.btn-change,
.btn-undo-sec,
.btn-search {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border2);
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg);
    color: var(--text2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-copy-sec:hover {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.btn-expand:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.btn-shrink:hover {
    background: #d97706;
    color: white;
    border-color: #d97706;
}

.btn-change:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

.btn-undo-sec:hover {
    background: #64748b;
    color: white;
    border-color: #64748b;
}

.btn-search:hover {
    background: var(--cyan);
    color: white;
    border-color: var(--cyan);
}

button[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===== السؤال ===== */
.su2al-q {
    font-family: 'Amiri', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.su2al-a {
    font-size: 14px;
    padding: 8px 14px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #065f46;
    font-weight: 600;
}

/* ===== الشعر والنصائح وهل تعلم ===== */
.poem-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poem-line {
    font-family: 'Amiri', serif;
    font-size: 17px;
    line-height: 1.9;
    text-align: center;
    color: var(--text);
}

.bullet-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}

.bullet-dot {
    color: var(--blue);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.loading-sec {
    color: var(--text3);
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.4
    }
}

/* ===== البث المباشر ===== */
#live-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--navy2), var(--navy));
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-container {
    width: 100%;
    max-width: 720px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100vh;
    justify-content: space-between;
    position: relative;
}

.live-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
}

.live-dot.active {
    background: var(--cyan);
    transform: scale(1.4);
    box-shadow: 0 0 8px var(--cyan);
}

.live-dot.done {
    background: rgba(255, 255, 255, 0.6);
}

.live-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.live-student {
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--cyan);
    text-align: center;
}

.live-content {
    flex: 1;
    overflow-y: auto;
    font-family: 'Amiri', serif;
    font-size: 22px;
    line-height: 2.2;
    color: white;
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.live-content img {
    max-width: 88%;
    border-radius: 8px;
    margin: 4px auto;
    display: block;
    background: white;
    padding: 4px;
}

.live-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.live-prev,
.live-next {
    padding: 14px 30px;
    border-radius: 12px;
    border: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.live-prev {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.live-next {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.live-next:hover {
    background: var(--blue2);
    transform: scale(1.04);
}

.live-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
}

/* ===== قسم الصوت ===== */
.audio-section {
    margin-top: 18px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.audio-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.audio-header h3 {
    font-family: 'Amiri', serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
}

.gender-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.gender-btn {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border2);
    background: var(--bg);
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text2);
}

.gender-btn:hover {
    border-color: var(--blue);
    color: var(--navy);
}

.gender-btn.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.btn-generate-audio {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #047857, var(--green));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-generate-audio:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.btn-generate-audio:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.audio-progress {
    margin-top: 12px;
    display: none;
}

.audio-progress.show {
    display: block;
}

.audio-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 7px;
}

.audio-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--cyan));
    border-radius: 10px;
    transition: width 0.3s;
    width: 0%;
}

.audio-progress-text {
    font-size: 13px;
    color: var(--text2);
    text-align: center;
}

.audio-player-wrap {
    margin-top: 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
}

.audio-player-wrap.show {
    display: flex;
}

.audio-player-card {
    background: var(--navy);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.audio-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 36px;
}

.audio-wave-bar {
    width: 4px;
    background: var(--cyan);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.audio-wave-bar:nth-child(1) {
    height: 12px;
    animation-delay: 0s
}

.audio-wave-bar:nth-child(2) {
    height: 24px;
    animation-delay: 0.1s
}

.audio-wave-bar:nth-child(3) {
    height: 32px;
    animation-delay: 0.2s
}

.audio-wave-bar:nth-child(4) {
    height: 18px;
    animation-delay: 0.3s
}

.audio-wave-bar:nth-child(5) {
    height: 28px;
    animation-delay: 0.4s
}

.audio-wave-bar:nth-child(6) {
    height: 16px;
    animation-delay: 0.5s
}

.audio-wave-bar:nth-child(7) {
    height: 26px;
    animation-delay: 0.15s
}

.audio-wave-bar:nth-child(8) {
    height: 20px;
    animation-delay: 0.35s
}

.audio-wave.paused .audio-wave-bar {
    animation: none;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.3);
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(1)
    }

    50% {
        transform: scaleY(0.3)
    }
}

.audio-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.audio-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.audio-play-btn:hover {
    background: var(--blue2);
    transform: scale(1.08);
}

.audio-skip-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.audio-skip-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.audio-seek {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.audio-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cyan);
    cursor: pointer;
}

.audio-download-btn {
    padding: 11px 20px;
    background: var(--bg);
    color: var(--navy);
    border: 1.5px solid var(--border2);
    border-radius: 11px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.audio-download-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* ===== Dark mode ===== */
body.dark {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark .card,
.body.dark .student-row,
.body.dark .section-card,
.body.dark .audio-section {
    background: #1e293b;
    border-color: #334155;
}

body.dark .field-input,
.body.dark .student-input {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark .field-input:focus {
    background: #1e293b;
}

body.dark .check-item {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark .hero h1,
.body.dark .result-header h2,
.body.dark .section-title,
.body.dark .loading-title {
    color: #e2e8f0;
}

body.dark .btn-copy-sec,
.body.dark .btn-expand,
.body.dark .btn-shrink,
.body.dark .btn-change,
.body.dark .btn-undo-sec,
.body.dark .btn-search {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .btn-back-setup,
.body.dark .btn-print,
.body.dark .btn-new,
.body.dark .btn-back {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark .presenter-intro {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.25);
}

body.dark .presenter-intro-text {
    color: #6ee7b7;
}

body.dark .field-label,
.body.dark .student-sec-name {
    color: #93c5fd;
}

body.dark .audio-download-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark .su2al-a {
    background: rgba(5, 150, 105, 0.15);
}

body.dark .quran-imgs {
    background: #1a1a2e;
    border-color: #334155;
}

body.dark .mode-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .gender-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark #dark-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* ============================================================ */
/* ============== صفحة Landing الترويجية الجديدة ============== */
/* ============================================================ */

/* صفحة Landing تكسر قيد max-width:700px للـ .page الافتراضي */
.landing-page {
    max-width: 1280px !important;
    width: 100%;
    padding: 0 32px;
    gap: 0 !important;
}

/* عند عرض صفحة Landing نخفي زر الوضع الداكن لأنه يتعارض مع النافبار */
body:has(#page-landing:not(.hidden)) #dark-btn {
    top: 22px;
    left: 32px;
}

/* ===== Navbar ===== */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 28px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 60px;
}

.landing-logo {
    font-family: 'Tajawal', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: -0.5px;
    direction: ltr;
}

.landing-logo .logo-dot {
    color: #94a3b8;
    font-weight: 500;
    font-size: 22px;
}

.landing-menu {
    display: flex;
    gap: 38px;
    align-items: center;
}

.landing-menu a {
    color: #475569;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    transition: color 0.2s;
    position: relative;
    padding-bottom: 6px;
}

.landing-menu a:hover {
    color: #2563eb;
}

.landing-menu a.nav-active {
    color: #2563eb;
    font-weight: 700;
}

.landing-menu a.nav-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    left: 0;
    height: 2.5px;
    background: #2563eb;
    border-radius: 2px;
}

/* ===== Hero ===== */
.landing-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 30px 0 90px;
}

.hero-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 460px;
}

.hero-circle {
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, #e0ecff 0%, #f0f5ff 60%, transparent 100%);
    z-index: 0;
}

.hero-dots {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: radial-gradient(#c5d4ec 1.8px, transparent 1.8px);
    background-size: 14px 14px;
    z-index: 0;
}

.hero-dots-1 {
    top: 8%;
    right: 8%;
}

.hero-dots-2 {
    bottom: 4%;
    left: 4%;
    width: 70px;
    height: 70px;
}

.hero-illustration {
    position: relative;
    z-index: 2;
    max-width: 100%;
    width: 480px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(37, 99, 235, 0.15));
}

.hero-text {
    text-align: right;
    padding-right: 20px;
}

.hero-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1.25;
    color: #0f2d5c;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-title-blue {
    color: #2563eb;
}

.hero-desc {
    font-size: 17px;
    line-height: 1.9;
    color: #64748b;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: #2563eb;
    color: white;
    border: none;
    padding: 16px 38px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
    transition: all 0.25s;
}

.hero-cta:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.42);
}

.hero-cta .cta-arrow {
    font-size: 20px;
    transition: transform 0.25s;
}

.hero-cta:hover .cta-arrow {
    transform: translateX(-4px);
}

.hero-cta-center {
    display: flex;
    margin: 40px auto 0;
}

.hero-note {
    margin-top: 18px;
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

/* ===== Section heading ===== */
.section-heading {
    font-family: 'Tajawal', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #0f2d5c;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: block;
}

.heading-underline {
    display: block;
    width: 60px;
    height: 3px;
    background: #2563eb;
    border-radius: 2px;
    margin: 14px auto 0;
}

/* ===== Features ===== */
.features-section {
    padding: 50px 0 70px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: white;
    border: 1px solid #eef2f7;
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(30, 58, 95, 0.04);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
    border-color: #d8e3f5;
}

.feature-icon {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #eef4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 22px;
}

.feature-icon-1 {
    background: #eef4ff;
}

.feature-icon-2 {
    background: #e0f2fe;
}

.feature-icon-3 {
    background: #ecfdf5;
}

.feature-card h3 {
    font-family: 'Tajawal', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #0f2d5c;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.8;
}

/* ===== Banner ===== */
.banner-section {
    background: linear-gradient(135deg, #eef4ff 0%, #f5f8ff 100%);
    border-radius: 24px;
    padding: 36px 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 30px 0 90px;
    position: relative;
    overflow: hidden;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
}

.banner-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.banner-text h3 {
    font-family: 'Tajawal', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 6px;
}

.banner-text p {
    font-size: 14px;
    color: #475569;
}

.banner-illustration {
    height: 130px;
    width: auto;
    flex-shrink: 0;
}

/* ===== How it works ===== */
.how-section {
    padding: 30px 0 80px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-card {
    background: white;
    border: 1px solid #eef2f7;
    border-radius: 20px;
    padding: 34px 26px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.step-card:hover {
    border-color: #2563eb;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.1);
}

.step-num {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: white;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.step-card h4 {
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0f2d5c;
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.8;
}

/* ===== Footer ===== */
.landing-footer {
    text-align: center;
    padding: 40px 0 30px;
    border-top: 1px solid #eef2f7;
    color: #94a3b8;
    font-size: 14px;
}

/* ===== Dark mode للـ landing ===== */
body.dark .landing-nav {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark .landing-logo {
    color: #e2e8f0;
}

body.dark .landing-menu a {
    color: #cbd5e1;
}

body.dark .hero-title {
    color: #f1f5f9;
}

body.dark .hero-desc {
    color: #94a3b8;
}

body.dark .section-heading {
    color: #f1f5f9;
}

body.dark .feature-card,
body.dark .step-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark .feature-card h3,
body.dark .step-card h4 {
    color: #f1f5f9;
}

body.dark .banner-section {
    background: linear-gradient(135deg, #1e293b, #1e3a5f);
}

body.dark .banner-text h3 {
    color: #60a5fa;
}

body.dark .banner-text p {
    color: #cbd5e1;
}

body.dark .landing-footer {
    color: #64748b;
    border-top-color: #334155;
}

body.dark .hero-circle {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.05) 60%, transparent 100%);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .landing-page {
        padding: 0 18px;
    }

    .landing-nav {
        margin-bottom: 30px;
        padding: 18px 0;
    }

    .landing-menu {
        gap: 20px;
    }

    .landing-menu a {
        font-size: 14px;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 0 50px;
        text-align: center;
    }

    .hero-text {
        text-align: center;
        padding-right: 0;
    }

    .hero-title {
        font-size: 38px;
    }

    .hero-desc {
        font-size: 15px;
        margin: 0 auto 28px;
    }

    .hero-image-wrap {
        min-height: 320px;
        order: -1;
    }

    .hero-circle {
        width: 320px;
        height: 320px;
    }

    .hero-illustration {
        width: 320px;
    }

    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .banner-section {
        flex-direction: column;
        text-align: center;
        padding: 28px 22px;
    }

    .banner-content {
        flex-direction: column;
    }

    .banner-illustration {
        height: 110px;
    }

    .section-heading {
        font-size: 24px;
        margin-bottom: 32px;
    }
}

@media (max-width: 600px) {
    .landing-menu {
        gap: 14px;
    }

    .landing-menu a {
        font-size: 13px;
    }

    .landing-logo {
        font-size: 22px;
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-cta {
        padding: 14px 30px;
        font-size: 15px;
    }
}

/* السماح للـ body بعرض كامل عند ظهور صفحة Landing */
body:has(#page-landing:not(.hidden)) {
    padding: 0 !important;
    align-items: stretch;
    background: #ffffff;
}

body.dark:has(#page-landing:not(.hidden)) {
    background: #0f172a;
}

/* ===== إصلاحات محددة ===== */

/* student-input في الوضع المظلم */
body.dark .student-input {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

body.dark .student-input::placeholder {
    color: #475569 !important;
}

body.dark .student-row {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* هل تعلم والنصائح - إصلاح اللون والعرض */
.bullet-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.bullet-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    line-height: 1.9 !important;
    color: var(--text) !important;
}

.bullet-dot {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--blue);
}

body.dark .bullet-item {
    color: #e2e8f0 !important;
}

body.dark .bullet-dot {
    color: #93c5fd !important;
}

/* الشعر */
.poem-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poem-line {
    display: block !important;
    font-family: 'Amiri', serif;
    font-size: 17px;
    text-align: center;
    line-height: 2;
    color: var(--text) !important;
}

body.dark .poem-line {
    color: #e2e8f0 !important;
}

/* gender-btn active واضح */
.gender-btn.active {
    background: var(--navy, #1e3a5f) !important;
    color: white !important;
    border-color: var(--navy, #1e3a5f) !important;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

body.dark .gender-btn.active {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

/* AI mode section */
body.dark #audio-section,
body.dark .audio-section {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* section-content يرث اللون */
.section-content {
    color: var(--text) !important;
}

body.dark .section-content {
    color: #e2e8f0 !important;
}

/* زر تحميل الإذاعة */
.btn-download {
    padding: 12px 18px;
    border-radius: 10px;
    border: 1.5px solid var(--border2);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg2);
    color: var(--text2);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

body.dark .btn-download {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

/* إصلاح mode-card في الوضع المظلم */
body.dark .mode-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark .mode-card h3 {
    color: #93c5fd !important;
}
/* ============================================================ */
/* ============== ✨ تحسينات أسطورية للصفحات الداخلية ✨ ============== */
/* ============================================================ */
/* تنطبق فقط عندما تكون صفحة Landing مخفية */

body:not(:has(#page-landing:not(.hidden))) {
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 88% 92%, rgba(14, 165, 233, 0.10) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, #f5f8fd 0%, #eef3fa 100%);
    background-attachment: fixed;
}

body.dark:not(:has(#page-landing:not(.hidden))) {
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 88% 92%, rgba(14, 165, 233, 0.14) 0%, transparent 45%),
        linear-gradient(180deg, #0a1124 0%, #0f172a 100%);
    background-attachment: fixed;
}

/* ===== أنميشن دخول الصفحات ===== */
@keyframes pageRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardRise {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
    50%      { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
}

#page-setup:not(.hidden),
#page-mode:not(.hidden),
#page-students:not(.hidden),
#page-loading:not(.hidden),
#page-result:not(.hidden) {
    animation: pageRise 0.55s cubic-bezier(.22,.9,.32,1.2);
}

/* ===== Hero الداخلي (الأيقونة + العنوان) ===== */
#page-setup .hero,
#page-mode .hero,
#page-students .hero {
    padding: 30px 0 22px;
}
#page-setup .mic-icon,
#page-mode .mic-icon,
#page-students .mic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px; height: 84px;
    border-radius: 26px;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    color: #fff;
    font-size: 40px;
    margin: 0 auto 16px;
    box-shadow:
        0 16px 36px rgba(37, 99, 235, 0.38),
        inset 0 -3px 0 rgba(0,0,0,0.12),
        inset 0 2px 0 rgba(255,255,255,0.35);
    animation: float 4s ease-in-out infinite;
    filter: none;
}
#page-setup .hero h1,
#page-mode .hero h1,
#page-students .hero h1 {
    font-size: 34px;
    background: linear-gradient(135deg, #0f2d5c 0%, #2563eb 70%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
body.dark #page-setup .hero h1,
body.dark #page-mode .hero h1,
body.dark #page-students .hero h1 {
    background: linear-gradient(135deg, #93c5fd 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
#page-setup .hero::after,
#page-mode .hero::after,
#page-students .hero::after {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9, #7c3aed);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== الكروت الأسطورية ===== */
#page-setup .card,
#page-mode .card,
.student-row,
.section-card,
.audio-section {
    border-radius: 20px;
    border: 1px solid rgba(220, 230, 245, 0.9);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 12px 28px -16px rgba(15, 45, 92, 0.18),
        0 4px 10px -6px rgba(15, 45, 92, 0.08);
    position: relative;
    overflow: hidden;
    animation: cardRise 0.5s cubic-bezier(.22,.9,.32,1.2) both;
}
#page-setup .card::before,
.section-card::before,
.audio-section::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9, #7c3aed);
    opacity: 0.85;
}
#page-setup .card:hover,
.section-card:hover,
.audio-section:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 22px 44px -20px rgba(37, 99, 235, 0.28),
        0 8px 16px -8px rgba(15, 45, 92, 0.14);
    transition: all 0.3s cubic-bezier(.22,.9,.32,1.2);
}

body.dark #page-setup .card,
body.dark #page-mode .card,
body.dark .student-row,
body.dark .section-card,
body.dark .audio-section {
    background: linear-gradient(180deg, rgba(30,41,59,0.85), rgba(30,41,59,0.95));
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.04) inset,
        0 14px 32px -14px rgba(0,0,0,0.5);
}

/* ===== الحقول ===== */
.field-input, .student-input {
    border-radius: 12px;
    border: 1.5px solid rgba(196, 208, 224, 0.7);
    background: rgba(248, 251, 255, 0.8);
    transition: all 0.25s ease;
}
.field-input:hover, .student-input:hover {
    border-color: #93c5fd;
    background: #fff;
}
.field-input:focus, .student-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12),
        0 4px 14px rgba(37, 99, 235, 0.10);
}

/* ===== زر random/best بأسلوب أنيق ===== */
.btn-random {
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f5ff, #e0ecff);
    border-color: rgba(37, 99, 235, 0.2);
    transition: all 0.25s;
}
.btn-random:hover {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    transform: rotate(15deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

/* ===== Checkbox items ===== */
.check-item {
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248,251,255,0.7), rgba(240,245,255,0.7));
    transition: all 0.2s ease;
}
.check-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.3);
}
.check-item:has(input:checked) {
    background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(14,165,233,0.08));
    border-color: #2563eb;
    color: #0f2d5c;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}
body.dark .check-item:has(input:checked) {
    color: #dbeafe;
    background: linear-gradient(135deg, rgba(37,99,235,0.22), rgba(14,165,233,0.15));
}

/* ===== الأزرار الرئيسية ===== */
.btn-main {
    background: linear-gradient(135deg, #0f2d5c 0%, #2563eb 60%, #0ea5e9 100%);
    background-size: 200% 200%;
    border-radius: 14px;
    padding: 16px;
    font-size: 17px;
    box-shadow:
        0 10px 28px -8px rgba(37, 99, 235, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.3s cubic-bezier(.22,.9,.32,1.2);
    position: relative;
    overflow: hidden;
}
.btn-main:hover:not(:disabled) {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow:
        0 16px 36px -8px rgba(37, 99, 235, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-main:not(:disabled)::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s;
}
.btn-main:hover:not(:disabled)::after { left: 120%; }

.btn-back-setup {
    border-radius: 14px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(196, 208, 224, 0.6);
    transition: all 0.25s;
}
.btn-back-setup:hover {
    background: #fff;
    border-color: #2563eb;
    transform: translateX(3px);
    box-shadow: 0 6px 16px -6px rgba(37,99,235,0.3);
}

/* ===== Mode cards ===== */
.mode-card {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248,251,255,0.85), rgba(240,245,255,0.85));
    border-width: 2px;
    transition: all 0.3s cubic-bezier(.22,.9,.32,1.2);
    position: relative;
    overflow: hidden;
}
.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 50%, rgba(37,99,235,0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.mode-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 14px 30px -14px rgba(37,99,235,0.35);
}
.mode-card:hover::before { opacity: 1; }
.mode-option input:checked + .mode-card {
    background: linear-gradient(135deg, rgba(37,99,235,0.10), rgba(14,165,233,0.08));
    border-color: #2563eb;
    box-shadow:
        0 0 0 4px rgba(37,99,235,0.12),
        0 14px 30px -14px rgba(37,99,235,0.4);
}
.mode-card h3 { font-size: 17px; }

/* ===== Student rows ===== */
.student-row {
    border-radius: 14px;
    transition: all 0.25s;
    animation: cardRise 0.4s cubic-bezier(.22,.9,.32,1.2) both;
}
.student-row:hover {
    transform: translateX(-3px);
    border-color: rgba(37, 99, 235, 0.4);
}
.student-sec-name {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark .student-sec-name {
    background: linear-gradient(135deg, #93c5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.presenter-badge {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    box-shadow: 0 3px 10px rgba(37,99,235,0.35);
}

/* ===== Loading أسطوري ===== */
.loading-wrap { gap: 24px; }
.spinner {
    width: 64px; height: 64px;
    border: 4px solid transparent;
    border-top-color: #2563eb;
    border-right-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    position: relative;
}
.spinner::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-bottom-color: rgba(124, 58, 237, 0.4);
    animation: spin 1.4s linear infinite reverse;
}
.loading-title {
    font-size: 24px;
    background: linear-gradient(90deg, #2563eb, #0ea5e9, #2563eb);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2.4s linear infinite;
}

/* ===== Result page ===== */
.result-header {
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(240,245,255,0.85));
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(220, 230, 245, 0.9);
    box-shadow: 0 8px 24px -16px rgba(15,45,92,0.2);
    margin-bottom: 6px;
}
.result-header h2 {
    font-size: 26px;
    background: linear-gradient(135deg, #0f2d5c, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark .result-header {
    background: linear-gradient(135deg, rgba(30,41,59,0.85), rgba(15,23,42,0.85));
    border-color: rgba(51,65,85,0.6);
}
body.dark .result-header h2 {
    background: linear-gradient(135deg, #93c5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Section cards (نتيجة الفقرات) ===== */
.section-card {
    animation: cardRise 0.5s cubic-bezier(.22,.9,.32,1.2) both;
    padding: 22px;
}
.section-card:nth-child(1) { animation-delay: 0.05s; }
.section-card:nth-child(2) { animation-delay: 0.10s; }
.section-card:nth-child(3) { animation-delay: 0.15s; }
.section-card:nth-child(4) { animation-delay: 0.20s; }
.section-card:nth-child(5) { animation-delay: 0.25s; }
.section-card:nth-child(6) { animation-delay: 0.30s; }
.section-card:nth-child(n+7) { animation-delay: 0.35s; }

.section-title {
    font-size: 18px;
    border-bottom: 2px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(90deg, #2563eb, #0ea5e9);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    padding-bottom: 10px;
    margin-bottom: 14px;
}
body.dark .section-title {
    background-image: linear-gradient(#1e293b, #1e293b), linear-gradient(90deg, #2563eb, #0ea5e9);
}

.presenter-intro {
    background: linear-gradient(135deg, rgba(5,150,105,0.10), rgba(16,185,129,0.04));
    border: 1px solid rgba(5,150,105,0.22);
    border-right: 4px solid #059669;
    border-radius: 12px;
}

/* ===== أزرار الفقرات ===== */
.btn-copy-sec, .btn-expand, .btn-shrink, .btn-change, .btn-undo-sec, .btn-search {
    border-radius: 10px;
    background: rgba(248,251,255,0.85);
    transition: all 0.2s ease;
}
.btn-copy-sec:hover, .btn-expand:hover, .btn-shrink:hover,
.btn-change:hover, .btn-undo-sec:hover, .btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -6px rgba(0,0,0,0.2);
}

/* ===== قسم الصوت ===== */
.audio-section { padding: 24px; }
.audio-header h3 {
    background: linear-gradient(135deg, #0f2d5c, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 19px;
}
body.dark .audio-header h3 {
    background: linear-gradient(135deg, #93c5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gender-btn {
    border-radius: 12px;
    background: rgba(248,251,255,0.8);
    transition: all 0.25s;
}
.gender-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -8px rgba(37,99,235,0.4);
}
.gender-btn.active {
    background: linear-gradient(135deg, #0f2d5c, #2563eb) !important;
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(37,99,235,0.4) !important;
}

.btn-generate-audio {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    background-size: 200% 200%;
    border-radius: 14px;
    box-shadow:
        0 10px 28px -8px rgba(5,150,105,0.5),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition: all 0.3s;
}
.btn-generate-audio:hover:not(:disabled) {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -8px rgba(5,150,105,0.6);
}

/* مشغل الصوت — تصميم Premium */
.audio-player-card {
    background: linear-gradient(135deg, #0f2d5c 0%, #1e3a5f 60%, #163156 100%);
    border-radius: 18px;
    padding: 22px;
    box-shadow:
        0 16px 40px -12px rgba(15,45,92,0.5),
        inset 0 1px 0 rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}
.audio-player-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(14,165,233,0.25), transparent 70%);
    pointer-events: none;
}
.audio-play-btn {
    width: 58px; height: 58px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow:
        0 8px 22px rgba(37,99,235,0.5),
        inset 0 -2px 0 rgba(0,0,0,0.15),
        inset 0 2px 0 rgba(255,255,255,0.2);
    animation: glowPulse 2.5s ease-in-out infinite;
}
.audio-play-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

/* أزرار الـ result-footer */
.btn-live {
    background: linear-gradient(135deg, #1e3a5f 0%, #7c3aed 100%);
    background-size: 200% 200%;
    border-radius: 14px;
    box-shadow: 0 10px 28px -8px rgba(124,58,237,0.45);
    transition: all 0.3s;
}
.btn-live:hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -8px rgba(124,58,237,0.6);
}
.btn-print, .btn-new, .btn-download {
    border-radius: 12px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    transition: all 0.25s;
}
.btn-print:hover, .btn-new:hover, .btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -8px rgba(37,99,235,0.35);
}

/* زر back في النتيجة */
.btn-back {
    border-radius: 11px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    transition: all 0.25s;
}
.btn-back:hover {
    transform: translateX(3px);
    border-color: #2563eb;
}

/* ===== Live overlay — تحسين بصري ===== */
#live-overlay {
    background:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,0.25), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124,58,237,0.20), transparent 50%),
        linear-gradient(135deg, #0a1124 0%, #0f2d5c 50%, #163156 100%);
}
.live-next {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 10px 28px rgba(37,99,235,0.5);
}
.live-next:hover {
    background: linear-gradient(135deg, #1d4ed8, #0284c7);
    transform: scale(1.06);
    box-shadow: 0 14px 36px rgba(37,99,235,0.6);
}
.live-student {
    background: linear-gradient(135deg, #67e8f9, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== زر الوضع الداكن — أكثر أناقة ===== */
body:not(:has(#page-landing:not(.hidden))) #dark-btn {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(196,208,224,0.6);
    box-shadow: 0 6px 18px -6px rgba(15,45,92,0.2);
    transition: all 0.25s;
}
body:not(:has(#page-landing:not(.hidden))) #dark-btn:hover {
    transform: rotate(15deg) scale(1.08);
    border-color: #2563eb;
    box-shadow: 0 8px 22px -6px rgba(37,99,235,0.4);
}

/* ===== Tooltip أنيق ===== */
.len-tooltip:hover::after {
    background: linear-gradient(135deg, #0f2d5c, #1e3a5f);
    box-shadow: 0 12px 28px -8px rgba(15,45,92,0.5);
    border-radius: 10px;
    padding: 10px 14px;
}

/* ===== Su2al ===== */
.su2al-q {
    background: linear-gradient(135deg, #0f2d5c, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark .su2al-q {
    background: linear-gradient(135deg, #93c5fd, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.su2al-a {
    background: linear-gradient(135deg, rgba(5,150,105,0.12), rgba(16,185,129,0.06));
    border: 1px solid rgba(5,150,105,0.25);
    box-shadow: 0 4px 10px -4px rgba(5,150,105,0.2);
}

/* ===== Quran ===== */
.quran-imgs {
    background: linear-gradient(135deg, #faf8f0, #f5f0e0);
    border: 1px solid rgba(201,168,76,0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ===== Responsive للصفحات الداخلية ===== */
@media (max-width: 600px) {
    #page-setup .hero h1,
    #page-mode .hero h1,
    #page-students .hero h1 { font-size: 26px; }
    #page-setup .mic-icon,
    #page-mode .mic-icon,
    #page-students .mic-icon {
        width: 70px; height: 70px; font-size: 32px; border-radius: 22px;
    }
    .result-header h2 { font-size: 20px; }
    .audio-play-btn { width: 52px; height: 52px; }
}


/* ============================================
   ICONS, 3D MIC, RESPONSIVE & ANIMATIONS v3
   ============================================ */

/* SVG داخل الأزرار يأخذ لون النص */
.btn-best svg, .btn-main svg, .btn-generate-audio svg,
.btn-live svg, .btn-print svg, .btn-download svg, .btn-new svg,
.audio-download-btn svg, .live-close svg,
.gender-btn svg, .audio-skip-btn svg, .audio-play-btn svg,
#dark-btn svg, .btn-random svg, .len-tooltip svg,
.feature-icon svg, .banner-icon svg, .mode-icon svg, .audio-header-icon svg {
    display: inline-block;
    vertical-align: middle;
}

/* أيقونات ميزات الصفحة الرئيسية */
.feature-icon { display: flex !important; align-items: center; justify-content: center; }
.feature-icon svg { width: 38px; height: 38px; color: white; }
.banner-icon { display: flex; align-items: center; justify-content: center; }
.banner-icon svg { width: 38px; height: 38px; }

/* زر الوضع الليلي */
#dark-btn { font-size: 0; }
#dark-btn svg { color: var(--navy); }
body.dark #dark-btn svg { color: #f1f5f9; }

/* ===== أيقونات الهيرو 3D للصفحات الداخلية ===== */
.mic-icon.icon-3d {
    width: 92px;
    height: 92px;
    border-radius: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 18px;
    position: relative;
    box-shadow:
        0 18px 40px -10px rgba(37, 99, 235, 0.55),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18);
    transform: perspective(600px) rotateX(8deg);
    animation: icon3dFloat 4s ease-in-out infinite;
    overflow: hidden;
    font-size: 0;
}
.mic-icon.icon-3d::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.45), transparent 55%);
    pointer-events: none;
}
.mic-icon.icon-3d::after {
    content: "";
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,0.15) 60deg, transparent 120deg);
    animation: icon3dShine 6s linear infinite;
    pointer-events: none;
}
.mic-icon.icon-3d svg {
    width: 46px;
    height: 46px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
}
.icon-3d-mic    { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.icon-3d-target { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 18px 40px -10px rgba(139,92,246,0.55), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.18); }
.icon-3d-users  { background: linear-gradient(135deg, #06b6d4, #0e7490); box-shadow: 0 18px 40px -10px rgba(6,182,212,0.55), inset 0 2px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.18); }

@keyframes icon3dFloat {
    0%, 100% { transform: perspective(600px) rotateX(8deg) translateY(0); }
    50%      { transform: perspective(600px) rotateX(8deg) translateY(-6px); }
}
@keyframes icon3dShine {
    to { transform: rotate(360deg); }
}

/* أيقونات وضع التشغيل */
.mode-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 12px;
    box-shadow:
        0 10px 22px -8px rgba(37,99,235,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 0 rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}
.mode-icon svg { width: 28px; height: 28px; }
.mode-icon-students { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.mode-icon-ai       { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 10px 22px -8px rgba(139,92,246,0.5), inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -2px 0 rgba(0,0,0,0.15); }
.mode-card:hover .mode-icon { transform: scale(1.08) rotate(-4deg); }

/* أيقونة headers قسم الصوت */
.audio-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 14px -4px rgba(59,130,246,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* أزرار مع أيقونات */
.btn-best {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}
.gender-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-live, .btn-print, .btn-download, .btn-new {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.live-close {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}

/* مؤشر information */
.len-tooltip {
    display: inline-flex;
    align-items: center;
    color: var(--blue);
    cursor: help;
    margin-right: 6px;
}
.len-tooltip svg { display: block; }

/* btn-random يكتب SVG بدلاً من إيموجي */
.btn-random {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.btn-random:hover { transform: rotate(180deg) scale(1.05); }

/* ===== حركات الدخول للصفحات ===== */
.page:not(.hidden):not(.landing-page) {
    animation: pageFadeUp 0.5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes pageFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* حركة خفيفة للـ cards */
.page:not(.hidden):not(.landing-page) > .card,
.page:not(.hidden):not(.landing-page) > .row-2 > .card {
    animation: cardSlideIn 0.55s ease both;
}
.page:not(.hidden):not(.landing-page) > .card:nth-child(2) { animation-delay: 0.05s; }
.page:not(.hidden):not(.landing-page) > .card:nth-child(3) { animation-delay: 0.1s; }
.page:not(.hidden):not(.landing-page) > .card:nth-child(4) { animation-delay: 0.15s; }
@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* hover lift على البطاقات الداخلية */
.card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(30, 58, 95, 0.12);
}

/* زر btn-main shimmer */
.btn-main { position: relative; overflow: hidden; }
.btn-main::after {
    content: "";
    position: absolute;
    top: 0;
    right: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: right 0.6s ease;
}
.btn-main:not(:disabled):hover::after { right: 130%; }

/* gender-btn active glow */
.gender-btn.active {
    box-shadow: 0 6px 16px -4px rgba(59,130,246,0.4);
}

/* ===== استجابة محسّنة للجوال ===== */
@media (max-width: 768px) {
    body { padding: 16px 12px 60px; }
    #dark-btn {
        width: 36px;
        height: 36px;
        top: 12px;
        left: 12px;
    }
    #dark-btn svg { width: 16px; height: 16px; }
    .page { gap: 12px; }
    .card { padding: 16px !important; border-radius: 14px !important; }
    .field-input { font-size: 16px !important; /* يمنع zoom في iOS */ }
    .mic-icon.icon-3d { width: 78px; height: 78px; border-radius: 22px; }
    .mic-icon.icon-3d svg { width: 38px; height: 38px; }
    .hero h1 { font-size: 22px !important; }
    .hero p { font-size: 13px !important; }
    .row-2 { grid-template-columns: 1fr !important; }
    .btn-main {
        font-size: 15px;
        padding: 14px 18px;
    }
    .result-footer {
        flex-direction: column;
        gap: 8px;
    }
    .result-footer button {
        width: 100%;
        justify-content: center;
    }
    .result-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        text-align: center;
    }
    .result-header h2 { font-size: 18px !important; }
    .gender-selector {
        flex-wrap: wrap;
        gap: 6px;
    }
    .gender-btn {
        flex: 1;
        min-width: calc(33% - 4px);
        font-size: 12px;
        padding: 8px 6px;
    }
    .audio-controls { gap: 14px !important; }
    .audio-play-btn { width: 50px !important; height: 50px !important; }
    .mode-options {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .mode-card { padding: 16px !important; }
    .live-container { padding: 18px !important; }
    .live-content { font-size: 18px !important; line-height: 1.7 !important; }
    .live-actions { flex-direction: column; gap: 8px; }
    .live-actions button { width: 100%; }
}

@media (max-width: 480px) {
    body { padding: 12px 10px 50px; }
    .hero h1 { font-size: 20px !important; }
    .mic-icon.icon-3d { width: 68px; height: 68px; }
    .mic-icon.icon-3d svg { width: 32px; height: 32px; }
    .btn-best { font-size: 12px; padding: 6px 10px; }
    .btn-best svg { width: 14px; height: 14px; }
    .audio-section { padding: 16px !important; }
    .audio-player-card { padding: 14px !important; }
    .gender-btn {
        min-width: 100%;
        flex: 0 0 100%;
    }
}

/* تحسين landing nav للجوال */
@media (max-width: 720px) {
    .landing-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    .landing-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    #login-btn, #user-info {
        margin-right: auto;
    }
}

/* لمسة 3D للأيقونات داخل الفيتشرات */
.feature-icon {
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.feature-card:hover .feature-icon {
    transform: translateY(-4px) rotate(-5deg) scale(1.05);
}
.banner-icon {
    animation: heartBeat 1.8s ease-in-out infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.12); }
    50% { transform: scale(1); }
}

/* تحسين dark mode للأيقونات الجديدة */
body.dark .audio-header-icon,
body.dark .mode-icon,
body.dark .mic-icon.icon-3d {
    filter: brightness(1.05);
}

/* منع overflow أفقي على الجوال */
html, body { overflow-x: hidden; }
.page, .card { max-width: 100%; }

/* تحسين خط الصفحات الداخلية */
.hero h1 {
    background: linear-gradient(135deg, var(--navy), var(--blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
body.dark .hero h1 {
    background: linear-gradient(135deg, #e2e8f0, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ================================================================
   V6 — إعادة التضييق العمودي للصفحات الداخلية
   نحافظ على جمال الكروت/الأنميشن، لكن نرجع للعرض المركّز الضيق
   ================================================================ */

/* 1) تأكيد عرض الصفحات الداخلية على 640px لتكون أكثر تركيزاً عمودياً */
#page-setup,
#page-mode,
#page-students,
#page-loading,
#page-result,
#page-live,
#page-profile {
    max-width: 640px !important;
    margin: 0 auto;
}

/* 2) تصغير الـ Hero الداخلي */
#page-setup .hero,
#page-mode .hero,
#page-students .hero,
#page-profile .hero {
    padding: 18px 0 14px !important;
}
#page-setup .mic-icon,
#page-mode .mic-icon,
#page-students .mic-icon,
#page-profile .mic-icon {
    width: 64px !important;
    height: 64px !important;
    border-radius: 18px !important;
    font-size: 28px !important;
    margin: 0 auto 10px !important;
}
#page-setup .hero h1,
#page-mode .hero h1,
#page-students .hero h1,
#page-profile .hero h1 {
    font-size: 24px !important;
    letter-spacing: -0.3px !important;
}
#page-setup .hero p,
#page-mode .hero p,
#page-students .hero p,
#page-profile .hero p {
    font-size: 13px !important;
    margin-top: 4px;
}
#page-setup .hero::after,
#page-mode .hero::after,
#page-students .hero::after,
#page-profile .hero::after {
    width: 50px !important;
    height: 3px !important;
    margin-top: 10px;
}

/* 3) تضييق الكروت ومنع توسعتها */
#page-setup .card,
#page-mode .card,
#page-students .student-row,
.section-card,
.audio-section {
    padding: 16px !important;
    border-radius: 14px !important;
    gap: 10px !important;
}

/* 4) تصغير الأزرار الرئيسية */
.btn-main {
    padding: 13px 20px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
}

/* 5) تصغير عناوين الكروت الداخلية */
#page-setup .card-title,
#page-mode .card-title,
#page-students .card-title {
    font-size: 14px !important;
    margin-bottom: 8px;
}

/* 6) تضييق الـ padding العام للجسم على الصفحات الداخلية */
body:not(:has(#page-landing:not(.hidden))) {
    padding: 20px 14px 60px !important;
}

/* 7) صفحة النتيجة — إرجاع الـ section cards لتصميم عمودي */
#page-result .section-card {
    padding: 18px !important;
    border-radius: 16px !important;
}
#page-result .section-card h3 {
    font-size: 17px !important;
}
#page-result .section-card .content {
    font-size: 15px !important;
    line-height: 1.85 !important;
}

/* 8) result-footer — أزرار في عمود على الموبايل، صف مرتب على الديسكتوب */
.result-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
}
.result-footer button {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 140px !important;
    font-size: 14px !important;
    padding: 11px 14px !important;
}

/* 9) شاشة Live — تركيز عمودي */
#page-live .live-card {
    max-width: 600px !important;
    padding: 24px !important;
}

/* 10) Audio player — تصغير قليل */
.audio-section {
    padding: 16px !important;
}

/* 11) Responsive — على الموبايل كل شيء full width مع padding مريح */
@media (max-width: 600px) {
    #page-setup,
    #page-mode,
    #page-students,
    #page-loading,
    #page-result,
    #page-live,
    #page-profile {
        max-width: 100% !important;
    }
    #page-setup .hero h1,
    #page-mode .hero h1,
    #page-students .hero h1,
    #page-profile .hero h1 {
        font-size: 22px !important;
    }
    .result-footer button {
        flex: 1 1 100% !important;
    }
    body:not(:has(#page-landing:not(.hidden))) {
        padding: 14px 12px 50px !important;
    }
}

/* 12) إزالة أي عرض زائد قد يسببه scroll أفقي */
html, body { overflow-x: hidden; }
