/* ═══════════════════════════════════════════════════════════════════
   AI Toolbox — Unified Design System (Dark Theme)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Core palette ── */
  --bg:            #08080f;
  --surface:       #10101a;
  --surface2:      #181824;
  --surface3:      #20202e;
  --border:        #1e1e30;
  --border-light:  #2a2a3e;

  /* ── Text ── */
  --text:          #e4e4f0;
  --text2:         #9090a8;
  --text3:         #606078;

  /* ── Module accents ── */
  --accent-photo:  #4f8cff;
  --accent-ppt:    #10b981;
  --accent-chat:   #f59e0b;
  --accent-pdf:    #ef4444;
  --accent-budget: #10b981;
  --accent-trans:  #06b6d4;
  --accent-home:   #6366f1;

  /* ── Default accent (overridden per page) ── */
  --accent:        var(--accent-home);
  --accent-hover:  #818cf8;
  --accent-dim:    rgba(99, 102, 241, 0.10);

  /* ── Status colors ── */
  --success:       #34d399;
  --success-bg:    rgba(52, 211, 153, 0.08);
  --warn:          #fbbf24;
  --warn-bg:       rgba(251, 191, 36, 0.08);
  --error:         #f87171;
  --error-bg:      rgba(248, 113, 113, 0.08);

  /* ── Geometry ── */
  --radius:        8px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* ── Shadows ── */
  --shadow-sm:     0 2px 8px rgba(0,0,0,.3);
  --shadow:        0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:     0 16px 40px rgba(0,0,0,.5);

  /* ── Typography ── */
  --font:          'Inter', -apple-system, BlinkMacSystemFont,
                   "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:     'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* ── Transitions ── */
  --ease:          cubic-bezier(.4,0,.2,1);
  --fast:          120ms;
  --normal:        200ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Links ── */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border-light); background: var(--surface2);
  color: var(--text); transition: all var(--fast) var(--ease);
  white-space: nowrap; line-height: 1.4;
}
.btn:hover {
  border-color: var(--accent); background: var(--surface3);
  color: #fff; transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface2); border-color: var(--border-light); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Inputs ── */
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
textarea { resize: vertical; min-height: 72px; line-height: 1.6; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239090a8' stroke-width='2'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
input[type="color"] { height: 40px; padding: 4px; width: 100%; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input[type="file"] { font-size: 13px; padding: 8px 10px; }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 18px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  border: 1px solid var(--border-light); background: var(--surface2);
  color: var(--text2);
}
.badge-success { background: var(--success-bg); border-color: rgba(52,211,153,.2); color: var(--success); }
.badge-warn    { background: var(--warn-bg);    border-color: rgba(251,191,36,.2); color: var(--warn); }
.badge-error   { background: var(--error-bg);   border-color: rgba(248,113,113,.2); color: var(--error); }
.badge-accent  { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Alerts ── */
.alert {
  padding: 12px 14px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid transparent; line-height: 1.5;
}
.alert-warn  { background: var(--warn-bg);  border-color: rgba(251,191,36,.25); color: var(--warn); }
.alert-error { background: var(--error-bg); border-color: rgba(248,113,113,.25); color: var(--error); }
.alert-info  { background: var(--accent-dim); border-color: rgba(99,102,241,.25); color: var(--accent); }

/* ── Progress ── */
.progress {
  height: 6px; background: var(--surface2); border-radius: 999px;
  overflow: hidden; border: 1px solid var(--border);
}
.progress-bar {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width .3s var(--ease);
}

/* ── Utility ── */
.muted  { color: var(--text2); }
.faint  { color: var(--text3); }
.mono   { font-family: var(--font-mono); font-size: .9em; }
.stack  { display: grid; gap: 14px; }
.row    { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow   { flex: 1; }

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
  border-radius: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
