/* ═══════════════════════════════════════════════════════════
   AI Resume Analyzer — Global Styles
   Theme: Dark editorial with amber/gold accents
   Font: DM Serif Display + DM Sans
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #0a0a0b;
  --bg-2:        #111113;
  --bg-3:        #18181c;
  --border:      #2a2a30;
  --border-2:    #3a3a42;
  --text:        #e8e8ec;
  --text-2:      #9a9aaa;
  --text-3:      #5a5a6a;
  --gold:        #d4a843;
  --gold-2:      #f0c060;
  --gold-dim:    rgba(212, 168, 67, 0.12);
  --gold-glow:   rgba(212, 168, 67, 0.25);
  --green:       #4caf7d;
  --red:         #e05c5c;
  --blue:        #5b9cf6;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3 { font-family: 'DM Serif Display', serif; line-height: 1.2; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #0a0a0b;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--gold-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-primary:active { transform: translateY(0); }

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Form elements ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 140px; }

/* ── Toast ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  font-size: 0.9rem;
}
.toast.hiding { animation: toastOut 0.25s ease forwards; }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; color: var(--text); }

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--gold); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(32px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

/* ── Noise texture overlay ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Loading spinner ───────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(212,168,67,0.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pill / badge ──────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pill-gold   { background: var(--gold-dim); color: var(--gold-2); border: 1px solid rgba(212,168,67,0.3); }
.pill-green  { background: rgba(76,175,125,0.1); color: var(--green); border: 1px solid rgba(76,175,125,0.25); }
.pill-red    { background: rgba(224,92,92,0.1);  color: var(--red);   border: 1px solid rgba(224,92,92,0.25); }
