* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #64748B;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --background: #F8FAFC;
  --surface: #FFFFFF;
  --text: #1E293B;
  --text-light: #64748B;
  --border: #E2E8F0;
  --gold: #FCD34D;
  --good: #86EFAC;
  --surface-quality: #F1F5F9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-box {
  background: var(--background);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.info-box h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.info-box ul {
  list-style-position: inside;
  color: var(--text-light);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  width: 100%;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.button-group .btn {
  flex: 1;
}

/* Interview Screen */
.interview-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 2rem;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  transition: width 0.3s ease;
  width: 0%;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Framework Grid */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.framework-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.framework-item.incomplete {
  opacity: 0.5;
  background: var(--surface);
}

.framework-item.partial {
  border-color: var(--good);
  background: rgba(134, 239, 172, 0.3);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(134, 239, 172, 0.2);
}

.framework-item.complete {
  border-color: var(--gold);
  background: rgba(252, 211, 77, 0.35);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(252, 211, 77, 0.3);
  transform: scale(1.02);
}

.framework-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.framework-item span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}

/* Conversation */
.conversation {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  min-height: 400px;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
}

.message.interviewer {
  background: var(--background);
  border-left: 4px solid var(--primary);
}

.message.user {
  background: rgba(79, 70, 229, 0.05);
  border-left: 4px solid var(--secondary);
}

.message-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.message-content {
  color: var(--text);
  font-size: 1rem;
}

.evaluation-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.evaluation-badge.gold {
  background: var(--gold);
  color: #78350F;
}

.evaluation-badge.good {
  background: var(--good);
  color: #14532D;
}

.evaluation-badge.surface {
  background: var(--surface-quality);
  color: var(--text-light);
}

.evaluation-badge.loop {
  background: var(--danger);
  color: white;
}

/* Input Area */
.input-area {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-controls {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.input-controls .btn {
  flex: 1;
}

.btn-audio {
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-audio:hover {
  background: #059669;
}

.btn-audio.recording {
  background: var(--danger);
  animation: pulse 1.5s ease-in-out infinite;
}

.btn-audio.recording:hover {
  background: #DC2626;
}

.record-icon {
  font-size: 1.25rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.recording-status,
.transcription-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--background);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text);
}

.recording-status.hidden,
.transcription-status.hidden {
  display: none;
}

.recording-indicator {
  width: 12px;
  height: 12px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Results Screen */
.results-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-box {
  text-align: center;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 0.75rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#results-content {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 0.75rem;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
}

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

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  color: white;
  margin-top: 1rem;
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .framework-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-summary {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }
}
