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

#mainMenu {
    min-width: 220px;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

#mainMenu .dropdown-item {
    border-radius: 12px;
    margin-bottom: 4px;
    transition: all .2s ease;
}

#mainMenu .dropdown-item:hover {
    background: rgba(0, 191, 255, 0.08);
    transform: translateX(-2px);
}
[dir="rtl"] #mainMenu .dropdown-item:hover { transform: translateX(2px); }

:root {
    /* Premium Tut Design System */
    --primary: #000585;
    --secondary: #e9c176;
    --accent: #76d6d5;

    /* Light mode */
    --bg-light: #f7faf9;
    --bg-secondary-light: #f1f4f3;
    --border-light: #bec9c8;
    --text-light: #181c1c;
    --text-secondary-light: #3e4948;

    /* Dark mode — premium deep navy */
    --bg-dark: #0e131f;
    --bg-secondary-dark: #1a1f2c;
    --border-dark: #3e4949;
    --text-dark: #dee2f3;
    --text-secondary-dark: #bdc9c8;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.18);
    --shadow-lg: 0 10px 40px rgba(118, 214, 213, 0.15);
}

body {
    font-family: 'Almarai', 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    transition: background-color 0.3s ease, color 0.3s ease;
    direction: rtl;
}

/* When user switches to English */
body[dir="ltr"],
html[dir="ltr"] body {
    direction: ltr;
}

/* Restore page direction on button text.
   .message-content is intentionally left LTR (inherited from .message.bot/.message.user)
   so that align-items:flex-start always means LEFT regardless of page direction.
   Bubble text uses unicode-bidi:plaintext — no direction override needed there. */
[dir="rtl"] .btn-pill,
[dir="rtl"] .btn-group { direction: rtl; }
[dir="ltr"] .btn-pill,
[dir="ltr"] .btn-group { direction: ltr; }

/* Bubble text: each bubble detects its OWN direction from its content.
   Arabic text → RTL; English text → LTR. Survives language switches. */
.message-bubble {
    unicode-bidi: plaintext;
    text-align: start;
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 2px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary-light);
}

.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-secondary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.form-toggle {
    display: none;
}

.form-toggle.active {
    display: block;
}

/* ── Utility ───────────────────────────────────────────────── */

.u-hidden { display: none !important; }
.u-align-center { align-items: center; }
