/* =========================================================
   Agahi AI International - main.css
   Luxury · Glassmorphism · Mobile-first · Dark/Light
   ========================================================= */

:root {
    --agahi-bg:        #0b1020;
    --agahi-bg-2:      #11173a;
    --agahi-surface:   rgba(255,255,255,0.06);
    --agahi-surface-2: rgba(255,255,255,0.10);
    --agahi-border:    rgba(255,255,255,0.12);
    --agahi-text:      #e8ecf7;
    --agahi-muted:     #a3aac4;
    --agahi-primary:   #6c8bff;
    --agahi-primary-2: #8b5cf6;
    --agahi-accent:    #34d399;
    --agahi-danger:    #ef4444;
    --agahi-warn:      #f59e0b;
    --agahi-radius:    18px;
    --agahi-radius-sm: 12px;
    --agahi-shadow:    0 10px 40px rgba(8, 12, 32, 0.45);
    --agahi-blur:      18px;
    --agahi-container: 1200px;
    --agahi-gutter:    20px;
    --agahi-font:      'Vazirmatn','Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

html[data-theme="light"] {
    --agahi-bg:        #f7f8fc;
    --agahi-bg-2:      #ffffff;
    --agahi-surface:   rgba(255,255,255,0.7);
    --agahi-surface-2: rgba(255,255,255,0.85);
    --agahi-border:    rgba(15, 23, 42, 0.10);
    --agahi-text:      #0f172a;
    --agahi-muted:     #475569;
    --agahi-shadow:    0 10px 40px rgba(15, 23, 42, 0.12);
}

html, body { overflow-x: hidden; }
body {
    background: radial-gradient(1200px 800px at 80% -10%, rgba(108,139,255,0.18), transparent 60%),
                radial-gradient(900px 700px at -10% 30%, rgba(139,92,246,0.18), transparent 55%),
                radial-gradient(700px 600px at 50% 100%, rgba(52,211,153,0.10), transparent 60%),
                var(--agahi-bg);
    color: var(--agahi-text);
    font-family: var(--agahi-font);
    line-height: 1.65;
    min-height: 100dvh;
    padding-bottom: 80px; /* room for bottom nav on mobile */
}
html[data-theme="light"] body {
    background: radial-gradient(900px 600px at 80% -5%, rgba(108,139,255,0.15), transparent 60%),
                radial-gradient(800px 600px at 0% 30%, rgba(139,92,246,0.12), transparent 60%),
                var(--agahi-bg);
}

a { color: var(--agahi-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--agahi-primary-2); }
img, svg { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(108,139,255,0.35); color: #fff; }

.agahi-container {
    max-width: var(--agahi-container);
    margin: 0 auto;
    padding: 0 var(--agahi-gutter);
}

/* ---------- HEADER ---------- */
.agahi-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(var(--agahi-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--agahi-blur)) saturate(150%);
    background: linear-gradient(180deg, rgba(11,16,32,0.7), rgba(11,16,32,0.4));
    border-bottom: 1px solid var(--agahi-border);
}
html[data-theme="light"] .agahi-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
}
.agahi-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 0;
}
.agahi-brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--agahi-text); font-weight: 700;
}
.agahi-brand-logo img { width: 38px; height: 38px; }
.agahi-brand-text strong { display: block; font-size: 15px; }
.agahi-brand-text small { color: var(--agahi-muted); font-size: 12px; }

.agahi-nav { flex: 1; display: flex; justify-content: center; }
.agahi-menu {
    display: flex; list-style: none; padding: 0; margin: 0; gap: 22px;
}
.agahi-menu a {
    color: var(--agahi-text); font-weight: 500; font-size: 15px; padding: 8px 0;
    border-bottom: 2px solid transparent; transition: border-color .2s ease, color .2s ease;
}
.agahi-menu a:hover { border-bottom-color: var(--agahi-primary); }

.agahi-header-actions { display: flex; align-items: center; gap: 10px; }
.agahi-icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--agahi-border); background: var(--agahi-surface);
    color: var(--agahi-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .15s ease, background .2s ease;
    font-size: 16px;
}
.agahi-icon-btn:hover { transform: translateY(-1px); background: var(--agahi-surface-2); }
.agahi-theme-sun, .agahi-theme-moon { line-height: 1; }
html[data-theme="dark"] .agahi-theme-sun { display: none; }
html[data-theme="light"] .agahi-theme-moon { display: none; }

.agahi-lang-switch {
    background: var(--agahi-surface);
    border: 1px solid var(--agahi-border);
    color: var(--agahi-text);
    padding: 8px 10px; border-radius: 10px; font-family: inherit; font-size: 13px;
}
.agahi-mobile-toggle { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.agahi-mobile-toggle span { width: 20px; height: 2px; background: var(--agahi-text); border-radius: 2px; }

/* ---------- BUTTONS ---------- */
.agahi-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
    font-size: 15px; text-align: center;
}
.agahi-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--agahi-primary), var(--agahi-primary-2));
    box-shadow: 0 8px 24px rgba(108,139,255,0.35);
}
.agahi-btn-primary:hover { transform: translateY(-2px); color:#fff; box-shadow: 0 12px 28px rgba(139,92,246,0.45); }
.agahi-btn-ghost {
    background: var(--agahi-surface); border-color: var(--agahi-border); color: var(--agahi-text);
}
.agahi-btn-ghost:hover { background: var(--agahi-surface-2); }
.agahi-btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---------- GLASS ---------- */
.agahi-glass {
    background: var(--agahi-surface);
    border: 1px solid var(--agahi-border);
    backdrop-filter: blur(var(--agahi-blur));
    -webkit-backdrop-filter: blur(var(--agahi-blur));
    border-radius: var(--agahi-radius);
    box-shadow: var(--agahi-shadow);
}

/* ---------- HERO ---------- */
.agahi-hero { padding: 56px 0 32px; }
.agahi-hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 36px; align-items: center; }
.agahi-eyebrow {
    display: inline-block; padding: 6px 12px; border-radius: 999px;
    background: var(--agahi-surface); border: 1px solid var(--agahi-border);
    color: var(--agahi-muted); font-size: 13px; margin-bottom: 14px;
}
.agahi-h1 {
    font-size: clamp(28px, 4.4vw, 52px); line-height: 1.18; margin: 0 0 14px;
    font-weight: 800; letter-spacing: -0.01em;
}
.agahi-grad-text {
    background: linear-gradient(135deg, var(--agahi-primary), var(--agahi-primary-2) 60%, var(--agahi-accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.agahi-lead { color: var(--agahi-muted); font-size: 17px; margin: 0 0 22px; max-width: 56ch; }
.agahi-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.agahi-hero-bullets { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 16px; flex-wrap: wrap; color: var(--agahi-muted); font-size: 14px; }

.agahi-hero-card { padding: 22px; }
.agahi-hero-img { width: 100%; border-radius: 14px; }
.agahi-hero-chat { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- CHAT BUBBLES ---------- */
.agahi-chat-bubble {
    display: inline-flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px; border-radius: 14px; max-width: 90%;
    font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.agahi-chat-ai {
    background: var(--agahi-surface-2); border: 1px solid var(--agahi-border);
    align-self: flex-start;
}
.agahi-chat-user {
    background: linear-gradient(135deg, rgba(108,139,255,0.25), rgba(139,92,246,0.25));
    border: 1px solid rgba(108,139,255,0.35);
    align-self: flex-end; margin-inline-start: auto;
}

/* ---------- SECTIONS ---------- */
.agahi-section { padding: 56px 0; }
.agahi-section-alt { background: linear-gradient(180deg, transparent, rgba(108,139,255,0.05), transparent); }
.agahi-section-head { text-align: center; max-width: 720px; margin: 0 auto 28px; }
.agahi-section-head h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 8px; }
.agahi-section-head p { color: var(--agahi-muted); margin: 0; }

/* ---------- AI TEACHER ---------- */
.agahi-ai-teacher { padding: 18px; display: grid; gap: 14px; }
.agahi-ai-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--agahi-border); }
.agahi-ai-head strong { display: block; }
.agahi-online { color: var(--agahi-accent); font-size: 12px; }

.agahi-chat-window {
    min-height: 220px; max-height: 480px; overflow: auto;
    display: flex; flex-direction: column; gap: 10px;
    padding: 8px; border-radius: 14px;
    background: rgba(255,255,255,0.02);
}

.agahi-chat-form { display: grid; gap: 10px; }
.agahi-chat-form textarea {
    width: 100%; resize: vertical; min-height: 56px; max-height: 200px;
    padding: 14px 16px; border-radius: 14px;
    background: var(--agahi-surface); border: 1px solid var(--agahi-border);
    color: var(--agahi-text); font-family: inherit; font-size: 15px; line-height: 1.6;
}
.agahi-chat-form textarea:focus { outline: none; border-color: var(--agahi-primary); box-shadow: 0 0 0 3px rgba(108,139,255,0.25); }

.agahi-chat-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agahi-send-btn { margin-inline-start: auto; }

.agahi-chat-status { min-height: 18px; font-size: 13px; color: var(--agahi-muted); }
.agahi-chat-status.is-error { color: var(--agahi-danger); }

/* Typing indicator */
.agahi-typing { display: inline-flex; gap: 4px; }
.agahi-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--agahi-muted); animation: agahi-bounce 1s infinite; }
.agahi-typing span:nth-child(2) { animation-delay: .15s; }
.agahi-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes agahi-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ---------- 2-COL ---------- */
.agahi-two-col { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.agahi-feature-card { padding: 22px; }
.agahi-feature-card h3 { margin: 0 0 8px; font-size: 20px; }
.agahi-feature-card p { color: var(--agahi-muted); margin: 0 0 14px; }

/* ---------- GRADE GRID ---------- */
.agahi-grade-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.agahi-grade-card {
    padding: 18px; display: grid; gap: 4px; text-align: center; color: var(--agahi-text);
    transition: transform .15s ease, border-color .2s ease;
}
.agahi-grade-card:hover { transform: translateY(-3px); border-color: rgba(108,139,255,0.55); color: var(--agahi-text); }
.agahi-grade-num { font-size: 28px; font-weight: 800; color: var(--agahi-primary); }
.agahi-grade-card small { color: var(--agahi-muted); }

/* ---------- FEATURE GRID ---------- */
.agahi-feat-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.agahi-feat-card { padding: 18px; }
.agahi-feat-emoji { font-size: 26px; }
.agahi-feat-card h4 { margin: 8px 0 6px; }
.agahi-feat-card p { color: var(--agahi-muted); margin: 0; font-size: 14px; }

/* ---------- STATS ---------- */
.agahi-stats { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); text-align: center; }
.agahi-stat strong { display: block; font-size: 36px; color: var(--agahi-primary); }
.agahi-stat span { color: var(--agahi-muted); font-size: 14px; }

/* ---------- CTA CARD ---------- */
.agahi-cta-card {
    padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.agahi-cta-card h2 { margin: 0 0 4px; }
.agahi-cta-card p { margin: 0; color: var(--agahi-muted); }

/* ---------- FAQ ---------- */
.agahi-faq { display: grid; gap: 10px; }
.agahi-faq details { padding: 14px 18px; border-radius: 14px; cursor: pointer; }
.agahi-faq summary { font-weight: 600; list-style: none; }
.agahi-faq summary::-webkit-details-marker { display: none; }
.agahi-faq p { margin: 8px 0 0; color: var(--agahi-muted); }

/* ---------- UPLOADER & FORMS ---------- */
.agahi-uploader, .agahi-form-card { padding: 22px; display: grid; gap: 12px; }
.agahi-uploader input[type="file"], .agahi-form-card input, .agahi-form-card textarea,
.agahi-uploader textarea {
    background: var(--agahi-surface); border: 1px solid var(--agahi-border); color: var(--agahi-text);
    border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 15px;
}
.agahi-uploader input:focus, .agahi-form-card input:focus, .agahi-form-card textarea:focus, .agahi-uploader textarea:focus {
    outline: none; border-color: var(--agahi-primary); box-shadow: 0 0 0 3px rgba(108,139,255,0.25);
}
.agahi-result {
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--agahi-border);
    border-radius: 12px; padding: 14px; min-height: 64px; white-space: pre-wrap; font-size: 15px; line-height: 1.7;
}

/* ---------- VOICE ---------- */
.agahi-voice-card { text-align: center; padding: 28px; display: grid; gap: 12px; }
.agahi-voice-record {
    width: 96px; height: 96px; border-radius: 50%; margin: 0 auto; font-size: 36px;
    background: linear-gradient(135deg, var(--agahi-primary), var(--agahi-primary-2));
    color: #fff; border: none; cursor: pointer; box-shadow: 0 10px 30px rgba(108,139,255,0.45);
    transition: transform .15s ease;
}
.agahi-voice-record:hover { transform: scale(1.04); }
.agahi-voice-record.is-recording { animation: agahi-pulse 1.2s infinite; }
@keyframes agahi-pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); } 70% { box-shadow: 0 0 0 24px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.agahi-voice-hint { color: var(--agahi-muted); margin: 0; }

/* ---------- DASHBOARD ---------- */
.agahi-dash-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.agahi-dash-card { padding: 18px; }
.agahi-dash-num { display: block; font-size: 30px; font-weight: 800; color: var(--agahi-primary); margin-top: 6px; }

/* ---------- POST CARDS ---------- */
.agahi-post-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
.agahi-card { overflow: hidden; }
.agahi-card-thumb { display: block; overflow: hidden; }
.agahi-card-thumb img { transition: transform .35s ease; width: 100%; }
.agahi-card-thumb:hover img { transform: scale(1.04); }
.agahi-card-body { padding: 16px 18px 20px; }
.agahi-card-title { margin: 0 0 6px; font-size: 18px; }
.agahi-card-title a { color: var(--agahi-text); }
.agahi-card-meta { color: var(--agahi-muted); font-size: 12px; display: flex; gap: 6px; margin-bottom: 8px; }
.agahi-card-excerpt { color: var(--agahi-muted); font-size: 14px; margin-bottom: 12px; }

.agahi-pagination { display: flex; justify-content: center; padding: 28px 0; }
.agahi-empty { text-align: center; color: var(--agahi-muted); padding: 40px 0; }

/* ---------- SINGLE ---------- */
.agahi-single-head { text-align: center; padding: 28px 0; }
.agahi-single-meta { color: var(--agahi-muted); display: flex; justify-content: center; gap: 8px; font-size: 13px; }
.agahi-single-thumb { margin: 0 auto 20px; max-width: 980px; }
.agahi-single-thumb img { border-radius: var(--agahi-radius); }
.agahi-single-content { max-width: 760px; margin: 0 auto; font-size: 17px; line-height: 1.85; }
.agahi-post-nav { max-width: 760px; margin: 28px auto; display: flex; justify-content: space-between; gap: 12px; }

/* ---------- 404 ---------- */
.agahi-404 { display: grid; place-items: center; min-height: 60vh; }
.agahi-404-card { padding: 36px; text-align: center; max-width: 480px; }
.agahi-404-card .agahi-h1 { font-size: 72px; margin: 0 0 8px; }

/* ---------- FOOTER ---------- */
.agahi-footer { margin-top: 56px; padding: 36px 0 18px; border-top: 1px solid var(--agahi-border); }
.agahi-footer-grid { display: grid; gap: 22px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.agahi-footer-col h4 { margin: 0 0 10px; }
.agahi-footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.agahi-footer-col a { color: var(--agahi-muted); }
.agahi-footer-col a:hover { color: var(--agahi-text); }
.agahi-footer-bottom { text-align: center; color: var(--agahi-muted); padding-top: 18px; border-top: 1px solid var(--agahi-border); margin-top: 18px; }
.agahi-muted { color: var(--agahi-muted); }

/* ---------- BOTTOM NAV (mobile) ---------- */
.agahi-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: none; justify-content: space-around; padding: 8px 4px;
    background: rgba(11,16,32,0.85);
    border-top: 1px solid var(--agahi-border);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
html[data-theme="light"] .agahi-bottom-nav { background: rgba(255,255,255,0.92); }
.agahi-bottom-nav a {
    display: grid; place-items: center; gap: 2px; padding: 6px 8px; min-width: 56px;
    color: var(--agahi-muted); font-size: 11px; border-radius: 10px;
}
.agahi-bottom-nav a:hover, .agahi-bottom-nav a.active { color: var(--agahi-primary); background: rgba(108,139,255,0.10); }
.agahi-bnav-icon { font-size: 18px; line-height: 1; }

/* ---------- ANIMATIONS ---------- */
@media (prefers-reduced-motion: no-preference) {
    .agahi-section, .agahi-glass {
        animation: agahi-fade 0.5s ease both;
    }
    @keyframes agahi-fade {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ---------- GAMIFICATION ---------- */
.agahi-gamify { padding: 22px; display: grid; gap: 14px; }
.agahi-gamify-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.agahi-gamify-row strong { display: block; color: var(--agahi-muted); font-size: 12px; font-weight: 500; }
.agahi-gamify-row span { font-size: 28px; font-weight: 800; color: var(--agahi-primary); }
.agahi-progress {
    height: 10px; border-radius: 999px;
    background: rgba(255,255,255,0.06); border: 1px solid var(--agahi-border); overflow: hidden;
}
.agahi-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--agahi-primary), var(--agahi-primary-2), var(--agahi-accent));
    transition: width .5s ease;
}
.agahi-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.agahi-badge {
    padding: 6px 12px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(108,139,255,0.18), rgba(139,92,246,0.18));
    border: 1px solid rgba(108,139,255,0.45); font-size: 13px;
}

/* ---------- HISTORY & FAVS ---------- */
.agahi-history-list, .agahi-fav-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.agahi-history-list li, .agahi-fav-list li { padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* ---------- FAVORITE BUTTON ---------- */
.agahi-fav-btn { padding: 8px 14px; font-size: 13px; }
.agahi-fav-btn.is-active {
    background: linear-gradient(135deg, var(--agahi-primary), var(--agahi-primary-2));
    color: #fff; border-color: transparent;
}

/* ---------- LANGUAGE CARDS ---------- */
.agahi-lang-card { cursor: pointer; background: var(--agahi-surface); }
.agahi-lang-card:hover { transform: translateY(-2px); border-color: rgba(108,139,255,0.5); }
