/* ══════════════════════════════════════════
   base.css — Foundational styles
   ══════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────── */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242836;
  --border: #2e3345;
  --text: #e4e4e7;
  --text-muted: #8b8fa3;
  --accent: #7c6aef;
  --accent-hover: #6b59de;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --orange: #fb923c;
  --blue: #60a5fa;
}

/* ── Category Color Variables ──────────── */
:root {
  --cat-riport: #068EE7;
  --cat-optim: #E45221;
  --cat-esettanulmany: #10B981;
  --cat-strategia: #7C3AED;
  --cat-sop: #0891B2;
  --cat-hr: #8B5CF6;
  --cat-ertekesites: #F59E0B;
  --cat-kreativ: #EC4899;
  --cat-egyeb: #6B7280;
}

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

/* ── Body ──────────────────────────────── */
body {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── @keyframes ────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-20px); }
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Button (.btn) Family ──────────────── */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.danger {
  color: var(--red);
}

.btn.danger:hover {
  border-color: var(--red);
  background: rgba(248, 113, 113, 0.1);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.success { background: rgba(52, 211, 153, 0.15); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.btn.success:hover { background: rgba(52, 211, 153, 0.25); }
.btn.warning { background: rgba(251, 191, 36, 0.15); color: var(--yellow); border-color: rgba(251, 191, 36, 0.3); }
.btn.warning:hover { background: rgba(251, 191, 36, 0.25); }

.btn.small {
  padding: 6px 14px;
  font-size: 11px;
  border-radius: 6px;
}

/* ── Toggle Switch ─────────────────────── */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

/* ── Form Group & Form Row ─────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Filter Button ─────────────────────── */
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── Stat Card ─────────────────────────── */
.stat-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

.stat-card .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 24px;
  font-weight: 700;
}

.stat-card .value.green { color: var(--green); }
.stat-card .value.yellow { color: var(--yellow); }
.stat-card .value.blue { color: var(--blue); }
.stat-card .value.accent { color: var(--accent); }

/* ── Progress Bar ──────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.progress-fill.green { background: var(--green); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.blue { background: var(--blue); }

/* ── Priority Pill ─────────────────────── */
.priority-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.priority-urgent { background: #f76808; color: white; }
.priority-high { background: #e5484d; color: white; }
.priority-normal { background: #3e63dd; color: white; }
.priority-low { background: #87909e; color: white; }
.priority-none { background: var(--surface2); color: var(--text-muted); }

/* ── View Button ───────────────────────── */
.view-btn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.view-btn:hover { border-color: var(--accent); color: var(--accent); }
.view-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
