:root {
  /* Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #f43f5e;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Priority Colors */
  --priority-high: #fee2e2;
  --priority-high-text: #991b1b;
  --priority-med: #ffedd5;
  --priority-med-text: #9a3412;
  --priority-low: #f0f9ff;
  --priority-low-text: #075985;

  /* Neutral & Surfaces */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  --grad-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

  /* Common */
  --radius-md: 12px;
  --radius-lg: 20px;
  --blur-md: blur(12px);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* View Switching */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-main h1 {
  font-size: 2.25rem;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.25rem;
}

.header-main p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.minimal-button {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-weight: 500;
}

.minimal-button:hover {
  background: var(--bg-main);
  color: var(--primary);
  border-color: var(--primary);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* Score Visuals */
.score-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.section-title i {
  color: var(--primary);
  font-size: 1.1rem;
}

.circular-progress-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: 1rem;
}

.circular-progress-container svg {
  transform: rotate(-90deg);
}

.circular-progress-container .bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.circular-progress-container .prog {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 2s ease-out;
}

.score-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Outfit';
  font-weight: 800;
  font-size: 2.5rem;
}

/* Pillar Mini Bars */
.pillar-metrics {
  width: 100%;
  margin-top: 1rem;
}

.metric {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-align: left;
}

.mini-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.mini-bar div {
  height: 100%;
  background: var(--grad-primary);
  width: 0;
  transition: width 1.5s ease-out;
}

/* Gap Stack */
.gap-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gap-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--secondary);
  animation: slideIn 0.4s ease-out forwards;
  opacity: 0;
}

.priority-high {
  background: var(--priority-high);
  border-left-color: var(--danger);
  color: var(--priority-high-text);
}

.priority-medium {
  background: var(--priority-med);
  border-left-color: var(--warning);
  color: var(--priority-med-text);
}

.priority-low {
  background: var(--priority-low);
  border-left-color: var(--primary);
  color: var(--priority-low-text);
}

/* Buttons */
.accent-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

.accent-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.accent-button:disabled {
  background: var(--secondary);
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

/* Impact Audit Stack */
.audit-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.audit-item {
  padding: 1.2rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  animation: slideIn 0.4s ease-out forwards;
  opacity: 0;
}

.audit-original {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.audit-issue {
  color: var(--danger);
  font-weight: 600;
  margin: 0.4rem 0;
  font-size: 0.85rem;
}

.audit-suggestion {
  color: var(--success);
  font-weight: 500;
}

/* Optimization Center (Revised View) */
.revision-panel {
  margin-top: 2rem;
  border: 2px solid var(--primary);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#revised-resume-text {
  width: 100%;
  min-height: 400px;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: none;
  line-height: 1.4;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}