/* Claris Discovery - Professional Styles */

/* ============================================
   Variables
   ============================================ */
:root {
  --claris-blue: #00A4E4;
  --claris-blue-dark: #0093d0;
  --claris-blue-light: rgba(0, 164, 228, 0.1);
  --text-dark: #1a1a2e;
  --text-primary: #2d3748;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --border-light: #e2e8f0;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-blue: 0 4px 14px rgba(0, 164, 228, 0.35);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 100%);
  min-height: 100vh;
}

/* ============================================
   Welcome Screen
   ============================================ */
.welcome-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 48px;
  animation: fadeInUp 0.5s ease-out;
}

.welcome-container.hidden {
  display: none;
}

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

/* Header */
.welcome-header {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

/* Two-column grid */
.welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}

/* Left column - info cards */
.info-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.info-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--claris-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px 0;
}

.coverage-list,
.steps-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.coverage-list li,
.steps-list li {
  margin-bottom: 8px;
}

.coverage-list li:last-child,
.steps-list li:last-child {
  margin-bottom: 0;
}

.coverage-list strong {
  color: var(--text-dark);
}

.time-note {
  margin: 16px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.time-note strong {
  color: var(--text-dark);
}


/* Setup Card (right column - full height) */
.setup-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--claris-blue);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.setup-content {
  flex: 1;
}

.setup-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px 0;
}

.tips-inline {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.mic-row {
  margin-bottom: 16px;
}

.mic-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.mic-row select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.mic-row select:hover {
  border-color: var(--claris-blue);
}

.mic-row select:focus {
  outline: none;
  border-color: var(--claris-blue);
  box-shadow: 0 0 0 3px var(--claris-blue-light);
}

.button-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  min-height: 20px;
}

/* Test Buttons */
.test-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-btn.primary {
  background: var(--claris-blue);
  color: white;
  border: none;
}

.test-btn.primary:hover:not(:disabled) {
  background: var(--claris-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.test-btn.primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.test-btn.secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.test-btn.secondary:hover:not(:disabled) {
  border-color: var(--claris-blue);
  color: var(--claris-blue);
  box-shadow: var(--shadow-sm);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Status Indicators */
.status-indicator {
  font-size: 0.8125rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-indicator:empty {
  display: none;
}

.status-indicator.success {
  color: var(--success);
}

.status-indicator.success::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.status-indicator.failed {
  color: var(--error);
}

.status-indicator.recording {
  color: var(--error);
}

.status-indicator.recording::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

.status-indicator.playing {
  color: var(--claris-blue);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* Start Section */
.start-section {
  text-align: center;
  margin-top: 32px;
}

/* Troubleshooting */
.troubleshooting {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.troubleshooting summary {
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.troubleshooting summary::-webkit-details-marker {
  display: none;
}

.troubleshooting summary:hover {
  color: var(--text-primary);
}

.troubleshooting-content {
  margin-top: 8px;
  padding-left: 0;
  animation: fadeIn 0.2s ease;
}

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

.troubleshooting-content p {
  margin: 0;
  line-height: 1.5;
}

/* Start Button */
.start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  padding: 18px 32px;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, var(--claris-blue) 0%, var(--claris-blue-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-blue);
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 164, 228, 0.45);
}

.start-btn:active:not(:disabled) {
  transform: translateY(0);
}

.start-btn:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.start-btn:disabled .btn-arrow {
  opacity: 0.5;
}

.btn-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.start-btn:hover:not(:disabled) .btn-arrow {
  transform: translateX(4px);
}

.start-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 12px 0 0 0;
}

.start-hint.ready {
  color: var(--success);
  font-weight: 500;
}

/* Footer */
.welcome-footer {
  width: 100%;
  margin-top: 24px;
  padding: 24px 0 32px 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.welcome-footer.hidden {
  display: none;
}

.footer-logo {
  height: 70px;
  display: inline-block;
}

/* ============================================
   Interview Container
   ============================================ */
#interview-container {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  animation: fadeInUp 0.4s ease-out;
}

#interview-container.active {
  display: block;
}

/* Interview Header */
.interview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.interview-logo {
  height: 32px;
  width: auto;
}

.goal-progress {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-light);
  padding: 6px 14px;
  border-radius: 20px;
}

/* Controls */
#controls {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

#controls button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 500;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

#controls .btn-icon {
  width: 16px;
  height: 16px;
}

#startBtn {
  background: var(--claris-blue);
  color: white;
  font-size: 1rem;
  padding: 12px 24px;
}

#startBtn:hover {
  background: var(--claris-blue-dark);
}

#startBtn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

#pauseBtn {
  background: var(--warning);
  color: white;
  margin-left: 10px;
}

#pauseBtn:hover {
  background: #d97706;
}

#resumeBtn {
  background: var(--success);
  color: white;
  margin-left: 10px;
}

#resumeBtn:hover {
  background: #059669;
}

#saveBtn {
  background: var(--claris-blue);
  color: white;
  margin-left: 10px;
}

#saveBtn:hover {
  background: var(--claris-blue-dark);
}

#status {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 12px;
}

/* Transcript Container */
#transcript-container {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  min-height: 400px;
}

#transcript-container h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

#transcript {
  font-size: 0.9375rem;
  line-height: 1.7;
  max-height: 450px;
  overflow-y: auto;
}

.transcript-line {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.transcript-line.claris {
  background: var(--claris-blue-light);
  border-left: 3px solid var(--claris-blue);
}

.transcript-line.you {
  background: var(--success-light);
  border-left: 3px solid var(--success);
}

.transcript-line.system {
  background: var(--bg-light);
  border-left: 3px solid var(--text-muted);
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.transcript-line strong {
  color: var(--text-dark);
  font-weight: 600;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  .welcome-container {
    padding: 32px 20px 24px;
  }

  .welcome-header {
    margin-bottom: 32px;
  }

  .welcome-header h1 {
    font-size: 1.625rem;
  }

  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .info-column {
    gap: 16px;
  }

  .info-card {
    padding: 20px;
  }

  .setup-card {
    padding: 20px;
  }

  .tips-inline {
    padding-top: 16px;
  }

  .button-row {
    gap: 10px;
  }

  .start-section {
    margin-top: 24px;
  }

  .start-btn {
    max-width: none;
    padding: 16px 24px;
    font-size: 1rem;
  }

  .footer-logo {
    height: 60px;
  }

  .welcome-footer {
    margin-top: 32px;
  }
}

@media (max-width: 480px) {
  .welcome-container {
    padding: 24px 16px 20px;
  }

  .welcome-header h1 {
    font-size: 1.5rem;
  }

  .footer-logo {
    height: 50px;
  }

  .interview-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px 20px;
  }

  #controls {
    padding: 16px 20px;
  }

  #controls button {
    display: flex;
    width: 100%;
    justify-content: center;
    margin: 8px 0;
  }

  #pauseBtn, #resumeBtn, #saveBtn {
    margin-left: 0;
  }

  #transcript-container {
    padding: 20px;
  }
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--claris-blue);
  outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .welcome-container,
  #controls,
  .interview-header {
    display: none;
  }

  #transcript-container {
    box-shadow: none;
    max-height: none;
  }

  #transcript {
    max-height: none;
  }
}
