/* ==========================================================================
   ATS CV OPTIMIZER — GUPY-INSPIRED DESIGN SYSTEM v3.0
   Dark Corporate: Midnight Navy · Cobalt Blue · Inter Typography
   ========================================================================== */

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

/* ── CARD ENTRANCE ANIMATION ── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  animation: cardIn 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* Stagger via sibling selectors */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.33s; }
.card:nth-child(6) { animation-delay: 0.40s; }


/* ── DESIGN TOKENS ── */
:root {
  /* Backgrounds */
  --bg-main:     #010B21;
  --bg-nav:      #020e28;
  --bg-surface:  #061535;
  --bg-card:     #0A1F3C;
  --bg-card-alt: #0d2347;
  --bg-input:    #061535;
  --bg-hover:    #102855;

  /* Brand Colors */
  --color-primary:   #2563EB;   /* Blue 600 — main action */
  --color-primary-h: #1D4ED8;   /* Blue 700 — hover */
  --color-accent:    #60A5FA;   /* Blue 400 — accents */
  --color-cobalt:    #003CFD;   /* Gupy cobalt */

  /* Semantic */
  --color-success: #10B981;
  --color-danger:  #EF4444;
  --color-warning: #F59E0B;
  --color-info:    #38BDF8;
  --color-ai:      #818CF8;    /* Indigo for AI elements */
  --color-ai-h:    #A5B4FC;    /* Indigo lighter */

  /* Typography */
  --color-text-main:    #F1F5F9;
  --color-text-body:    #CBD5E1;
  --color-text-muted:   #64748B;
  --color-text-subtle:  #94A3B8;

  /* Borders */
  --border-color:       rgba(255, 255, 255, 0.07);
  --border-color-md:    rgba(255, 255, 255, 0.12);
  --border-focus:       rgba(37, 99, 235, 0.6);
  --border-focus-glow:  rgba(37, 99, 235, 0.2);

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-blue:  0 4px 20px rgba(37, 99, 235, 0.25);
  --shadow-ai:    0 4px 20px rgba(129, 140, 248, 0.2);

  /* Radius */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-pill: 999px;

  /* Typography */
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code:  'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 80% 40% at 20% -10%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 110%, rgba(0, 60, 253, 0.06) 0%, transparent 55%);
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── HEADER / NAVBAR ── */
header {
  background: rgba(1, 11, 33, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 5%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

header.scrolled {
  background: rgba(1, 11, 33, 0.98);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), var(--shadow-md);
}

/* Logo */
.logo-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-symbol {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

header:hover .logo-symbol {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
}

.logo-main h1 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--color-text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-main .divider {
  color: var(--border-color-md);
  font-weight: 300;
}

.logo-main .logo-sub {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Status Hub */
.system-status-hub {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  transition: background var(--transition-fast);
}

.status-indicator:hover {
  background: rgba(255,255,255,0.07);
}

.status-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-led-green {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  animation: led-breathe 2.5s ease-in-out infinite;
}

.status-led-purple {
  background: var(--color-ai);
  box-shadow: 0 0 6px rgba(129, 140, 248, 0.7);
  animation: led-breathe 3s ease-in-out infinite;
}

@keyframes led-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* API Key badge */
.header-api-key {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.8rem;
}

.header-api-key label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.header-api-key input {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-code);
  font-size: 0.72rem;
  width: 140px;
  outline: none;
}

/* ── MAIN LAYOUT ── */
main {
  max-width: 1700px;
  margin: 0 auto;
  padding: 2rem 5%;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}

.card-ai {
  border-color: rgba(129, 140, 248, 0.15);
  background: linear-gradient(160deg, #0A1F3C 0%, #0d1f42 100%);
}

.card-ai:hover {
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(129,140,248,0.12), var(--shadow-ai);
}

/* ── SECTION TITLES ── */
.section-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* ── LABELS & INPUTS ── */
label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-subtle);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

.input-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group:last-child { margin-bottom: 0; }

textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color-md);
  border-radius: var(--radius-md);
  color: var(--color-text-body);
  font-family: var(--font-code);
  font-size: 0.8rem;
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 160px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
  width: 100%;
  line-height: 1.7;
}

textarea:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px var(--border-focus-glow);
}

textarea::placeholder {
  color: var(--color-text-muted);
  font-style: normal;
}

select {
  background: var(--bg-input);
  border: 1px solid var(--border-color-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  cursor: pointer;
}

select:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px var(--border-focus-glow);
}

/* ── BUTTONS ── */
button {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* Primary AI button */
.btn-ai {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.25rem;
  height: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(37,99,235,0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  letter-spacing: 0.01em;
}

.btn-ai::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  border-radius: inherit;
  pointer-events: none;
}

.btn-ai:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 6px 20px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

.btn-ai:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-ai:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary button */
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--color-text-body);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  height: 38px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color-md);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: var(--color-text-main);
}

/* PDF Primary button */
.btn-pdf-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow-blue);
  position: relative;
  overflow: hidden;
}

.btn-pdf-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  border-radius: inherit;
  pointer-events: none;
}

.btn-pdf-primary:hover {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37,99,235,0.45);
}

/* Shimmer effect on primary buttons */
.btn-ai::after,
.btn-pdf-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: skewX(-15deg);
  pointer-events: none;
}

.btn-ai:hover::after,
.btn-pdf-primary:hover::after {
  animation: shimmer 0.6s ease forwards;
}

@keyframes shimmer {
  to { left: 160%; }
}

/* Generic button (non-classified) */
button:not(.btn-ai):not(.btn-secondary):not(.btn-pdf-primary):not(.btn-setting-toggle):not(.btn-setting-color):not(.btn-diff-apply):not(.btn-diff-fallback):not(.modal-close):not(.pdf-modal-close) {
  background: rgba(255,255,255,0.06);
  color: var(--color-text-body);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color-md);
  height: 38px;
}

button:not(.btn-ai):not(.btn-secondary):not(.btn-pdf-primary):not(.btn-setting-toggle):not(.btn-setting-color):not(.btn-diff-apply):not(.btn-diff-fallback):not(.modal-close):not(.pdf-modal-close):hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
  background: rgba(37, 99, 235, 0.03);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.dropzone-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.dropzone-text {
  font-size: 0.8rem;
  color: var(--color-text-body);
  font-weight: 500;
}

.dropzone-sub {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ── METRICS ── */
.metrics-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}

.score-radial {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.15);
  position: relative;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.score-radial:hover {
  background: rgba(37, 99, 235, 0.09);
  border-color: rgba(37, 99, 235, 0.25);
}

.circle-svg {
  width: 110px;
  height: 110px;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 7;
}

.circle-progress {
  fill: none;
  stroke: #2563EB;
  stroke-width: 7;
  stroke-dasharray: 282.74;
  stroke-dashoffset: 282.74;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s;
  transform: rotate(-90deg);
  transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.5));
}

.score-text {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  fill: var(--color-text-main);
  letter-spacing: -0.02em;
}

.score-title {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.score-badge {
  margin-top: 0.4rem;
  font-size: 0.6rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-low {
  background: rgba(239, 68, 68, 0.1);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-mid {
  background: rgba(245, 158, 11, 0.1);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-high {
  background: rgba(16, 185, 129, 0.1);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.metrics-details {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.metric-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.metric-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateX(2px);
}

.metric-card .title {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--color-text-subtle);
  font-family: var(--font-body);
}

.metric-card .value {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
}

/* ── SKILLS / COMPETENCY TAGS ── */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: border-color var(--transition-fast);
}

.category-block:hover {
  border-color: rgba(37, 99, 235, 0.15);
}

.category-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Skill Tags */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.skill-tag-found {
  background: rgba(16, 185, 129, 0.1);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.2);
}

.skill-tag-found:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.skill-tag-missing {
  background: rgba(239, 68, 68, 0.08);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.2);
  border-style: dashed;
}

.skill-tag-missing:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.skill-tag-desirable {
  background: rgba(96, 165, 250, 0.08);
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.2);
}

.skill-tag-desirable.missing {
  background: rgba(239, 68, 68, 0.06);
  color: #FCA5A5;
  border-color: rgba(239, 68, 68, 0.15);
  border-style: dashed;
}

/* ── INTEGRATION FOR APP.JS TAGS & TOOLTIPS ── */
.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  position: relative;
  cursor: help;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  user-select: none;
}

.tag-found {
  background: rgba(16, 185, 129, 0.1);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.2);
}

.tag-found:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.tag-missing {
  background: rgba(239, 68, 68, 0.08);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.25);
  border-style: dashed;
}

.tag-missing:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.tag-obrigatoria {
  border-color: rgba(245, 158, 11, 0.3);
}

.tag-desejavel {
  border-color: rgba(56, 189, 248, 0.3);
}

/* Tooltip text hidden by default, shown on hover */
.tag .tooltip-text {
  visibility: hidden;
  width: 240px;
  background-color: var(--bg-surface);
  color: var(--color-text-body);
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.7rem;
  line-height: 1.4;
  font-weight: 500;
  
  /* Position the tooltip */
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.tag:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Tooltip arrow */
.tag .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--bg-surface) transparent transparent transparent;
}

/* ── ALERT SYSTEM ── */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 0.78rem;
  line-height: 1.5;
  animation: alertSlideIn 0.3s ease both;
  transition: transform var(--transition-fast);
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.alert-item:hover {
  transform: translateX(2px);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.07);
  border-left-color: var(--color-warning);
  color: var(--color-text-body);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.07);
  border-left-color: var(--color-danger);
  color: var(--color-text-body);
}

.alert-info {
  background: rgba(56, 189, 248, 0.07);
  border-left-color: var(--color-info);
  color: var(--color-text-body);
}

.alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-text strong {
  display: block;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}

.alert-text p {
  color: var(--color-text-subtle);
  font-size: 0.74rem;
}

/* ── AI PANEL ── */
.spinner-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
}

.spinner-overlay.active { display: flex; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(37, 99, 235, 0.15);
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.ai-output-wrapper {
  min-height: 140px;
  position: relative;
}

.ai-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed rgba(129, 140, 248, 0.2);
  border-radius: var(--radius-md);
  background: rgba(129, 140, 248, 0.03);
}

.ai-icon {
  font-size: 2rem;
  line-height: 1;
  filter: grayscale(0.3);
}

.ai-placeholder p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 360px;
}

.ai-placeholder p strong {
  color: var(--color-ai-h);
  font-weight: 600;
}

#ai-content {
  font-size: 0.82rem;
  color: var(--color-text-body);
  line-height: 1.7;
}

#ai-content h1, #ai-content h2, #ai-content h3 {
  color: var(--color-text-main);
  font-weight: 700;
  margin: 0.8rem 0 0.4rem;
  font-size: 0.88rem;
}

#ai-content ul {
  padding-left: 1.1rem;
  margin: 0.4rem 0;
}

#ai-content li { margin-bottom: 0.25rem; }

#ai-content strong {
  color: var(--color-accent);
  font-weight: 600;
}

/* AI Summary Box */
#ai-summary-box {
  background: rgba(129, 140, 248, 0.07);
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-body);
  line-height: 1.6;
}

/* ── MODALS ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 11, 33, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.modal-close, .pdf-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
}

.modal-close:hover, .pdf-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* ── PDF MODAL ── */
.modal-pdf {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 11, 33, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: stretch;
  flex-direction: column;
}

.modal-pdf.active { display: flex; }

.modal-pdf-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-nav);
  flex-shrink: 0;
}

.pdf-modal-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* PDF Style Selector */
.pdf-style-selector {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-x: auto;
}

.pdf-style-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color-md);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.pdf-style-card:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}

.pdf-style-card.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--color-accent);
}

.pdf-style-icon { font-size: 0.95rem; }

.pdf-style-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-body);
}

.pdf-style-desc {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.pdf-style-card.active .pdf-style-label { color: var(--color-accent); }

/* PDF Preview Body */
.pdf-preview-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.pdf-preview-frame-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #2D3748;
  position: relative;
  overflow: hidden;
}

.pdf-preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.85rem;
  background: rgba(0,0,0,0.3);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

.pdf-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(1, 11, 33, 0.8);
  z-index: 2;
}

.pdf-preview-loading.hidden { display: none; }

#pdf-preview-iframe {
  flex: 1;
  width: 100%;
  border: none;
  height: calc(100% - 32px);
}

/* PDF Sidebar */
.pdf-sidebar {
  width: 300px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 0;
  flex-shrink: 0;
}

.pdf-sidebar-card {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.pdf-sidebar-card:last-child { border-bottom: none; }

.pdf-sidebar-card:hover {
  background: rgba(37,99,235,0.04);
}

.pdf-sidebar-card h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pdf-sidebar-card p {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* PDF Setting Buttons */
.pdf-settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdf-setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pdf-setting-item label {
  font-size: 0.68rem;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.btn-setting-toggle {
  padding: 0.3rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color-md);
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  line-height: 1;
}

.btn-setting-toggle:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--color-accent);
}

.btn-setting-toggle.active {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--color-accent);
}

.btn-setting-color {
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-setting-color:hover {
  transform: scale(1.15);
}

.btn-setting-color.active {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pdf-setting-tip {
  font-size: 0.64rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.pdf-setting-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: 0.78rem;
  padding: 0.45rem 0.7rem;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.pdf-setting-select:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px var(--border-focus-glow);
}

/* PDF Actions Bar */
.pdf-actions-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-nav);
  flex-shrink: 0;
}

/* Lacunas / Vagas */
.lacunas-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.lacuna-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--color-text-body);
  padding: 0.3rem 0;
}

.vagas-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.vaga-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: 0.74rem;
  transition: all var(--transition-fast);
}

.vaga-card:hover {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.2);
}

/* ── LIVE EDITOR CONTAINER ── */
.live-editor-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.controls-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── SCORE STATUS ── */
#score-status {
  margin-top: 0.4rem;
}

/* ── DIFF / SUGGESTIONS ── */
.diff-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  line-height: 1.6;
}

.diff-original {
  background: rgba(239, 68, 68, 0.07);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.6rem;
  color: #FCA5A5;
  text-decoration: line-through;
  font-family: var(--font-code);
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
}

.diff-new {
  background: rgba(16, 185, 129, 0.07);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.6rem;
  color: #6EE7B7;
  font-family: var(--font-code);
  font-size: 0.75rem;
}

.btn-diff-apply {
  background: linear-gradient(135deg, var(--color-ai), #2563EB);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-diff-apply:hover {
  background: linear-gradient(135deg, #A5B4FC, #3B82F6);
  transform: translateY(-1px);
}

.btn-diff-apply:disabled {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  cursor: not-allowed;
  transform: none;
}

.btn-diff-fallback {
  background: rgba(255,255,255,0.05);
  color: var(--color-text-body);
  border: 1px solid var(--border-color-md);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-diff-fallback:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
}

/* ── MODAL OPTION CARDS ── */
.modal-option-card {
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.modal-option-card:hover {
  border-color: rgba(37, 99, 235, 0.3) !important;
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3); /* Translucent Indigo */
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

/* ── SELECTION ── */
::selection {
  background: rgba(37, 99, 235, 0.3);
  color: var(--color-text-main);
}

/* ── MISC UTILITIES ── */
.hidden { display: none !important; }

/* ── FOCUS VISIBLE (Accessibility) ── */
:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.8);
  outline-offset: 2px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header {
    padding: 0 1rem;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    gap: 0.75rem;
  }

  .system-status-hub { display: none; }

  main { padding: 1.25rem 1rem; }

  .app-grid { gap: 1rem; }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .score-radial { flex-direction: row; }

  .card {
    padding: 1rem;
  }

  .section-title {
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
  }

  /* PDF Preview Modal Split View on Mobile */
  .pdf-preview-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .pdf-preview-frame-wrapper {
    flex: none;
    height: 45vh;
    border-bottom: 1px solid var(--border-color-md);
  }

  .pdf-sidebar {
    width: 100%;
    border-left: none;
    flex: none;
    overflow-y: visible;
  }

  .pdf-actions-bar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pdf-actions-bar button {
    flex: 1;
  }
}

@media (max-width: 600px) {
  .controls-row button {
    flex-grow: 1;
  }
}

@media (max-width: 500px) {
  .user-status-hub {
    width: 100%;
    justify-content: space-between;
    margin-right: 0;
    padding: 0.2rem 0.5rem;
  }

  .user-email {
    max-width: 110px;
    font-size: 0.68rem;
  }

  .token-balance-display {
    font-size: 0.68rem !important;
    padding: 0.2rem 0.5rem !important;
    height: 26px !important;
  }
}

/* ==========================================================================
   PREMIUM LIBRARIES INTEGRATION — v3.0
   GSAP · Particles · AOS · Tippy · Splitting
   ========================================================================== */

/* Z-index layers */
#particles-js { z-index: 0; pointer-events: none; }
header, main, .modal, .modal-pdf { position: relative; z-index: 1; }

/* Splitting.js char animation */
.char-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  animation: charReveal 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes charReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Tippy.js custom theme */
.tippy-box[data-theme~='ats'] {
  background: rgba(6, 21, 53, 0.98);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(37,99,235,0.1);
  backdrop-filter: blur(10px);
}

.tippy-box[data-theme~='ats'] .tippy-content {
  padding: 0.4rem 0.7rem;
}

.tippy-box[data-theme~='ats'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: rgba(37, 99, 235, 0.5);
}
.tippy-box[data-theme~='ats'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: rgba(37, 99, 235, 0.5);
}

/* AOS smooth */
[data-aos] {
  transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* Background gradient orbs */
body::before {
  content: '';
  position: fixed;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: 0;
  animation: orbDrift1 20s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 60, 253, 0.04) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  pointer-events: none;
  z-index: 0;
  animation: orbDrift2 25s ease-in-out infinite alternate;
}

@keyframes orbDrift1 {
  from { transform: translate(0, 0); }
  to   { transform: translate(-60px, 80px); }
}

@keyframes orbDrift2 {
  from { transform: translate(0, 0); }
  to   { transform: translate(50px, -60px); }
}

/* ==========================================================================
   SUPABASE INTEGRATION STYLES (AUTH & HISTORY)
   ========================================================================== */

/* User Status Hub in Header */
.user-status-hub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.8rem;
  margin-right: 0.5rem;
}

.user-email {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-success);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auth Modal Overlay */
.modal-auth {
  position: fixed;
  inset: 0;
  background: rgba(1, 11, 33, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-auth-content {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, #061535 0%, #0A1F3C 100%);
  border: 1px solid var(--border-color-md);
  border-radius: var(--radius-lg);
  padding: 2rem !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(37,99,235,0.15);
  transform: translateY(0);
  animation: slideUp 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-auth-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-auth-header .logo-main {
  justify-content: center;
}

.auth-section-key {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
}

.input-helper code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--color-accent);
  font-family: var(--font-code);
}

.auth-tab-btn {
  transition: all var(--transition-fast);
}

.auth-tab-btn:hover {
  color: #fff !important;
}

.auth-tab-btn.active {
  color: #fff !important;
  border-bottom-color: var(--color-accent) !important;
}

/* Auth Status Message Alert */
.auth-status-msg {
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.auth-status-msg.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--color-success);
  color: #34d399;
}

.auth-status-msg.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--color-danger);
  color: #f87171;
}

/* History Card & Item Styles */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.history-item:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateX(2px);
}

.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-date {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.history-item-score {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.history-item-score.score-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.history-item-score.score-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.history-item-score.score-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.history-item-delete {
  background: none !important;
  border: none !important;
  color: var(--color-text-muted) !important;
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
}

.history-item-delete:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
}

/* Toast Notification for Cache Hit */
.cache-hit-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.8rem;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1), toastFadeOut 0.35s 3.5s forwards;
  pointer-events: none;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

