/* ═══════════════════════════════════════════════════════
   Happy-AI Interview Dashboard — Design System
   Premium Dark Theme with Glassmorphism
   ═══════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ────────────────────────────── */
:root {
  /* Colors */
  --bg-base: #06060f;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.10);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.16);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --color-primary: #667eea;
  --color-primary-dim: rgba(102, 126, 234, 0.15);
  --color-success: #10b981;
  --color-success-dim: rgba(16, 185, 129, 0.15);
  --color-error: #ef4444;
  --color-error-dim: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b;
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.35);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 300px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(102, 126, 234, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(118, 75, 162, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── App Container ────────────────────────────────────── */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Header ───────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(6, 6, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.btn-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: 1.1rem;
}

.btn-back:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.btn-back.visible {
  display: flex;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.logo-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ── Views ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-top: var(--header-height);
}

.view {
  display: none;
  animation: fadeIn var(--duration-normal) var(--ease-out);
  padding-top: var(--header-height);
}

.view.active {
  display: block;
}

/* ── Dashboard View ───────────────────────────────────── */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}

.dashboard-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.dashboard-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Department Cards Grid ────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.dept-card {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
  animation: slideUp var(--duration-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--card-index, 0) * 80ms);
}

.dept-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  z-index: 0;
}

.dept-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.dept-card:hover::before {
  opacity: 0.05;
}

.dept-card:active {
  transform: translateY(-2px);
}

.dept-card>* {
  position: relative;
  z-index: 1;
}

.dept-card .icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.dept-card .dept-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.dept-card .dept-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.completed {
  background: var(--color-success-dim);
  color: var(--color-success);
}

.status-badge.available {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}

.dept-card.completed {
  opacity: 0.7;
}

.dept-card.completed:hover {
  opacity: 0.85;
}

/* ── Interview View ───────────────────────────────────── */
.interview-container {
  display: flex;
  height: calc(100vh - var(--header-height));
}

/* ── Interview Sidebar ────────────────────────────────── */
.interview-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  overflow-y: auto;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar-section-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-dept-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-interviewer {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ── Progress Phases ──────────────────────────────────── */
.progress-phases {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.progress-phase {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--duration-normal) var(--ease-out);
}

.progress-phase.active {
  background: var(--color-primary-dim);
  border-color: rgba(102, 126, 234, 0.2);
}

.progress-phase.completed {
  opacity: 0.6;
}

.progress-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-phase-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.phase-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.progress-phase.active .phase-letter {
  background: var(--gradient-primary);
  border: none;
  color: white;
}

.progress-phase.completed .phase-letter {
  background: var(--color-success);
  border: none;
  color: white;
}

.phase-percent {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.progress-bar-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gradient-primary);
  transition: width var(--duration-slow) var(--ease-out);
  position: relative;
}

.progress-phase.active .progress-bar-fill {
  animation: pulse 2s ease-in-out infinite;
}

/* Current Process Indicator */
.current-process {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.current-process-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.current-process-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-primary);
}

/* Finalize Button */
.btn-finalize {
  margin-top: auto;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-finalize:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.btn-finalize:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-finalize::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.btn-finalize:hover:not(:disabled)::after {
  opacity: 1;
}

/* ── Chat Area ────────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  scroll-behavior: smooth;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Messages ─────────────────────────────────────────── */
.message {
  display: flex;
  gap: var(--space-md);
  max-width: 85%;
  animation: slideUp var(--duration-normal) var(--ease-out);
}

.message.ai {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.message.ai .message-avatar {
  background: var(--gradient-primary);
  color: white;
}

.message.user .message-avatar {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.message-bubble {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  line-height: 1.65;
  font-size: var(--font-size-base);
}

.message.ai .message-bubble {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-left: 3px solid;
  border-image: var(--gradient-primary) 1;
}

.message.user .message-bubble {
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Markdown in messages */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.message-bubble h1 {
  font-size: var(--font-size-xl);
}

.message-bubble h2 {
  font-size: var(--font-size-lg);
}

.message-bubble h3 {
  font-size: var(--font-size-base);
}

.message-bubble p {
  margin-bottom: var(--space-sm);
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-bubble em {
  color: var(--text-secondary);
}

.message-bubble ul,
.message-bubble ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.message-bubble li {
  margin-bottom: var(--space-xs);
}

.message-bubble code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.message-bubble pre {
  background: rgba(0, 0, 0, 0.3);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: var(--space-sm) 0;
}

.message-bubble pre code {
  background: none;
  padding: 0;
}

.message-bubble hr {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: var(--space-md) 0;
}

/* ── Typing Indicator ─────────────────────────────────── */
.typing-indicator {
  display: none;
  align-self: flex-start;
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-md);
}

.typing-indicator.visible {
  display: flex;
}

.typing-indicator .message-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: white;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* ── Input Area ───────────────────────────────────────── */
.input-area {
  padding: var(--space-md) var(--space-xl) var(--space-xl);
  background: linear-gradient(to top, var(--bg-base) 0%, transparent 100%);
}

.input-wrapper {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  transition: border-color var(--duration-normal) var(--ease-out);
}

.input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-dim);
}

.input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  padding: var(--space-sm) var(--space-md);
  resize: none;
  max-height: 150px;
  min-height: 24px;
}

.input-wrapper textarea::placeholder {
  color: var(--text-tertiary);
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--duration-normal) var(--ease-out);
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

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

.modal {
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-elevated);
  animation: slideUp var(--duration-normal) var(--ease-spring);
}

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

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-glass);
}

/* SOP Preview */
.sop-preview {
  color: var(--text-primary);
  line-height: 1.7;
}

.sop-preview h1 {
  font-size: var(--font-size-2xl);
  margin: var(--space-xl) 0 var(--space-md);
}

.sop-preview h2 {
  font-size: var(--font-size-xl);
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--color-primary);
}

.sop-preview h3 {
  font-size: var(--font-size-lg);
  margin: var(--space-md) 0 var(--space-sm);
}

.sop-preview p {
  margin-bottom: var(--space-md);
}

.sop-preview ul,
.sop-preview ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.sop-preview li {
  margin-bottom: var(--space-xs);
}

.sop-preview strong {
  color: var(--text-primary);
}

.sop-category {
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.sop-category-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-glass);
}

.sop-process {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border-left: 3px solid;
  border-image: var(--gradient-primary) 1;
}

.sop-process-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

/* ── Name Prompt Overlay ──────────────────────────────── */
.name-prompt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.name-prompt-overlay.active {
  display: flex;
}

.name-prompt-modal {
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-elevated);
  animation: slideUp var(--duration-normal) var(--ease-spring);
}

.name-prompt-modal h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.name-prompt-modal p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.name-prompt-modal input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
  margin-bottom: var(--space-lg);
}

.name-prompt-modal input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-dim);
}

.name-prompt-modal input::placeholder {
  color: var(--text-tertiary);
}

.name-prompt-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* ── Sidebar Header & Additional Selectors ────────────── */
.sidebar-header {
  margin-bottom: var(--space-md);
}

.dept-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.dept-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.interviewer-name {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-md);
}

/* Message selectors matching HTML */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.message.ai .avatar {
  background: var(--gradient-primary);
  color: white;
}

.message.user .avatar {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.message-content {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  line-height: 1.65;
  font-size: var(--font-size-base);
}

.message.ai .message-content {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-left: 3px solid;
  border-image: var(--gradient-primary) 1;
}

.message.user .message-content {
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.timestamp {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  padding: 0 var(--space-lg);
}

/* Phase header matching HTML */
.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phase-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Progress bar (also used in HTML) */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: var(--space-xs);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gradient-primary);
  transition: width var(--duration-slow) var(--ease-out);
}

/* Completed overlay for cards */
.completed-overlay {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
}

/* Badge dot */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Typing indicator matching HTML */
.typing-indicator .avatar {
  background: var(--gradient-primary);
  color: white;
}

.typing-indicator .typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  display: inline-block;
  animation: bounce 1.4s ease-in-out infinite;
}

.typing-indicator .typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator .typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing-indicator {
  display: flex;
  align-self: flex-start;
  gap: var(--space-md);
  animation: slideUp var(--duration-normal) var(--ease-out);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn-secondary:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

/* ── Toast Notifications ──────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-xl);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideInRight var(--duration-normal) var(--ease-spring);
  min-width: 280px;
  box-shadow: var(--shadow-elevated);
}

.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.toast.error {
  background: var(--color-error-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.toast.info {
  background: var(--color-primary-dim);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: var(--color-primary);
}

.toast-exit {
  animation: slideOutRight var(--duration-normal) var(--ease-out) forwards;
}

/* ── Loading Spinner ──────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-6px);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

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

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .interview-container {
    flex-direction: column;
  }

  .interview-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
    flex-direction: row;
    flex-wrap: wrap;
    padding: var(--space-md);
    gap: var(--space-md);
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }

  .sidebar-section {
    flex: 1;
    min-width: 150px;
  }

  .progress-phases {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .progress-phase {
    flex: 1;
    min-width: 120px;
  }

  .btn-finalize {
    margin-top: 0;
  }

  :root {
    --sidebar-width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard {
    padding: var(--space-xl) var(--space-md);
  }

  .dept-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-title {
    font-size: var(--font-size-2xl);
  }

  .message {
    max-width: 95%;
  }

  .header {
    padding: 0 var(--space-md);
  }

  .logo-subtitle {
    display: none;
  }

  .modal {
    margin: var(--space-md);
    max-height: 90vh;
  }
}