/*
 * AI EGO Club — Theme (Dark only)
 */

/* ── CSS VARIABLES ── */
:root {
  color-scheme: dark;
  --bg:  #0f0a1e;
  --bg2: #1a0d2e;
  --bg3: #0d1a2e;
  --bg-card:        rgba(255,255,255,0.03);
  --bg-card-hover:  rgba(255,255,255,0.05);
  --bg-input:       rgba(255,255,255,0.04);
  --bg-overlay:     rgba(0,0,0,0.7);
  --text:           #e2d9f3;
  --sub:            #9d86c7;
  --dim:            #6b5b8e;
  --dimmer:         #4a3a6e;
  --purple:         #a78bfa;
  --purple-dark:    #7c3aed;
  --purple-dim:     rgba(167,139,250,0.12);
  --purple-border:  rgba(192,132,252,0.2);
  --purple-hover:   rgba(167,139,250,0.18);
  --green:          #34d399;
  --green-dark:     #059669;
  --green-dim:      rgba(52,211,153,0.12);
  --green-border:   rgba(52,211,153,0.25);
  --red:            #f87171;
  --red-dim:        rgba(248,113,113,0.12);
  --red-border:     rgba(248,113,113,0.25);
  --amber:          #fbbf24;
  --amber-dim:      rgba(251,191,36,0.12);
  --amber-border:   rgba(251,191,36,0.25);
  --blue:           #60a5fa;
  --blue-dim:       rgba(96,165,250,0.12);
  --blue-border:    rgba(96,165,250,0.25);
  --border:         rgba(192,132,252,0.15);
  --border2:        rgba(192,132,252,0.25);
  --border3:        rgba(192,132,252,0.35);
  --border-sep:     rgba(192,132,252,0.08);
  --btn-primary-bg: linear-gradient(135deg, #a78bfa, #7c3aed);
  --modal-bg:       rgba(18,10,34,0.98);
  --modal-border:   rgba(192,132,252,0.2);
  --header-bg:      rgba(15,10,30,0.92);
  --header-border:  rgba(192,132,252,0.15);
  --shadow:         0 18px 44px rgba(0,0,0,0.55);
  --shadow-sm:      0 4px 16px rgba(0,0,0,0.3);
  --scrollbar-bg:   rgba(255,255,255,0.04);
  --scrollbar-thumb: rgba(167,139,250,0.25);
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0a1e 0%, #1a0d2e 50%, #0d1a2e 100%);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #e2d9f3;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: rgba(167,139,250,0.25); border-radius: 3px; }
a { color: #a78bfa; }

/* ── WRAP ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 72px; }

/* ── PAGE HEADER ── */
.page-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #a78bfa; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.page-eyebrow::before { content: ''; width: 20px; height: 2px; background: linear-gradient(90deg, #a78bfa, transparent); border-radius: 2px; }
.page-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-hero h1 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.5px; margin-bottom: 4px; }
.page-hero-sub { font-size: 13px; color: #6b5b8e; }

/* ── API BADGE ── */
.api-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(192,132,252,0.2); border-radius: 10px; font-size: 12px; color: #6b5b8e; cursor: pointer; transition: all 0.15s; text-decoration: none; flex-shrink: 0; }
.api-badge:hover { border-color: rgba(167,139,250,0.4); color: #a78bfa; }
.api-dot { width: 6px; height: 6px; border-radius: 50%; background: #4a3a6e; }
.api-dot.ok { background: #34d399; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: rgba(0,0,0,0.2); border: 1px solid rgba(192,132,252,0.12); border-radius: 12px; padding: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { flex: 1; min-width: 100px; padding: 9px 14px; border-radius: 9px; border: none; background: none; color: #6b5b8e; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.tab:hover { color: #9d86c7; }
.tab.active { background: rgba(167,139,250,0.15); color: #e2d9f3; border: 1px solid rgba(167,139,250,0.3); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── LAYOUT ── */
.page-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.left-panel { position: sticky; top: 82px; }
@media (max-width: 860px) { .page-layout { grid-template-columns: 1fr; } .left-panel { position: static; } }

/* ── SECTION CARD ── */
.section-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(192,132,252,0.15); border-radius: 16px; padding: 20px 22px; margin-bottom: 14px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-icon { font-size: 18px; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #a78bfa; }
.section-title::before { content: ''; display: inline-block; width: 3px; height: 12px; background: linear-gradient(180deg,#a78bfa,#7c3aed); border-radius: 2px; margin-right: 7px; vertical-align: middle; }

/* ── FORM ── */
.form-row { margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #6b5b8e; margin-bottom: 5px; }
.form-input, .form-textarea, .form-select { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(192,132,252,0.2); border-radius: 10px; color: #e2d9f3; font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.2s; }
.form-input { padding: 9px 12px; }
.form-textarea { padding: 9px 12px; resize: vertical; min-height: 72px; line-height: 1.6; }
.form-select { padding: 9px 12px; cursor: pointer; appearance: none; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.06); }
.form-input::placeholder, .form-textarea::placeholder { color: #4a3a6e; }
.form-select option { background: #1a0d2e; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ── CHIPS ── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid rgba(192,132,252,0.2); color: #9d86c7; background: rgba(255,255,255,0.03); cursor: pointer; transition: all 0.13s; font-family: inherit; white-space: nowrap; }
.chip:hover { border-color: rgba(167,139,250,0.4); color: #e2d9f3; background: rgba(167,139,250,0.06); }
.chip.sel { background: linear-gradient(135deg, #a78bfa, #7c3aed); border-color: transparent; color: #fff; }

/* ── GEN BUTTON ── */
.gen-btn { width: 100%; padding: 12px 20px; background: linear-gradient(135deg, #a78bfa, #7c3aed); border: none; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 4px; }
.gen-btn:hover { opacity: 0.85; }
.gen-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.spinner { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin-base 0.7s linear infinite; display: none; }
@keyframes spin-base { to { transform: rotate(360deg); } }

/* ── RESULT BLOCKS ── */
.res-block { background: rgba(255,255,255,0.03); border: 1px solid rgba(192,132,252,0.15); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.res-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid rgba(192,132,252,0.1); }
.res-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #6b5b8e; }
.res-body { padding: 14px 16px; font-size: 13px; color: #c4beee; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.copy-btn { padding: 4px 12px; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.25); border-radius: 6px; color: #a78bfa; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.copy-btn:hover { background: rgba(167,139,250,0.2); }

/* ── EMPTY / ERROR ── */
.result-empty { text-align: center; padding: 40px 20px; color: #4a3a6e; font-size: 13px; line-height: 1.7; }
.result-empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }
.error-banner { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.25); border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #fca5a5; margin-bottom: 14px; display: none; }
.error-banner.show { display: block; }

/* ── BADGE ── */
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.badge-new    { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.badge-ok     { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.badge-case   { background: rgba(167,139,250,0.15); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.badge-info   { background: rgba(96,165,250,0.12); color: #60a5fa; border: 1px solid rgba(96,165,250,0.25); }
.badge-lesson { background: rgba(96,165,250,0.15); color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
