/* ============================================================
   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&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 */
    --font-arabic: 'Almarai', 'Segoe UI', sans-serif;
    --font-english: 'Space Grotesk', 'Almarai', 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;
}

.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;
    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;
    align-items: center;
    gap: 20px;
}

.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);
}

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

.voice-btn-mic.recording {
    background: var(--accent-red);
    animation: pulseRed 1.5s infinite;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.voice-btn-mic.muted {
    background: #6b7280;
    animation: pulseMuted 2s infinite;
    box-shadow: 0 0 20px rgba(107, 114, 128, 0.3);
}

@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: 100%;
        max-width: 170px;
        height: auto;
        aspect-ratio: 1 / 1;
        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;
    }
    
    .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 { max-width: 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;
    }
    
    .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;
    }
}
