/* =================================
   VOICE TOOL SPECIFIC STYLES
   Voice interaction and recording interface
   ================================= */

/* Document Title */
.document-title {
  background: linear-gradient(135deg, #E5F4F4, #F6F8F9);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 5px solid #2D7D7D;
}

.document-title h2 {
  color: #2D7D7D;
  font-size: 24px;
  margin-bottom: 8px;
}

.document-title p {
  color: #6B7280;
  font-size: 14px;
}

/* Instructions Section */
.instructions-section {
  background-color: #F6F8F9;
  border: 1px solid #E5F4F4;
  border-radius: 8px;
  margin-bottom: 25px;
  overflow: hidden;
}

.instructions-header {
  background-color: #FFFFFF;
  color: #FF6B47;
  border-left: 4px solid #FF6B47;
  border-bottom: 1px solid #E5F4F4;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.instructions-header:hover {
  background-color: #F6F8F9;
}

.instructions-content {
  padding: 20px;
}

.instructions-content.steps {
  display: flex;
  gap: 20px;
}


.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  font-size: 14px;
}

.number {
  background: none;
  color: #FF6B47;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Privacy Note */
.privacy-note {
  text-align: center;
  padding-top: 15px;
  margin-top: 15px;
  border-top: 1px solid #E5F4F4;
}

/* Layout */
.container {
  padding: 0;
}

/* Section */
.section {
  margin-bottom: 20px;
  background-color: #FFFFFF;
  border: 1px solid #E5F4F4;
  border-radius: 8px;
  padding: 20px;
}

.section-header {
  background-color: #2D7D7D;
  color: #FFFFFF;
  padding: 12px 15px;
  margin: -20px -20px 20px -20px;
  border-radius: 8px 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logout Link */
.logout-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
  font-weight: normal;
}

.logout-link:hover {
  color: white;
  text-decoration: underline;
}

/* Card */
.card {
  background: #FFFFFF;
  border: 1px solid #E5F4F4;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}

.card h3 {
  color: #2D7D7D;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
}

/* Note */
.note {
  color: #6B7280;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* Buttons */
.btn-primary {
  background: #2D7D7D;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #1E5A5A;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(45, 125, 125, 0.3);
}

.btn-warning {
  background: #FF6B47;
  color: white;
  border: none;
}

.btn-warning:hover {
  background: #e55a3a;
}

.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.btn-secondary {
  background: #6B7280;
  color: white;
  border: none;
}

.btn-secondary:hover {
  background: #4B5563;
}

/* Start Chat */
.nodisa-start-wrap {
  text-align: center;
  margin: 20px 0;
}

/* Fallback Card */
.fallback-card {
  background: #FFF3E0;
  border-left: 4px solid #FF6B47;
  margin-top: 16px;
}

.fallback-text {
  margin: 0;
  color: #3F4C5C;
  font-style: normal;
  font-size: 14px;
  line-height: 1.5;
}

.text-tool-link {
  color: #FF6B47;
  text-decoration: none;
  font-weight: 600;
}

.text-tool-link:hover {
  color: #FF5722;
  text-decoration: underline;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Preview Frame */
.preview-frame {
  width: 100%;
  height: 400px;
  border: 1px solid #E5F4F4;
  border-radius: 4px;
  margin: 10px 0;
}

/* Email Input */
.email-input-group {
  margin-top: 15px;
}

.email-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #E5F4F4;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
  transition: border-color 0.3s ease;
}

.email-input:focus {
  outline: none;
  border-color: #2D7D7D;
  box-shadow: 0 0 0 3px rgba(45, 125, 125, 0.1);
}

/* Step Actions */
.step-actions {
  margin-top: 15px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Voiceflow Container */
#vf-container {
  min-height: 200px;
  max-height: 300px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

/* Question Sets */
.questions-container {
  margin-top: 20px;
}

.question-set {
  margin-bottom: 15px;
  background: #FFFFFF;
  border: 2px solid #E5F4F4;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.question-set.locked {
  opacity: 0.65;
  background: #f8f9fa;
}

.question-set.locked .question-set-header {
  cursor: not-allowed;
}

.question-set.completed {
  border-color: #2D7D7D;
  background: linear-gradient(135deg, #f8fffe, #ffffff);
  box-shadow: 0 2px 8px rgba(45, 125, 125, 0.1);
}

.question-set.completed .question-set-header {
  background: linear-gradient(135deg, #E5F4F4, #F0F9F9);
  border-bottom-color: #2D7D7D;
}

.question-set.open {
  border-color: #FF6B47;
  box-shadow: 0 4px 12px rgba(255, 107, 71, 0.1);
}

/* Question Set Header */
.question-set-header {
  background: linear-gradient(135deg, #f9f9f9, #ffffff);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #E5F4F4;
  transition: all 0.3s ease;
}

.question-set-header:hover {
  background: linear-gradient(135deg, #f5f5f5, #f9f9f9);
}

.question-set.open .question-set-header {
  background: linear-gradient(135deg, #FFF5F3, #FFF8F6);
  border-bottom-color: #FF6B47;
}

/* Question Set Title */
.question-set-title {
  font-weight: 700;
  color: #2D7D7D;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.question-set.open .question-set-title {
  color: #FF6B47;
}

.chev {
  font-size: 14px;
  margin-right: 8px;
  transition: transform 0.3s ease;
  width: 16px;
  text-align: center;
  color: #6B7280;
}

/* Question Set Body */
.question-set-body {
  padding: 20px;
  display: none;
  background: #fff;
}

.question-set.open .question-set-body {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Question Content */
.q-main {
  font-size: 15px;
  font-weight: 600;
  color: #2D7D7D;
  margin-bottom: 10px;
  line-height: 1.5;
}

.q-hints {
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.8;
  margin-bottom: 15px;
  padding-left: 22px;
  border-left: 2px solid #E5F4F4;
  list-style: disc;
}

.q-hints li {
  margin-bottom: 2px;
  color: #9CA3AF;
}

/* Pills */
.pill {
  font-size: 0.75rem;
  background: #E5F4F4;
  color: #2D7D7D;
  border-radius: 20px;
  padding: 6px 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.pill.done {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pill.pending {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Transcript Review */
.transcript-block {
  margin-bottom: 20px;
}

.transcript-label {
  font-weight: 600;
  color: #3F4C5C;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.transcript-set-tag {
  background: #FF6B47;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcript-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  border: 2px solid #E5F4F4;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #3F4C5C;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.transcript-textarea:focus {
  outline: none;
  border-color: #2D7D7D;
  box-shadow: 0 0 0 3px rgba(45, 125, 125, 0.1);
}

.transcript-actions {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.transcript-help-text {
  font-size: 13px;
  color: #6B7280;
  font-style: italic;
}

.parse-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #2D7D7D;
  font-style: italic;
}

.parse-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #E5F4F4;
  border-top-color: #2D7D7D;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* Parsed Fields */
.parsed-group {
  background: #FFFFFF;
  border: 1px solid #E5F4F4;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.parsed-group-header {
  font-size: 13px;
  font-weight: 700;
  color: #2D7D7D;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #E5F4F4;
}

.parsed-field {
  margin-bottom: 14px;
}

.parsed-field:last-child {
  margin-bottom: 0;
}

.parsed-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.parsed-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 6px;
}

.parsed-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #E5F4F4;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #3F4C5C;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.parsed-input:focus {
  outline: none;
  border-color: #2D7D7D;
  box-shadow: 0 0 0 3px rgba(45, 125, 125, 0.1);
}

.parsed-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 2px solid #E5F4F4;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #3F4C5C;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.parsed-textarea:focus {
  outline: none;
  border-color: #2D7D7D;
  box-shadow: 0 0 0 3px rgba(45, 125, 125, 0.1);
}

.parsed-help-text {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 6px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .instructions-content.steps {
    flex-direction: column;
    gap: 15px;
  }

  .question-set-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .question-set-title {
    gap: 8px;
    font-size: 14px;
  }

  .question-set-body {
    padding: 16px;
  }

  .step-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .email-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #vf-container {
    min-height: 150px;
    max-height: 250px;
  }

  .preview-frame {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .question-set-header {
    padding: 10px 12px;
  }

  .question-set-body {
    padding: 12px;
  }

  .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
  }

  #vf-container {
    min-height: 120px;
    max-height: 220px;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .question-set {
    border-width: 3px;
  }

  .question-set.open {
    border-color: #FF5722;
  }

  .question-set.completed {
    border-color: #1E5A5A;
  }

  .btn-primary:hover,
  .btn-warning:hover {
    transform: none;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .question-set,
  .question-set-header,
  .chev,
  .btn-primary,
  .btn-warning,
  .card {
    transition: none;
  }

  .question-set.open .question-set-body {
    animation: none;
  }

  .btn-primary:hover,
  .btn-warning:hover,
  .card:hover {
    transform: none;
  }
}

/* Re-record Button */
.rerecord-btn {
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rerecord-btn:hover {
  color: #FF6B47;
  background: rgba(255, 107, 71, 0.08);
}

/* Skip button */
.skip-set-wrap {
  margin-top: 12px;
}

.btn-skip {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color 0.2s ease;
}

.btn-skip:hover {
  color: #6B7280;
}

/* Skipped set state */
.question-set.skipped {
  opacity: 0.5;
  background: #F6F8F9;
  border-color: #E5F4F4;
}

.pill.skipped {
  background: #E5E7EB;
  color: #6B7280;
}

/* Email Capture */
.email-capture-card {
  max-width: 480px;
}

/* Print Styles */
@media print {
  .btn-primary,
  .btn-warning,
  .step-actions,
  #vf-container,
  .fallback-card {
    display: none;
  }

  .question-set {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  .question-set-body {
    display: block !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}