/* ==========================================================================
   LinguisticQuran - Main Stylesheet
   Modern, Premium UI with RTL Support
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables - Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Colors - Primary Palette (Unified Emerald/Teal) */
    --color-primary: #0d7377;
    --color-primary-rgb: 13, 115, 119;
    --color-primary-light: #14b8a6;
    --color-primary-dark: #064e52;
    --color-primary-gradient: linear-gradient(135deg, #0d7377 0%, #14b8a6 100%);

    /* Colors - Secondary/Accent (Warm Gold) */
    --color-accent: #d4a017;
    --color-accent-light: #f0c644;
    --color-accent-dark: #a67c12;

    /* Colors - Semantic */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #06b6d4;

    /* Colors - Neutral */
    --color-bg: #f8fafb;
    --color-bg-alt: #f0f4f5;
    --color-surface: #ffffff;
    --color-surface-hover: #f5f8f9;
    --color-border: #e0e7eb;
    --color-border-light: #eef2f4;

    /* Colors - Text */
    --color-text: #1a2332;
    --color-text-secondary: #5a6a7a;
    --color-text-muted: #8a99a8;
    --color-text-inverse: #ffffff;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #064e52 0%, #0d7377 30%, #14b8a6 70%, #2dd4bf 100%);
    --gradient-hero-dark: linear-gradient(135deg, #042f32 0%, #064e52 50%, #0d7377 100%);
    --gradient-accent: linear-gradient(135deg, #d4a017 0%, #f0c644 100%);
    --gradient-card: linear-gradient(135deg, rgba(13,115,119,0.03) 0%, rgba(20,184,166,0.06) 100%);
    --gradient-footer: linear-gradient(135deg, #0a3d40 0%, #0d5558 50%, #0f6b6f 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-blur: 12px;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(13, 115, 119, 0.15);
    --shadow-glow-accent: 0 0 20px rgba(212, 160, 23, 0.2);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Container */
    --container-max: 1280px;
    --container-padding: var(--space-6);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f1923;
        --color-bg-alt: #182633;
        --color-surface: #1a2d3a;
        --color-surface-hover: #243d4e;
        --color-border: #2a4050;
        --color-border-light: #345060;
        --color-text: #edf2f7;
        --color-text-secondary: #b0c4d4;
        --color-text-muted: #7a94a8;
        --gradient-card: linear-gradient(135deg, rgba(13,115,119,0.08) 0%, rgba(20,184,166,0.12) 100%);
    }
}

/* --------------------------------------------------------------------------
   Animation Keyframes
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 115, 119, 0.3); }
    50% { box-shadow: 0 0 20px 5px rgba(13, 115, 119, 0.15); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* RTL Support */
[dir="rtl"] {
    font-family: var(--font-arabic), var(--font-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

.text-arabic {
    font-family: var(--font-arabic);
    font-size: 1.5em;
    line-height: var(--line-height-relaxed);
    direction: rtl;
    text-align: right;
}

.ayah-text {
    font-family: var(--font-arabic);
    font-size: 1.75rem;
    line-height: 2.2;
    direction: rtl;
    text-align: center;
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Disclaimer Banner
   -------------------------------------------------------------------------- */
.disclaimer-banner {
    background: linear-gradient(90deg, #d4a017 0%, #b8860b 50%, #d4a017 100%);
    background-size: 200% 100%;
    animation: gradient-shift 6s ease infinite;
    color: #1a1200;
    padding: var(--space-2) 0;
    font-size: var(--font-size-xs);
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.disclaimer-banner p {
    text-align: center;
    line-height: 1.5;
}

.disclaimer-banner strong {
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.main-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow var(--transition-normal);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) 0;
    gap: var(--space-6);
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 0;
    color: var(--color-text);
}

.logo:hover {
    color: var(--color-primary);
}

.logo-arabic {
    font-family: var(--font-arabic);
    font-size: var(--font-size-lg);
    color: var(--color-primary);
}

.logo-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-6);
}

.nav-menu a {
    color: var(--color-text-secondary);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-menu a:hover {
    color: var(--color-primary);
    background: var(--color-bg-alt);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.language-switcher select {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: var(--color-text-inverse);
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(13, 115, 119, 0.35);
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    padding: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--gradient-card);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Surah Grid
   -------------------------------------------------------------------------- */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}

.surah-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.surah-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.surah-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-3px);
}

.surah-card:hover::after {
    opacity: 1;
}

.surah-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-gradient);
    color: var(--color-text-inverse);
    font-weight: 600;
    border-radius: var(--radius-md);
}

.surah-info {
    flex: 1;
}

.surah-name-ar {
    font-family: var(--font-arabic);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.surah-name-tr {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.surah-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Ayah Display
   -------------------------------------------------------------------------- */
.ayah-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}

.ayah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.main-footer {
    background: var(--gradient-footer);
    color: rgba(255, 255, 255, 0.85);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-10);
}

.footer-section h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-4);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--color-accent-light);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-sm);
}

/* --------------------------------------------------------------------------
   Score/Rating Display
   -------------------------------------------------------------------------- */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.score-badge.high {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.score-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TECVİD RENKLENDİRMESİ
   ═══════════════════════════════════════════════════════════════════════════ */

/* Med (Uzatma) — Mavi */
.tj-madd {
    color: #1d4ed8;
    font-weight: 600;
}

/* Ğunne (Genizleme) — Yeşil */
.tj-ghunnah {
    color: #15803d;
    font-weight: 600;
}

/* Kalkale (Titreme) — Mor */
.tj-qalqalah {
    color: #7e22ce;
    font-weight: 600;
}

/* Şedde (Vurgu) — Kırmızı */
.tj-shadda {
    color: #b91c1c;
    font-weight: 600;
}

/* Tenvin — Turuncu */
.tj-tanwin {
    color: #b45309;
    font-weight: 600;
}

/* Vasıl Elif'i — Gri */
.tj-wasla {
    color: #6b7280;
}

/* Tecvid legend kutusu */
.tajweed-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.25rem;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.82rem;
}

.tajweed-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.tajweed-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tecvid toggle butonu */
.tajweed-toggle {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    color: #1d4ed8;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tajweed-toggle:hover,
.tajweed-toggle.active {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

/* ==========================================================================
   HAMBURGER MENU BUTTON
   ========================================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: var(--color-bg-alt);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-normal);
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav-actions inside menu (hidden on desktop) */
.nav-mobile-actions {
    display: none;
}

/* ==========================================================================
   MOBILE OVERLAY
   ========================================================================== */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet & Small Desktop  (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    :root {
        --container-padding: var(--space-4);
    }

    .nav-menu {
        gap: var(--space-4);
    }

    .surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* --------------------------------------------------------------------------
   Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --container-padding: var(--space-4);
    }

    /* --- Disclaimer banner --- */
    .disclaimer-banner p {
        font-size: var(--font-size-xs);
        padding: 0 var(--space-2);
    }

    /* --- Header / Nav --- */
    .menu-toggle {
        display: flex;
        order: 3;
    }

    .nav-actions {
        display: none; /* hidden on mobile, shown inside slide-out menu */
    }

    .nav-wrapper {
        padding: var(--space-3) 0;
        flex-wrap: nowrap;
        gap: var(--space-3);
    }

    /* Slide-out menu */
    .nav-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: min(300px, 85vw);
        height: 100vh;
        background: var(--color-surface);
        border-left: 1px solid var(--color-border);
        box-shadow: var(--shadow-xl);
        padding: var(--space-16) var(--space-6) var(--space-6);
        gap: var(--space-2);
        z-index: 200;
        transform: translateX(100%);
        transition: transform var(--transition-normal);
        overflow-y: auto;
        pointer-events: none;
        visibility: hidden;
    }

    .nav-menu.active {
        transform: translateX(0);
        pointer-events: auto;
        visibility: visible;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border-light);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: var(--space-3) var(--space-2);
        font-size: var(--font-size-base);
        border-radius: 0;
    }

    /* Mobile nav-actions block inside menu */
    .nav-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        padding-top: var(--space-4);
        border-top: 1px solid var(--color-border) !important;
        margin-top: var(--space-2);
    }

    .nav-mobile-actions .language-switcher select {
        width: 100%;
    }

    .nav-mobile-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Overlay */
    .nav-overlay {
        display: block;
    }

    /* --- Typography scaling --- */
    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    /* --- Main content --- */
    .main-content {
        padding: var(--space-6) 0;
    }

    /* --- Cards --- */
    .card {
        padding: var(--space-4);
    }

    /* --- Surah grid --- */
    .surah-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .surah-card {
        padding: var(--space-3);
    }

    /* --- Ayah --- */
    .ayah-text {
        font-size: 1.4rem;
        line-height: 2;
    }

    /* --- Footer --- */
    .main-footer {
        padding: var(--space-8) 0 var(--space-4);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    /* --- Tajweed legend --- */
    .tajweed-legend {
        gap: 0.5rem 0.75rem;
        font-size: 0.78rem;
    }
}

/* --------------------------------------------------------------------------
   Small Mobile  (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --container-padding: var(--space-3);
    }

    h1 {
        font-size: var(--font-size-2xl);
    }

    h2 {
        font-size: var(--font-size-xl);
    }

    /* --- Footer --- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    /* --- Ayah --- */
    .ayah-text {
        font-size: 1.25rem;
        line-height: 1.9;
    }

    /* --- Score badge --- */
    .score-badge {
        font-size: var(--font-size-xs);
    }

    /* --- Surah number badge --- */
    .surah-number {
        width: 40px;
        height: 40px;
    }

    /* --- Buttons in tight spaces --- */
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-xs);
    }
}

/* --------------------------------------------------------------------------
   RTL mobile adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    [dir="rtl"] .nav-menu {
        right: auto;
        left: 0;
        transform: translateX(-100%);
        border-left: none;
        border-right: 1px solid var(--color-border);
    }

    [dir="rtl"] .nav-menu.active {
        left: 0;
        right: auto;
        transform: translateX(0);
    }
}
