/* Free AI Medical Scribe - Tool-specific Styles */

/* ===== Page Layout ===== */
.tool-page {
  padding-top: 20px;
}
.tool-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 0;
}
.tool-screen {
  display: none;
}
.tool-screen.active {
  display: block;
}
.hidden {
  display: none !important;
}

/* ===== Header ===== */
.tool-header {
  text-align: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.tool-header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 8px;
}
.tool-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 4px;
}
.tool-subtitle {
  font-size: 16px;
  color: #6B7280;
  max-width: 470px;
  margin: 0 auto;
}

/* ===== Record Area ===== */
.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  position: relative;
  z-index: 0;
}

.record-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.record-button-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}

/* Wave rings */
.wave-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(91, 155, 213, 0.3);
  pointer-events: none;
  animation: ripple 6s ease-out infinite;
}
.wave-ring:nth-child(1) { animation-delay: 0s; }
.wave-ring:nth-child(2) { animation-delay: 1.5s; }
.wave-ring:nth-child(3) { animation-delay: 3s; }
.wave-ring:nth-child(4) { animation-delay: 4.5s; }

@keyframes ripple {
  0% { width: 200px; height: 200px; opacity: 0.5; }
  100% { width: 350px; height: 350px; opacity: 0; }
}

/* Record button */
.record-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #5B9BD5 0%, #4A89C4 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px -4px rgba(91, 155, 213, 0.4), 0 0 25px 5px rgba(91, 155, 213, 0.2);
  transition: transform 0.5s ease-out, box-shadow 0.5s ease-out;
  position: relative;
  z-index: 2;
}
.record-button::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(91, 155, 213, 0.3) 0%, transparent 60%);
  z-index: -1;
  opacity: 0.6;
  transition: opacity 0.5s ease-out;
}
.record-button:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 28px -6px rgba(91, 155, 213, 0.5), 0 0 40px 12px rgba(91, 155, 213, 0.3);
}
.record-button:active {
  transform: scale(0.97);
  transition: transform 0.15s ease-out;
}
.record-button.recording {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.record-button.paused {
  background: linear-gradient(145deg, #6BA4D9 0%, #5B9BD5 100%);
  box-shadow: 0 8px 20px -4px rgba(91, 155, 213, 0.35), 0 0 25px 5px rgba(91, 155, 213, 0.15);
}

.mic-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  transition: opacity 0.2s ease;
}
.record-button.recording .mic-icon,
.record-button.paused .mic-icon {
  display: none;
}
.stop-icon {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: none;
  margin-bottom: 6px;
}
.record-button.recording .stop-icon,
.record-button.paused .stop-icon {
  display: block;
}
.record-hint {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
.record-button.recording .record-hint,
.record-button.paused .record-hint {
  display: none;
}
.timer {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  letter-spacing: 2px;
}

/* Recording controls */
.recording-controls {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  position: relative;
  z-index: 10;
}
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-pause {
  color: #5B9BD5;
  background: #fff;
  border: 2px solid #5B9BD5;
}
.btn-pause:hover {
  background: #5B9BD5;
  color: white;
}
.btn-cancel-recording {
  color: #6B7280;
  background: #fff;
  border: 2px solid #E5E7EB;
}
.btn-cancel-recording:hover {
  border-color: #EF4444;
  color: #EF4444;
}

/* ===== Configure Screen ===== */
.recording-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #E8F2FA;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.recording-duration {
  font-weight: 600;
  color: #374151;
  font-size: 15px;
}
.recording-actions {
  flex: 1;
}
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #5B9BD5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-play:hover { text-decoration: underline; }
.btn-cancel-small {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-cancel-small:hover { color: #EF4444; }
.audio-player {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
}

/* ===== Form Elements ===== */
.tool-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label, .template-label, .form-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-group-half {
  flex: 1;
}

textarea, select, input[type="email"], input[type="text"], input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1F2937;
  background: #fff;
  transition: border-color 0.2s;
}
textarea:focus, select:focus, input:focus {
  outline: none;
  border-color: #5B9BD5;
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}
textarea {
  resize: vertical;
  line-height: 1.6;
}

.custom-input {
  margin-top: 6px;
}

/* Template Builder */
.template-builder {
  margin-top: 4px;
}
.sections-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.template-section-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: grab;
  transition: box-shadow 0.2s;
}
.template-section-item:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.template-section-item.dragging {
  opacity: 0.5;
}
.section-drag-handle {
  color: #9CA3AF;
  font-size: 18px;
  cursor: grab;
  user-select: none;
}
.section-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #D1D5DB;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.section-toggle:checked {
  background: #5B9BD5;
  border-color: #5B9BD5;
}
.section-toggle:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.section-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}
.section-meta {
  font-size: 12px;
  color: #9CA3AF;
}
.section-edit-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.section-edit-btn:hover {
  color: #5B9BD5;
}
.btn-add-section {
  width: 100%;
  padding: 12px;
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  background: transparent;
  color: #5B9BD5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 12px 0 20px;
  transition: border-color 0.2s;
}
.btn-add-section:hover {
  border-color: #5B9BD5;
}

/* Generate button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: #5B9BD5;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-generate:hover {
  background: #4A89C4;
}
.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Usage Counter ===== */
.usage-counter {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: #6B7280;
  margin-top: 12px;
}

/* ===== Loading Screen ===== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 40px 20px;
}
.loading-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}
.loading-spinner-ring {
  width: 100px;
  height: 100px;
  border: 3px solid #E5E7EB;
  border-top: 3px solid #5B9BD5;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
.loading-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
}
.loading-status {
  font-size: 14px;
  color: #9CA3AF;
  margin-top: 8px;
  margin-bottom: 24px;
}
.loading-quote {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 24px 20px;
  max-width: 500px;
  transition: opacity 0.3s;
}
.quote-text {
  font-size: 16px;
  color: #374151;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 8px;
}
.quote-author {
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Results Screen ===== */
.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.btn-back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #5B9BD5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-back-link:hover { color: #4A89C4; }
.results-meta {
  font-size: 13px;
  color: #9CA3AF;
}

/* Tabs */
.results-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #E5E7EB;
}
.results-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #9CA3AF;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
}
.results-tab.active {
  color: #5B9BD5;
  border-bottom-color: #5B9BD5;
}
.results-tab:hover {
  color: #374151;
}
.results-tab-content.hidden {
  display: none;
}

/* Action buttons */
.note-action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F3F4F6;
  border: 1px solid #D1D5DB;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-action:hover { background: #E5E7EB; }
.btn-action.copied {
  background: #D1FAE5;
  border-color: #10B981;
  color: #065F46;
}

/* Note sections */
.note-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.note-section {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.note-section-header {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #F9FAFB;
  cursor: pointer;
  user-select: none;
}
.note-section-header .section-toggle-arrow {
  margin-right: 8px;
  color: #9CA3AF;
  font-size: 12px;
  transition: transform 0.2s;
}
.note-section.expanded .section-toggle-arrow {
  transform: rotate(90deg);
}
.note-section-header .section-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.section-actions {
  display: flex;
  gap: 4px;
}
.section-action-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.section-action-btn:hover {
  color: #5B9BD5;
  background: #E8F2FA;
}
.section-action-btn.copied {
  color: #10B981;
}
.note-section-content {
  padding: 12px;
  display: none;
}
.note-section.expanded .note-section-content {
  display: block;
}
.section-text {
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px;
  min-height: 60px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.section-text:focus {
  border-color: #5B9BD5;
}
.section-regenerate-input {
  display: none;
  margin-top: 8px;
}
.section-regenerate-input.active {
  display: block;
}
.section-regenerate-input textarea {
  font-size: 13px;
  margin-bottom: 8px;
}
.btn-do-regenerate {
  background: #5B9BD5;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Transcription tab */
.transcription-container {
  margin-bottom: 16px;
}
.transcription-label {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 8px;
}
.transcription-text {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #374151;
  line-height: 1.7;
  resize: vertical;
}
.transcription-text:focus {
  outline: none;
  border-color: #5B9BD5;
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

/* Results CTA */
.results-cta {
  background: linear-gradient(135deg, #E8F2FA, #F5F9FD);
  border: 1px solid #D1E5F4;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin-top: 20px;
}
.results-cta p {
  font-size: 15px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 12px;
}
.results-cta .cta-button {
  display: inline-block;
  background: #5B9BD5;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.results-cta .cta-button:hover { background: #4A89C4; }

/* ===== Limit Screen ===== */
.limit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
}
.limit-icon { margin-bottom: 20px; color: #9CA3AF; }
.limit-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 12px;
}
.limit-container p {
  font-size: 15px;
  color: #6B7280;
  margin-bottom: 12px;
}
.limit-or {
  font-weight: 600;
  color: #374151 !important;
  margin-top: 16px !important;
}
.limit-container .cta-button {
  display: inline-block;
  background: #5B9BD5;
  color: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  margin: 16px 0;
}
.limit-benefits {
  list-style: none;
  text-align: left;
  margin-top: 16px;
  padding: 0;
}
.limit-benefits li {
  padding: 6px 0;
  font-size: 14px;
  color: #374151;
}
.limit-benefits li::before {
  content: "\2713 ";
  color: #10B981;
  font-weight: 700;
  margin-right: 8px;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E5E7EB;
  font-weight: 600;
  color: #1F2937;
}
.btn-close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0 4px;
}
.modal-body {
  padding: 20px;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: #5B9BD5;
}
.form-input-small {
  width: 60px;
  padding: 8px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}
.sentence-range {
  margin-bottom: 12px;
}
.range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: #6B7280;
}
.btn-primary-modal {
  width: 100%;
  padding: 12px;
  background: #5B9BD5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.btn-primary-modal:hover { background: #4A89C4; }
.btn-danger-modal {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: #EF4444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}
.email-status {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1F2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.3s;
  white-space: nowrap;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ===== SEO Content ===== */
.seo-content {
  background: #F9FAFB;
  padding: 60px 16px;
  margin-top: 0;
}
.seo-content .container {
  max-width: 800px;
  margin: 0 auto;
}
.seo-content h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 24px;
  text-align: center;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.step-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
.step-number {
  width: 36px;
  height: 36px;
  background: #5B9BD5;
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}
.step-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.6;
}
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}
.discipline-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.discipline-card:hover {
  border-color: #5B9BD5;
  box-shadow: 0 2px 8px rgba(91, 155, 213, 0.15);
}
.cross-link-box {
  background: #E8F2FA;
  border: 1px solid #D1E5F4;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 48px;
}
.cross-link-box p {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}
.cross-link-box a {
  color: #5B9BD5;
  font-weight: 600;
  text-decoration: none;
}
.cross-link-box a:hover { text-decoration: underline; }

/* FAQ */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
}
.faq-item {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}
.faq-question {
  font-size: 15px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 8px;
}
.faq-answer {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.6;
}
.faq-answer a {
  color: #5B9BD5;
  text-decoration: none;
}
.faq-answer a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .tool-header h1 { font-size: 24px; }
  .form-row { flex-direction: column; gap: 12px; }
  .steps-grid { grid-template-columns: 1fr; }
  .disciplines-grid { grid-template-columns: repeat(2, 1fr); }
  .note-action-buttons { flex-direction: column; }
  .btn-action { justify-content: center; }
  .record-button { width: 160px; height: 160px; }
  .recording-controls { margin-top: 40px; }
}
