/* ═══════════════════════════════════════════════════════════
   Author Platform — Styles
   Dark minimalist theme with purple accent
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-0: #06060c;
  --bg-1: #0b0b16;
  --bg-2: #111122;
  --bg-3: #181832;
  --bg-4: #1f1f40;
  --bg-5: #26264e;

  /* Borders */
  --border: #222244;
  --border-light: #333360;
  --border-hover: #444480;

  /* Accent */
  --accent: #7c5cfc;
  --accent-hover: #9178ff;
  --accent-dim: rgba(124, 92, 252, 0.10);
  --accent-soft: rgba(124, 92, 252, 0.18);
  --accent-glow: rgba(124, 92, 252, 0.35);

  /* Text */
  --text-1: #e8e8f0;
  --text-2: #9494b8;
  --text-3: #5c5c80;

  /* Status */
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.12);

  /* Typography */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.35s var(--ease);

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
  --topbar-height: 56px;
}

/* ── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-1);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ── Typography ────────────────────────────────────────── */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

h5 {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.text-muted {
  color: var(--text-2);
}

.text-sm {
  font-size: 0.8125rem;
}

.text-xs {
  font-size: 0.6875rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

#view-workspace.active {
  display: flex;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-light);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-1);
  background: var(--bg-3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ── Inputs ────────────────────────────────────────────── */
.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input::placeholder {
  color: var(--text-3);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c5c80' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
}

.input-group-lg .input {
  padding: 16px 20px;
  font-size: 1.125rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-3);
  transition: border-color var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box input {
  border: none;
  background: none;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-3);
}

/* ── Badges & Tags ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-purple {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-yellow {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
}

.badge-sm {
  padding: 2px 8px;
  font-size: 0.6875rem;
}

.tag-sm {
  display: inline-flex;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--bg-3);
  color: var(--text-2);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

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

.tag-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.tag-chip button {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* ── Section Header ────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-2);
  font-size: 1.0625rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 20px;
}

/* ── Or Divider ────────────────────────────────────────── */
.or-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-3);
  font-size: 0.8125rem;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   MOBILE OVERRIDES (max-width: 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Filter bar scroll */
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .filter-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Projects grid 1 column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Modal boxes full-width */
  .modal-box {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }
  .pe-hero-row {
    flex-direction: column;
  }

  /* Editor layout */
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 2px;
  }
  .editor-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }
  .editor-tab {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: .75rem;
    padding: 8px 10px;
  }

  /* Notes layout stack */
  .notes-layout {
    flex-direction: column;
  }
  .notes-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* Landing sections tighter */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hero {
    padding: 100px 0 48px;
  }
  .section-header h2 {
    font-size: 1.4rem;
  }
}
