/* ============================================================
   KFOO AI المستشار - Main Stylesheet
   Premium Dark Theme with Gold Accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Space+Grotesk:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
    /* Colors */
    --bg-primary: #06090b;
    --bg-secondary: #0d1117;
    --bg-card: #121212;
    --bg-input: #1b1b1b;
    --bg-hover: #1a1d23;
    
    --accent-gold: #facc15;
    --accent-gold-hover: #eab308;
    --accent-gold-glow: rgba(250, 204, 21, 0.15);
    --accent-gold-subtle: rgba(250, 204, 21, 0.08);
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-dark: #4b5563;
    
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-gold: rgba(250, 204, 21, 0.3);
    
    /* Typography — Orbitron يُستخدم تلقائياً لكل الحروف اللاتينية،
       والمتصفح يتراجع لـ Almarai/Tajawal للأحرف العربية فقط */
    --font-arabic: 'Orbitron', 'Almarai', 'Tajawal', 'Segoe UI', sans-serif;
    --font-english: 'Orbitron', 'Space Grotesk', 'Almarai', sans-serif;
    --font-sport:   'Orbitron', 'Space Grotesk', sans-serif;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --radius-circle: 50%;
    
    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 0 30px rgba(250, 204, 21, 0.1);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-arabic);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--accent-gold-hover);
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(250, 204, 21, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(250, 204, 21, 0.5);
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    width: 120px;
    animation: loadingPulse 1.5s infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #06090b;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    padding: 10px 40px;
    background: rgba(6, 9, 11, 0.95);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo img {
    height: 42px;
    width: auto;
}

.navbar-logo span {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.navbar-logo .ai-badge {
    color: var(--accent-gold);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── زر الرجوع الثابت في النافبار ── */
.back-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    text-decoration: none;
    transition: all 0.22s;
    white-space: nowrap;
    flex-shrink: 0;
}
.back-nav-btn:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.11);
    border-color: rgba(255,255,255,0.22);
    transform: translateX(3px);
}
.back-nav-btn svg { flex-shrink: 0; }

.nav-link {
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent-gold);
    background: var(--accent-gold-subtle);
    border-color: var(--border-gold);
}

.nav-btn {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-arabic);
}

.nav-btn-primary {
    background: var(--accent-gold);
    color: #000;
}

.nav-btn-primary:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

.nav-btn-outline {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--border-gold);
}

.nav-btn-outline:hover {
    background: var(--accent-gold-subtle);
}

/* ===== Hero Section ===== */
.hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gold-subtle);
    border: 1px solid var(--border-gold);
    color: var(--accent-gold);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gold);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .gold {
    color: var(--accent-gold);
    text-shadow: 0 0 40px rgba(250, 204, 21, 0.3);
}

.hero .subtitle {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.8;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* ===== Brand Hero Title ===== */
.page-wrapper {
    min-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    position: relative;
    z-index: 1;
}

.brand-hero-title {
    text-align: center;
    padding: 20px 20px 10px;
    animation: fadeInUp 0.7s ease both;
}

.brand-main {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #e2e8f0;
    margin: 0 0 10px;
    line-height: 1.1;
}

.brand-highlight {
    color: #00e676;
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.45);
}

.brand-sub {
    font-family: var(--font-arabic);
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0;
}

/* ===== Characters Section ===== */
.characters-section {
    padding: 20px 40px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
    max-width: 1100px;
    margin: 0 auto;
}

.character-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: transparent;
    border: none;
    padding: 20px;
}

.character-card:hover {
    transform: translateY(-12px);
}

.character-card::before {
    content: none;
}

.character-card img {
    width: 260px;
    height: 260px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    transition: all var(--transition-normal);
    border: 3px solid rgba(250, 204, 21, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.character-card:hover img {
    transform: scale(1.05);
    border-color: var(--accent-gold);
    box-shadow: 0 0 50px rgba(250, 204, 21, 0.25), 0 0 80px rgba(250, 204, 21, 0.1);
}

.character-info {
    position: relative;
    padding: 24px 16px 0;
    text-align: center;
    z-index: 2;
}

.character-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.character-title {
    font-size: 13px;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 16px;
}

.character-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: var(--radius-pill);
    background: var(--accent-gold);
    color: #000;
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font-arabic);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: translateY(10px);
}

.character-card:hover .character-btn {
    opacity: 1;
    transform: translateY(0);
}

.character-btn:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(250, 204, 21, 0.3);
}

/* ===== Glow Effect ===== */
.character-glow {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--accent-gold);
    filter: blur(80px);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

.character-card:hover .character-glow {
    opacity: 0.08;
}

/* ===== Form Card (Login / Register) ===== */
.form-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 460px;
    animation: fadeInUp 0.5s ease;
}

.form-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.form-card .form-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--accent-gold);
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 14px;
    padding: 12px 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.form-input::placeholder {
    color: var(--text-dark);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Phone Input */
.phone-input-wrap {
    display: flex;
    gap: 8px;
}

.phone-country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition-fast);
    font-family: var(--font-arabic);
    min-width: 110px;
}

.phone-country-btn:hover, .phone-country-btn:focus {
    border-color: rgba(250, 204, 21, 0.5);
}

.phone-country-btn .flag {
    font-size: 20px;
}

.phone-input-wrap .form-input {
    flex: 1;
    direction: ltr;
    text-align: right;
}

/* Country Dropdown */
.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 300px;
    max-height: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 100;
    box-shadow: var(--shadow-elevated);
    display: none;
}

.country-dropdown.open {
    display: block;
    animation: fadeIn 0.2s ease;
}

.country-search {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.country-search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-arabic);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
}

.country-search input:focus {
    border-color: rgba(250, 204, 21, 0.5);
}

.country-list {
    overflow-y: auto;
    max-height: 220px;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 13px;
}

.country-item:hover {
    background: var(--bg-hover);
}

.country-item .flag {
    font-size: 18px;
}

.country-item .dial-code {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: auto;
    direction: ltr;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-pill);
    background: var(--accent-gold);
    color: #000;
    font-family: var(--font-arabic);
    font-size: 15px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 8px;
}

.btn-submit:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.form-bottom-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-bottom-link a {
    font-weight: 800;
}

/* ===== Voice Chat Page ===== */
.voice-chat-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.voice-avatar-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 24px;
}

.voice-avatar {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-circle);
    object-fit: cover;
    border: 3px solid var(--border-gold);
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.15);
    transition: all var(--transition-normal);
}

.voice-avatar.speaking {
    border-color: var(--accent-gold);
    box-shadow: 0 0 60px rgba(250, 204, 21, 0.3);
}

/* Voice Waveform */
.voice-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 40px;
    margin-bottom: 24px;
}

.voice-waveform .bar {
    width: 4px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.voice-waveform.active .bar {
    animation: waveBar 0.8s infinite ease-in-out;
}

.voice-waveform.active .bar:nth-child(1) { animation-delay: 0s; }
.voice-waveform.active .bar:nth-child(2) { animation-delay: 0.1s; }
.voice-waveform.active .bar:nth-child(3) { animation-delay: 0.15s; }
.voice-waveform.active .bar:nth-child(4) { animation-delay: 0.2s; }
.voice-waveform.active .bar:nth-child(5) { animation-delay: 0.25s; }
.voice-waveform.active .bar:nth-child(6) { animation-delay: 0.3s; }
.voice-waveform.active .bar:nth-child(7) { animation-delay: 0.35s; }
.voice-waveform.active .bar:nth-child(8) { animation-delay: 0.4s; }
.voice-waveform.active .bar:nth-child(9) { animation-delay: 0.45s; }
.voice-waveform.active .bar:nth-child(10) { animation-delay: 0.5s; }
.voice-waveform.active .bar:nth-child(11) { animation-delay: 0.55s; }
.voice-waveform.active .bar:nth-child(12) { animation-delay: 0.6s; }
.voice-waveform.active .bar:nth-child(13) { animation-delay: 0.65s; }
.voice-waveform.active .bar:nth-child(14) { animation-delay: 0.7s; }
.voice-waveform.active .bar:nth-child(15) { animation-delay: 0.75s; }

@keyframes waveBar {
    0%, 100% { height: 8px; opacity: 0.4; }
    50% { height: 32px; opacity: 1; }
}

.voice-character-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.voice-status {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.voice-status.active {
    color: var(--accent-green);
}

/* Voice Controls */
.voice-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;  /* قيعان الـ wraps متراصّة ⇒ التسميات بنفس الـ Y */
    justify-content: center !important;
    gap: 22px;
    margin-top: 6px;
}
/* كل wrap: زر فوق، تسمية تحت — بشكل صريح */
.voice-controls > .mic-btn-wrap,
.voice-controls > .mute-btn-wrap,
.voice-controls > .end-btn-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 7px !important;
    flex: 0 0 auto !important;
}

.voice-btn {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-circle);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--transition-fast);
    font-family: var(--font-arabic);
}

.voice-btn-mic {
    width: 80px;
    height: 80px;
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 30px rgba(250, 204, 21, 0.3);
    transition: all 0.25s ease;
}

.voice-btn-mic:hover {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.4);
}

/* 🟢 حالة الاستماع — أخضر (متاح، يسمع) */
.voice-btn-mic.recording {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    animation: pulseGreen 1.5s infinite;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.55);
    border: 2px solid rgba(74, 222, 128, 0.65);
}
@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 22px rgba(34, 197, 94, 0.45), 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50%      { box-shadow: 0 0 40px rgba(34, 197, 94, 0.75), 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* ⏸ حالة الإيقاف المؤقت — أزرق داكن مع توهج */
.voice-btn-mic.muted {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    border: 2.5px solid rgba(99, 179, 237, 0.7);
    color: #63b3ed;
    animation: pulseResume 2s infinite;
    box-shadow: 0 0 28px rgba(99, 179, 237, 0.4);
}

/* ── ⬅️ Back to Trainers Button (دائماً مرئي حتى قبل بدء المحادثة) ── */
.trainer-back-btn {
    position: fixed !important;
    top: 80px !important;             /* أسفل الهيدر العلوي */
    right: 16px !important;
    z-index: 9999 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: rgba(0,0,0,0.70);
    border: 1.5px solid rgba(204,255,0,0.55);
    border-radius: 999px;
    color: #CCFF00;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .22s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 0 8px rgba(204,255,0,0.55);
    box-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 0 18px rgba(204,255,0,0.18);
}
.trainer-back-btn:hover {
    background: rgba(204,255,0,0.14);
    border-color: rgba(204,255,0,0.85);
    transform: translateX(-3px);
    box-shadow: 0 4px 22px rgba(0,0,0,0.6), 0 0 28px rgba(204,255,0,0.35);
}
.trainer-back-btn svg { transform: scaleX(-1); }
@media (max-width: 520px){
    .trainer-back-btn { top: 70px !important; right: 10px !important; padding: 7px 13px; font-size: 12px; }
}

/* ── 📋 Call Summary Card — ملخّص المحادثة بعد الإنهاء ── */
.call-summary-card {
    background: linear-gradient(165deg, rgba(204,255,0,0.04) 0%, rgba(0,229,255,0.03) 50%, rgba(0,0,0,0.4) 100%);
    border: 1.5px solid rgba(204,255,0,0.25);
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow:
        0 0 24px rgba(204,255,0,0.10),
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 12px 32px rgba(0,0,0,0.5);
    color: #ffffff;
}
.cs-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1.5px dashed rgba(204,255,0,0.20);
}
.cs-icon {
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg, #CCFF00, #00E5FF);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    box-shadow: 0 0 18px rgba(204,255,0,0.4);
}
.cs-title {
    font-family: 'Changa','Cairo','Tajawal',sans-serif;
    font-size: 19px; font-weight: 800; color: #fff;
    line-height: 1.2;
}
.cs-subtitle {
    font-family: 'Orbitron','Tajawal',sans-serif;
    font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px;
    color: #CCFF00; opacity: 0.85; margin-top: 3px;
}
.cs-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 14px;
}
.cs-stat {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    transition: all .25s ease;
}
.cs-stat:hover {
    border-color: rgba(204,255,0,0.4);
    transform: translateY(-2px);
}
.cs-stat-icon { font-size: 18px; line-height: 1; margin-bottom: 4px; }
.cs-stat-value {
    font-family: 'Orbitron','Tajawal',sans-serif;
    font-size: 17px; font-weight: 900; color: #CCFF00;
    line-height: 1;
    text-shadow: 0 0 8px rgba(204,255,0,0.4);
}
.cs-stat-label { font-size: 10px; color: #94a3b8; margin-top: 4px; font-weight: 700; }
.cs-trainer-info, .cs-time-info {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
    font-size: 13px;
}
.cs-time-info { border-bottom: none; }
.cs-label { color: #94a3b8; font-weight: 700; }
.cs-value { color: #fff; font-weight: 900; }
.cs-topics {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed rgba(0,229,255,0.20);
}
.cs-topics-title {
    font-size: 12px; font-weight: 800; color: #00E5FF;
    margin-bottom: 8px;
    text-shadow: 0 0 6px rgba(0,229,255,0.4);
}
.cs-topics-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 120px; overflow-y: auto;
}
.cs-topic-item {
    background: rgba(0,229,255,0.06);
    border: 1px solid rgba(0,229,255,0.18);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px; color: #cbd5e1;
    line-height: 1.5;
    direction: rtl; text-align: right;
}
@media (max-width: 480px){
    .cs-stats { gap: 6px; }
    .cs-stat { padding: 8px 4px; }
    .cs-stat-value { font-size: 15px; }
    .cs-stat-label { font-size: 9px; }
}

/* ── 📞 End Call Button Wrap — مع تسمية تحت الزر ── */
.end-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.end-btn-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #fca5a5;
    user-select: none;
    text-align: center;
    min-width: 50px;
}

/* ── 🔇 Mute Button — Apple-style (يكتم مايكك دون قطع المدرب) ── */
.mute-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.voice-btn-mute {
    width: 54px; height: 54px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.18);
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.voice-btn-mute:hover {
    transform: scale(1.06);
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.30);
}
.voice-btn-mute:active { transform: scale(0.96); }
.voice-btn-mute.muted {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border-color: rgba(239, 68, 68, 0.85);
    color: #ffffff;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.5), 0 4px 16px rgba(0,0,0,0.4);
    animation: muteGlow 2s ease-in-out infinite;
}
@keyframes muteGlow {
    0%, 100% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.5), 0 4px 16px rgba(0,0,0,0.4); }
    50%      { box-shadow: 0 0 32px rgba(239, 68, 68, 0.75), 0 4px 16px rgba(0,0,0,0.4); }
}
.mute-btn-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    user-select: none;
    text-align: center;
    min-width: 50px;
    transition: color 0.25s ease;
}
.voice-btn-mute.muted ~ .mute-btn-label,
.mute-btn-wrap .voice-btn-mute.muted + .mute-btn-label { color: #fca5a5; }

/* ── Wrapper الزر + النص ── */
.mic-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.mic-btn-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    transition: color 0.3s ease, opacity 0.3s ease;
    user-select: none;
    text-align: center;
    min-width: 64px;
}

/* ألوان النص حسب الحالة */
.mic-btn-label.label-idle     { color: #a0a0a0; }
.mic-btn-label.label-listening { color: #4ade80; }  /* 🟢 أخضر — يسمع/متاح */
.mic-btn-label.label-paused   {
    color: #63b3ed;          /* أزرق — إيقاف */
    animation: blinkLabel 1.8s infinite;
}

@keyframes blinkLabel {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

@keyframes pulseResume {
    0%, 100% { box-shadow: 0 0 20px rgba(99,179,237,0.3); }
    50%       { box-shadow: 0 0 42px rgba(99,179,237,0.65); }
}

@keyframes pulseMuted {
    0%, 100% { box-shadow: 0 0 15px rgba(107, 114, 128, 0.2); opacity: 0.8; }
    50% { box-shadow: 0 0 25px rgba(107, 114, 128, 0.4); opacity: 1; }
}

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.5); }
}


.voice-btn-end {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.voice-btn-end:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Voice Timer */
.voice-timer {
    margin-top: 24px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

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

.voice-timer .timer-value {
    color: var(--accent-gold);
    font-weight: 800;
    font-family: var(--font-english);
    font-size: 16px;
    direction: ltr;
}

.voice-timer .timer-remaining {
    color: var(--text-secondary);
}

/* ===== User Profile Page ===== */
.profile-page {
    padding: 100px 40px 60px;
    max-width: 900px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-circle);
    background: var(--accent-gold-subtle);
    border: 2px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-gold);
}

.profile-name {
    font-size: 24px;
    font-weight: 800;
}

.profile-email {
    font-size: 14px;
    color: var(--text-muted);
}

.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.profile-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.profile-stat-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.profile-stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-gold);
    font-family: var(--font-english);
}

.profile-stat-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* ===== Admin Panel ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    padding: 24px 0;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.admin-sidebar-logo img {
    height: 36px;
}

.admin-sidebar-logo span {
    font-size: 16px;
    font-weight: 800;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-right: 3px solid transparent;
}

.admin-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.admin-nav-item.active {
    color: var(--accent-gold);
    background: var(--accent-gold-subtle);
    border-right-color: var(--accent-gold);
}

.admin-nav-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.admin-nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 12px 20px;
}

.admin-content {
    flex: 1;
    margin-right: 280px;
    padding: 32px 40px;
}

.admin-page-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.admin-page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Admin Stats Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.admin-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.admin-stat-number {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-english);
    margin-bottom: 4px;
}

.admin-stat-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Admin Table */
.admin-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: rgba(250, 204, 21, 0.06);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.admin-table td {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--bg-hover);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-badge.expired {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-badge.unused {
    background: rgba(107, 114, 128, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.25);
}

.status-badge.suspended {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Admin Action Buttons */
.admin-action-btn {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-arabic);
    background: transparent;
    margin: 0 2px;
}

.admin-action-btn.edit {
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.3);
}

.admin-action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.15);
}

.admin-action-btn.stop {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.admin-action-btn.stop:hover {
    background: rgba(245, 158, 11, 0.15);
}

.admin-action-btn.delete {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.admin-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Admin Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 480px;
    animation: fadeInUp 0.3s ease;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    animation: toastIn 0.3s ease;
    min-width: 300px;
    text-align: center;
    box-shadow: var(--shadow-elevated);
}

.toast.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--accent-green);
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.toast.info {
    background: rgba(250, 204, 21, 0.15);
    border: 1px solid rgba(250, 204, 21, 0.3);
    color: var(--accent-gold);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Hamburger Button ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    color: var(--accent-gold);
    padding: 6px 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hamburger-btn:hover {
    background: var(--accent-gold-subtle);
}

/* ===== Side Menu ===== */
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.side-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 270px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    z-index: 2001;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    right: 0;
}

.side-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.side-menu-close {
    margin-right: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.side-menu-close:hover {
    color: var(--accent-red);
    background: rgba(239,68,68,0.1);
}

.side-menu-links {
    padding: 12px 0;
    flex: 1;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-arabic);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.side-menu-item:hover {
    color: var(--accent-gold);
    background: var(--accent-gold-subtle);
}

.side-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 20px;
}

/* ===== Responsive ===== */

/* Large desktop — roomier cards */
@media (min-width: 1400px) {
    .characters-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 48px;
        max-width: 1200px;
    }
    .character-card img { width: 280px; height: 280px; }
}

/* Small desktop / large tablet */
@media (max-width: 1200px) {
    .characters-section { padding: 20px 32px; }
    .character-card img { width: 220px; height: 220px; }
    .characters-grid { gap: 28px; }
    .character-card { padding: 16px; }
}

@media (max-width: 992px) {
    .characters-section { padding: 16px 24px; }
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
        max-width: 760px;
    }
    .character-card img { width: 220px; height: 220px; }

    .admin-sidebar {
        width: 240px;
    }

    .admin-content {
        margin-right: 240px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
    }

    .navbar.scrolled {
        padding: 10px 16px;
    }
    
    .navbar-logo img {
        height: 34px;
    }
    
    .navbar-logo span {
        font-size: 16px;
    }
    
    .navbar-links {
        display: none;
    }
    
    .hamburger-btn {
        display: flex;
    }
    
    .hero {
        padding: 70px 16px 10px;
    }
    
    .characters-section {
        padding: 14px 14px 24px;
    }

    .page-wrapper {
        min-height: auto;
        padding-top: 70px;
    }

    .brand-hero-title { padding: 0 16px 6px; }
    .brand-main { letter-spacing: -0.02em; }

    /* Mobile: 2 dense columns (not single column) — shows more characters at once */
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        max-width: 560px;
    }

    .character-card {
        padding: 10px 6px;
    }

    .character-card img {
        width: 170px !important;
        height: 170px !important;
        min-width: 170px;
        min-height: 170px;
        max-width: 170px;
        max-height: 170px;
        object-fit: cover;
        border-radius: 50% !important;
        border-width: 2px;
    }

    .character-info { padding: 14px 6px 0; }
    .character-name { font-size: 17px; margin-bottom: 4px; }
    .character-title { font-size: 11px; margin-bottom: 10px; }

    .character-btn {
        opacity: 1;
        transform: translateY(0);
        padding: 8px 16px;
        font-size: 12px;
        gap: 6px;
    }
    .character-btn svg { width: 13px; height: 13px; }
    
    .form-card {
        padding: 24px 18px;
    }
    
    .admin-sidebar {
        transform: translateX(100%);
        transition: transform var(--transition-normal);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-right: 0;
        padding: 20px 12px;
    }
    
    .profile-page {
        padding: 80px 16px 30px;
    }
    
    /* Voice Chat Mobile */
    .voice-chat-page {
        padding: 70px 12px 20px;
        justify-content: flex-start;
        gap: 0;
    }

    /* رفع زري "وثيقة" و"رفع صور" للأعلى عند الجوال */
    #legalDocBtn {
        margin-top: 12px !important;
        width: 100%;
    }

    #legalDocBtn > div {
        gap: 10px !important;
    }

    #legalDocBtn button {
        width: 92% !important;
        max-width: 360px;
        margin: 0 auto !important;
    }
    
    .voice-avatar-wrap {
        width: 140px;
        height: 140px;
        margin-bottom: 16px;
    }
    
    .voice-avatar {
        width: 140px;
        height: 140px;
    }
    
    .voice-character-name {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .voice-status {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .voice-waveform {
        height: 32px;
        margin-bottom: 16px;
    }
    
    .voice-controls {
        gap: 16px;
    }
    
    .voice-btn {
        width: 56px;
        height: 56px;
    }
    
    .voice-btn-mic {
        width: 70px;
        height: 70px;
    }
    
    .voice-timer {
        margin-top: 16px;
        padding: 10px 16px;
        gap: 10px;
        font-size: 12px;
        width: 100%;
        max-width: 340px;
        justify-content: center;
    }
    
    .voice-timer .timer-value {
        font-size: 15px;
    }
    
    #transcriptBox {
        width: 95% !important;
        max-height: 160px !important;
        padding: 14px !important;
        margin-top: 10px !important;
    }
    
    #endCallSection {
        margin-top: 16px !important;
    }

    #endCallSection .btn-submit {
        padding: 10px 20px !important;
        font-size: 13px;
    }
    
    .toast {
        min-width: 260px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }

    .navbar {
        padding: 8px 12px;
    }

    .navbar.scrolled {
        padding: 8px 12px;
    }

    .navbar-logo img {
        height: 30px;
    }

    .navbar-logo span {
        font-size: 14px;
    }

    /* Home page — tighter on small phones */
    .page-wrapper { padding-top: 64px; }
    .characters-section { padding: 10px 10px 20px; }
    .characters-grid { gap: 12px; max-width: 100%; }
    .character-card { padding: 8px 4px; }
    .character-card img { width: 140px !important; height: 140px !important; min-width: 140px; min-height: 140px; max-width: 140px; max-height: 140px; }
    .character-name { font-size: 15px; }
    .character-title { font-size: 10.5px; margin-bottom: 8px; }
    .character-btn { padding: 7px 12px; font-size: 11px; }

    .brand-hero-title { padding: 0 12px 4px; }
    
    .voice-chat-page {
        padding: 64px 10px 16px;
        /* ✅ على الجوال: ابدأ من الأعلى — لا توسيط عمودي يُبعد الزرين */
        justify-content: flex-start;
        min-height: auto;
    }

    /* رفع زري "وثيقة" و"رفع صور" للأعلى مباشرةً تحت الميكروفون */
    #legalDocBtn {
        margin-top: 10px !important;
        width: 100%;
    }

    #legalDocBtn > div {
        gap: 8px !important;
    }

    #legalDocBtn button {
        width: 90% !important;
        max-width: 340px;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    .voice-avatar-wrap {
        width: 120px;
        height: 120px;
        margin-bottom: 12px;
    }
    
    .voice-avatar {
        width: 120px;
        height: 120px;
    }
    
    .voice-character-name {
        font-size: 18px;
    }
    
    .voice-btn {
        width: 50px;
        height: 50px;
    }
    
    .voice-btn-mic {
        width: 64px;
        height: 64px;
    }
    
    .profile-cards {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   📱 إصلاحات الجوال — منع تصغير iOS التلقائي عند الإدخال
   ومنع الإزاحة الأفقية مع الحفاظ على تمرير عجلة الماوس
═══════════════════════════════════════════════════════════ */
/* html فقط هو سياق التمرين الأفقي + الرأسي. body يستخدم overflow-x:clip
   لمنع إزاحة الصفحة بدون إنشاء سياق تمرير منفصل (يحافظ على عجل الماوس). */
html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100vw;
    width: 100%;
}
body {
    max-width: 100vw;
    overflow-x: clip;  /* clip لا يُنشئ سياق تمرير، بعكس hidden */
    overflow-y: visible;
}
@media (max-width: 768px) {
    /* iOS Safari يكبّر الصفحة تلقائياً عند التركيز على إدخال بحجم خط أقل من 16px — هذا يسبب الإزاحة */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input:not([type]),
    select,
    textarea {
        font-size: 16px !important;
    }
    /* منع تجاوز العناصر للعرض */
    img, video, iframe, table, pre, .container, .card {
        max-width: 100% !important;
    }
    /* تنسيق عنوان الأقسام داخل البطاقات */
    .section-title-inline {
        padding: 0 4px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🔢 فرض الأرقام الإنجليزية (1,2,3) في كل حقول الإدخال الرقمية
   ═══════════════════════════════════════════════════════════════
   يحلّ مشكلة عرض الأرقام الهندية (١،٢،٣) في صفحات RTL على Safari/Chrome */
input[type="number"],
input[type="time"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="tel"],
input[inputmode="numeric"],
input[inputmode="decimal"],
input[inputmode="tel"],
.kfoo-num,
.numeric-input {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: bidi-override !important;
    font-variant-numeric: lining-nums tabular-nums !important;
    -webkit-locale: "en-US" !important;
}

/* للوقت تحديداً (HH:MM AM/PM) — أرقام إنجليزية حتى عند تنسيق العربية */
input[type="time"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
    direction: ltr !important;
    unicode-bidi: bidi-override !important;
}

/* في صفحات RTL: حافظ على محاذاة النصية اليمنى للحقول النصية فقط */
[dir="rtl"] input[type="text"]:not([inputmode="numeric"]):not([inputmode="decimal"]):not(.kfoo-num),
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"],
[dir="rtl"] input[type="search"],
[dir="rtl"] input[type="url"],
[dir="rtl"] textarea:not(.kfoo-num) {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: normal !important;
}
