/**
 * Error Modal Styles
 *
 * Styling for the error modal component used in Practice Overlay.
 * Phase 3: Issue #239 - Error Handling Enhancement
 */

/* ========== Error Modal Overlay ========== */
.error-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--z-overlay, 1000) + 10);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.error-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========== Error Modal Container ========== */
.error-modal {
  background: var(--color-bg);
  border-radius: var(--radius-lg, 12px);
  max-width: 420px;
  width: calc(100% - 32px);
  padding: var(--space-6, 24px);
  box-shadow: var(--shadow-xl);
  text-align: center;
}

/* ========== Error Modal Icon ========== */
.error-modal__icon {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4, 16px);
  color: var(--color-warning, #f59e0b);
}

.error-modal__icon svg {
  width: 48px;
  height: 48px;
}

/* ========== Error Modal Title ========== */
.error-modal__title {
  font-size: var(--text-lg, 18px);
  font-weight: var(--font-semibold, 600);
  color: var(--color-text);
  margin-bottom: var(--space-2, 8px);
}

/* ========== Error Modal Message ========== */
.error-modal__message {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4, 16px);
  line-height: var(--leading-relaxed, 1.6);
}

/* ========== Countdown Display ========== */
.error-modal__countdown {
  margin-bottom: var(--space-4, 16px);
  padding: var(--space-3, 12px);
  background: var(--color-bg-muted);
  border-radius: var(--radius-md, 8px);
}

.error-modal__countdown-text {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1, 4px);
}

.error-modal__countdown-timer {
  font-size: var(--text-3xl, 32px);
  font-weight: var(--font-bold, 700);
  color: var(--color-primary);
  display: block;
  line-height: 1.2;
}

.error-modal__countdown-unit {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-muted);
}

/* ========== Retry Progress ========== */
.error-modal__retry-progress {
  font-size: var(--text-xs, 12px);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3, 12px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== Action Buttons ========== */
.error-modal__actions {
  display: flex;
  gap: var(--space-3, 12px);
  justify-content: center;
  flex-wrap: wrap;
}

.error-modal__actions .btn {
  min-width: 120px;
}

/* ========== Mic Instructions (Environment Step) ========== */
.mic-instructions {
  background: var(--color-bg-muted);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4, 16px);
  margin-top: var(--space-3, 12px);
  text-align: left;
}

.mic-instructions__intro {
  font-size: var(--text-sm, 14px);
  font-weight: var(--font-medium, 500);
  color: var(--color-text);
  margin-bottom: var(--space-3, 12px);
}

.mic-instructions__steps {
  padding-left: var(--space-5, 20px);
  margin-bottom: var(--space-3, 12px);
}

.mic-instructions__steps li {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2, 8px);
  line-height: var(--leading-relaxed, 1.6);
}

.mic-instructions__steps li:last-child {
  margin-bottom: 0;
}

.mic-instructions__hint {
  font-size: var(--text-xs, 12px);
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-4, 16px);
}

.mic-instructions .btn {
  width: 100%;
}

/* ========== Transcript Display (Results Error State) ========== */
.results-transcript {
  background: var(--color-bg-muted);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4, 16px);
  margin: var(--space-5, 20px) 0;
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
}

.results-transcript__heading {
  font-size: var(--text-sm, 14px);
  font-weight: var(--font-semibold, 600);
  color: var(--color-text);
  margin-bottom: var(--space-3, 12px);
}

.results-transcript__content {
  font-size: var(--text-sm, 14px);
}

.results-transcript .transcript-message {
  padding: var(--space-2, 8px) 0;
  border-bottom: 1px solid var(--color-border);
}

.results-transcript .transcript-message:last-child {
  border-bottom: none;
}

.results-transcript .transcript-message__role {
  font-size: var(--text-xs, 12px);
  font-weight: var(--font-medium, 500);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: var(--space-1, 4px);
}

.results-transcript .transcript-message__content {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed, 1.6);
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  .error-modal-overlay {
    transition: none;
  }
}

/* ========== Mobile Responsive ========== */
@media (max-width: 480px) {
  .error-modal {
    padding: var(--space-4, 16px);
    max-width: calc(100% - 24px);
  }

  .error-modal__actions {
    flex-direction: column;
  }

  .error-modal__actions .btn {
    width: 100%;
    min-width: auto;
  }

  .mic-instructions {
    padding: var(--space-3, 12px);
  }
}
