/* ═══════════════════════════════════════════════════════════════════════════
   FullTimeCode — Shell, Variables & Base Components
   Layers the FullTimeCode design system over Odysseus. Loaded after
   /static/style.css so these rules override existing defaults.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Design Tokens ── */
:root {
  --bg: #0B1020;
  --bg-elevated: #0a0f1a;
  --surface: #1e293b;
  --surface-hover: #1f2937;
  --border: #334155;
  --border-light: #374151;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --subtle: #64748b;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-lime: #a3e635;
  --accent-lime-dim: #84cc16;
  --accent-secondary: var(--accent-lime);
  --accent-tertiary: #10b981;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --brand-gradient: linear-gradient(100deg, #38bdf8, #a3e635);
  --gradient-1: linear-gradient(135deg, #06b6d4 0%, #10b981 50%, #a3e635 100%);
  --gradient-2: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --glass: rgba(17, 24, 39, 0.7);
  --ftc-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. Base ── */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--text);
}

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar-track { background: var(--bg-elevated); }
  ::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
    border: 2px solid var(--bg-elevated);
  }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--accent-dim); }
}

html {
  scrollbar-color: var(--accent) var(--bg-elevated);
  scrollbar-width: thin;
}

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--accent);
  transition: color 0.2s var(--ftc-ease);
}

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

/* ── 3. Buttons ── */
button.confirm-btn.confirm-btn-primary,
button[type="submit"]:not(.pw-toggle):not(.memory-toolbar-btn):not(.session-bulk-btn),
.btn-primary {
  background: var(--gradient-1);
  color: #fff;
  border-radius: 100px;
  box-shadow: 0 10px 40px var(--accent-glow);
  border: none;
  transition: all 0.3s var(--ftc-ease);
}

button.confirm-btn.confirm-btn-primary:hover,
button[type="submit"]:not(.pw-toggle):not(.memory-toolbar-btn):not(.session-bulk-btn):hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 60px var(--accent-glow);
}

button.theme-io-btn,
button.memory-toolbar-btn,
button.session-bulk-btn,
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.25s var(--ftc-ease);
}

button.theme-io-btn:hover,
button.memory-toolbar-btn:hover,
button.session-bulk-btn:hover,
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

/* ── 4. Form controls ── */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea,
select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.2s var(--ftc-ease), box-shadow 0.2s var(--ftc-ease);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

/* ── 5. Glass surfaces ── */
.modal-content,
.admin-modal-content,
.admin-card,
.memory-modal-content,
#theme-popup {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
}

/* ── 6. Sidebar ── */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
}

.sidebar-header { border-bottom: 1px solid var(--border); }

.sidebar-brand-title {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.list-item {
  color: var(--text-muted);
  border-radius: 12px;
  transition: all 0.2s var(--ftc-ease);
}

.list-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.section-title {
  color: var(--text);
  font-weight: 600;
}

.section-icon { color: var(--accent); }

/* ── 7. Icon rail ── */
.icon-rail {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
}

.icon-rail-btn {
  color: var(--text-muted);
  border-radius: 12px;
  transition: all 0.2s var(--ftc-ease);
}

.icon-rail-btn:hover {
  background: var(--surface);
  color: var(--accent);
}

.rail-separator { background: var(--border); }

/* ── 8. Modals ── */
.modal {
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(8px);
}

.modal-header { border-bottom: 1px solid var(--border); }

.modal-header h4 { color: var(--text); }

.close-btn {
  color: var(--text-muted);
  background: transparent;
  border-radius: 8px;
}

.close-btn:hover {
  color: var(--text);
  background: var(--surface);
}

/* ── 9. Tabs ── */
.admin-tabs,
.memory-tabs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px;
}

.admin-tab,
.memory-tab {
  color: var(--text-muted);
  border-radius: 100px;
  transition: all 0.25s var(--ftc-ease);
}

.admin-tab.active,
.memory-tab.active {
  background: var(--gradient-1);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.admin-tab:hover,
.memory-tab:hover { color: var(--text); }

/* ── 10. Cards & content ── */
.admin-card h2 { color: var(--text); }

.admin-card p,
.memory-desc,
.doclib-desc { color: var(--text-muted); }

/* ── 11. User bar ── */
.sidebar-user-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.user-bar-name { color: var(--text); }

.user-bar-btn {
  color: var(--text-muted);
  border-radius: 10px;
}

.user-bar-btn:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

/* ── 12. Dropdowns ── */
.dropdown,
.sort-dropdown,
.memory-sort-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.dropdown-item,
.sort-dropdown-item,
.memory-sort-menu [role="option"] {
  color: var(--text-muted);
  transition: all 0.15s var(--ftc-ease);
}

.dropdown-item:hover,
.sort-dropdown-item:hover,
.memory-sort-menu [role="option"]:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ── 13. Badges ── */
.incognito-indicator {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.incognito-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 100px;
}

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

/* ── 14. Loading overlay ── */
#app-loader { background: var(--bg); }
#loader-wave { color: var(--accent); }
