@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root, [data-theme="dark"] {
  --bg: #06080f;
  --bg-card: rgba(14, 19, 32, 0.85);
  --bg-sidebar: rgba(10, 14, 24, 0.95);
  --border: rgba(255, 255, 255, 0.07);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  --radius: 12px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, sans-serif;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.glass-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; backdrop-filter: blur(16px);
}

/* Auth Gate */
.auth-gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card { width: min(100%, 400px); text-align: center; }
.auth-card h1 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; }
.auth-card p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.9rem; }
.back-link { display: inline-block; margin-top: 20px; color: var(--text-muted); font-size: 0.85rem; }
.back-link:hover { color: var(--accent); }

/* Dashboard Layout */
.dashboard { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 24px 16px; position: fixed;
  top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 10;
}
.sidebar-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 28px; padding: 0 8px;
}
.sidebar-logo span { color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left; padding: 10px 12px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-item:hover { background: rgba(99,102,241,0.08); color: var(--text); }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--accent); font-weight: 600; }
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.dashboard-main { flex: 1; margin-left: 240px; padding: 24px 32px; }
.dashboard-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 32px; flex-wrap: wrap;
}
.dashboard-header h1 { font-family: var(--font-display); font-size: 1.5rem; }
.dashboard-header p { color: var(--text-secondary); font-size: 0.9rem; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  color: var(--text); font-size: 0.9rem; font-family: inherit;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
textarea.form-control { resize: vertical; }
.code-input { font-family: 'Consolas', 'Monaco', monospace; font-size: 0.82rem; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.form-error { color: #ef4444; font-size: 0.85rem; margin-bottom: 12px; }
.section-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; font-weight: 600;
  font-size: 0.85rem; transition: all 0.25s; border: none; cursor: pointer;
}
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); background: rgba(99,102,241,0.06); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.import-label { cursor: pointer; }

/* Edit Sections */
.edit-section { display: none; }
.edit-section.active { display: block; }
.edit-section h2 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 20px; }
.edit-section h3 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 12px; }

/* Item Cards */
.item-card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 12px;
}
.item-card .form-grid { margin-bottom: 0; }
.item-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.item-card-header h4 { font-size: 0.9rem; color: var(--text-secondary); }
.remove-btn {
  color: #ef4444; font-size: 0.8rem; padding: 4px 8px; border-radius: 6px;
  border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.08);
}
.remove-btn:hover { background: rgba(239,68,68,0.15); }

.resume-actions-panel { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Profile image upload */
.profile-upload-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.profile-upload-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 16px;
}
.profile-upload-layout {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.profile-preview-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(99,102,241,0.35);
  box-shadow: 0 0 24px rgba(99,102,241,0.15);
  flex-shrink: 0;
}
.profile-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.upload-label { cursor: pointer; }
.profile-upload-status {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 100; }
.toast {
  background: var(--bg-card); border: 1px solid var(--accent); color: var(--text);
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 0.85rem;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(60px); opacity: 0; transition: all 0.35s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { color: #06b6d4; }

@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; border-right: none; border-bottom: 1px solid var(--border); }
  .dashboard { flex-direction: column; }
  .dashboard-main { margin-left: 0; padding: 16px; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}
