/* shared/study.css — MEA Study */

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

:root {
  --bg:          #090C10;
  --bg-2:        #0D1117;
  --surface:     #111720;
  --surface-2:   #161D28;
  --border:      rgba(255,255,255,0.06);
  --border-2:    rgba(255,255,255,0.10);
  --text:        #F0F4F8;
  --text-2:      #8B99A8;
  --text-3:      #4A5568;
  --accent:      #00D4FF;
  --accent-dim:  rgba(0,212,255,0.08);
  --accent-glow: rgba(0,212,255,0.20);
  --green:       #22C55E;
  --green-dim:   rgba(34,197,94,0.08);
  --yellow:      #F59E0B;
  --red:         #EF4444;
  --r:           10px;
  --r-lg:        14px;
  --r-xl:        20px;
  --font-mono:   'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100dvh;
}

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,12,16,0.90);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-left  { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-eco {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 2px;
  color: var(--accent); text-decoration: none;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.topbar-sep   { color: var(--text-3); font-size: 14px; }
.topbar-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 2px;
  color: var(--text);
}

.lang-btn {
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.lang-btn:hover { color: var(--accent); border-color: var(--accent); }

.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
  cursor: pointer; overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r); border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 28px; font-size: 15px; border-radius: var(--r-lg); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #00bfe8; box-shadow: 0 0 20px var(--accent-glow); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); background: var(--surface); }

/* ── HERO ─────────────────────────────────────────────────────── */
.hero {
  padding: 72px 24px 56px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,212,255,0.06) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }

.hero-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 8vw, 72px);
  letter-spacing: .03em; line-height: 1.05;
  color: var(--text); margin-bottom: 16px;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.hero-sub {
  font-size: 15px; color: var(--text-2);
  max-width: 520px; margin: 0 auto 40px; line-height: 1.6;
}

/* ── SEARCH ─────────────────────────────────────────────────── */
.search-wrap { position: relative; max-width: 600px; margin: 0 auto; }

.search-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-icon { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.search-input::placeholder { color: var(--text-3); }
.search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 14px; padding: 2px 6px;
  border-radius: 4px;
}
.search-clear:hover { color: var(--text); background: var(--surface-2); }

.search-filters {
  display: flex; gap: 8px; margin-top: 10px; justify-content: center;
}
.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; font-family: inherit;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--accent); }

.search-results {
  position: absolute; top: calc(100% + 12px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  overflow: hidden; z-index: 50;
  max-height: 420px; overflow-y: auto;
}
.search-result-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }
.result-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-dim); border: 1px solid rgba(0,212,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-top: 2px;
}
.result-body  { flex: 1; min-width: 0; }
.result-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.result-snippet {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.search-empty {
  padding: 32px; text-align: center;
  font-size: 13px; color: var(--text-3);
}
.search-loading {
  padding: 24px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--text-3);
}

/* ── SECTION ─────────────────────────────────────────────────── */
.section { padding: 56px 24px; }
.section-inner { max-width: 900px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: .04em; color: var(--text);
  margin-bottom: 8px;
}
.section-sub { font-size: 14px; color: var(--text-3); }

.section-cta {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── CATEGORY GRID ───────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-dim);
  transform: translateY(-2px);
}
.cat-icon  { font-size: 28px; }
.cat-name  { font-size: 14px; font-weight: 700; color: var(--text); }
.cat-level {
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3);
}

/* Skeleton loading */
.cat-skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  height: 110px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── CTA GRID ────────────────────────────────────────────────── */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px; text-align: center;
}
.cta-icon  { font-size: 32px; margin-bottom: 12px; }
.cta-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cta-desc  { font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.footer-eco   { color: var(--accent); text-decoration: none; font-weight: 700; }
.footer-sep   { color: var(--text-3); }
.footer-product { color: var(--text-2); font-weight: 600; }
.footer-ver   { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: var(--text-3); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ── SPINNER ─────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .hero   { padding: 48px 16px 40px; }
  .section { padding: 40px 16px; }
  .search-filters { flex-direction: column; align-items: stretch; }
  .filter-select { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
