/* base.css ──────────────────────────────────────────────── */
/* Shared foundation: reset, colors, typography             */

:root {
  /* BASE */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #141414;
  --bg-elevated: #1a1a1a;

  /* TEXT */
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --text-muted: #555555;

  /* BORDER */
  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.15);

  /* ACCENT (monochrome) */
  --accent: #ffffff;
  --accent-hover: #e0e0e0;

  /* GRADIENT (special highlight only) */
  --gradient-primary: linear-gradient(135deg, #ffffff, #666666);

  /* LAYOUT */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --transition-sidebar: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-default: 0.2s ease;
  --max-content-width: 720px;
  --messages-max-width: 900px;
}

/* ── Reset ──────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.58;
  font-size: 15px;
}

html {
  scroll-behavior: smooth;
}

/* ── Kill visual effects ──────────────────────────────── */
#particle-canvas,
#visualEffects,
#astro-3d,
#astro-background,
.stars-layer,
.galaxy-glow,
.constellation-layer,
.real-planet {
  display: none !important;
}

.hidden { display: none !important; }

/* ── Layout containers ────────────────────────────────── */
.container,
.article-container,
#adminPanel {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px;
  position: relative;
  z-index: 2;
}

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h1 { font-size: 2.4rem; margin-bottom: 0.7em; }
h2 { font-size: 1.65rem; margin: 1.4em 0 0.6em; }
h3 { font-size: 1.32rem; margin: 1.3em 0 0.5em; }

@media (max-width: 768px) {
  .container, .article-container, #adminPanel { padding: 16px 14px; }
  h1 { font-size: 2rem; }
}
@media (max-width: 480px) {
  html { font-size: 14px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
}

/* ── Premium locked UI ────────────────────────────────── */
.premium-locked {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}
.premium-locked::after {
  content: '🔒';
  position: absolute;
  right: 4px;
  top: 4px;
  font-size: 12px;
}

/* ── Premium success overlay ──────────────────────────── */
.premium-success {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(12px);
}
.premium-success-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
  animation: fadeInScale 0.3s ease;
  max-width: 400px;
  width: 90%;
}
.premium-success .success-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-tertiary);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  color: var(--text-primary);
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Subscription section in settings ─────────────────── */
.subscription-section {
  margin: 20px 0;
  padding: 15px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.subscription-section h3 {
  margin-top: 0;
  color: var(--text-primary);
}
#subscriptionStatusBox button {
  margin-top: 10px;
}

/* ── Welcome Chips ────────────────────────────────────── */
.suggested-prompts {
  margin-top: 30px;
  gap: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.prompt-chip {
  background: transparent;
  border: 1px solid var(--border-default);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.prompt-chip:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ── File upload / action group ───────────────────────── */
.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: 0.2s;
  margin-right: 6px;
}
.file-upload-label:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 2;
}

/* ── Message fade ─────────────────────────────────────── */
.message {
  transition: opacity 0.3s ease;
}

/* ── File preview chip ────────────────────────────────── */
.file-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 4px 16px 4px 12px;
  margin: 8px 0 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.file-preview i {
  font-size: 1rem;
}
.file-preview .remove-file {
  cursor: pointer;
  color: #ff4444;
  margin-left: 8px;
}

/* ── Welcome screen ───────────────────────────────────── */
#welcome-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.welcome-content {
  text-align: center;
  max-width: 720px;
  padding: 20px;
}
#welcome-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 30%, #555555);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
#welcome-subtitle {
  margin-top: 12px;
  font-size: 18px;
  color: var(--text-muted);
}

/* ── Status indicator ─────────────────────────────────── */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin: 0 10px;
  vertical-align: middle;
}
.status-indicator.loading { background: var(--text-secondary); }
.status-indicator.syncing { background: #fbbf24; }
.status-indicator.error { background: #ef4444; }