/* Portfolio AI Companion - Core Design System */

:root {
  --bg-base: #020617;
  --bg-surface: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0b1329;
  
  --border-subtle: #334155;
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --emerald-500: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.15);
  --amber-500: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --ruby-500: #ef4444;
  --ruby-glow: rgba(239, 68, 68, 0.15);
  --cyan-500: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { font-size: 0.9rem; color: var(--text-secondary); }

/* Common UI Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green {
  background: var(--emerald-glow);
  color: var(--emerald-500);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-amber {
  background: var(--amber-glow);
  color: var(--amber-500);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  background: var(--ruby-glow);
  color: var(--ruby-500);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-cyan {
  background: var(--cyan-glow);
  color: var(--cyan-500);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--emerald-500);
  color: #020617;
  font-weight: 700;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

/* Privacy Toggle Button */
.privacy-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.privacy-toggle-btn:hover,
.privacy-toggle-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.privacy-toggle-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
}

/* Progress and Split Bars */
.progress-bar-container {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.passcode-input {
  width: 100%;
  padding: 12px;
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.2em;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  margin: 16px 0;
}

.passcode-input:focus {
  outline: none;
  border-color: var(--emerald-500);
}

/* Forms */
.form-group {
  margin-bottom: 12px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--emerald-500);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--emerald-500);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease-out;
}

.toast.toast-error {
  border-left-color: var(--ruby-500);
}

.toast.toast-warning {
  border-left-color: var(--amber-500);
}

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