/* Download / Transcription Options modal - opened from transcribe iframe */
.download-options-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.download-options-modal-overlay[aria-hidden="true"] {
  display: none;
}

.download-options-modal-overlay[style*="display: flex"],
.download-options-modal-overlay[aria-hidden="false"],
.download-options-modal-overlay.download-options-modal-open {
  display: flex;
}

.download-options-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 95vh;
  height: 90vh;
  background: #fff;
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-sizing: border-box;
}

/* Header fixed at top - always visible */
.download-options-modal-header {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  background: #fff;
}

/* Scrollable middle section */
.download-options-modal-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 32px;
  -webkit-overflow-scrolling: touch;
}

.download-options-modal-title {
  margin: 0;
  color: var(--primary-red, #ed2047);
  font-size: 24px;
}

.download-options-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.download-options-modal-close:hover {
  color: #374151;
}

.download-options-modal-option-group {
  margin-bottom: 24px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid var(--border-light, #e5e7eb);
}

.download-options-modal-option-group:last-child {
  margin-bottom: 0;
}

.download-options-modal-option-label {
  display: block;
  font-weight: 500;
  color: var(--text-dark, #111827);
  font-size: 16px;
  margin-bottom: 10px;
}

/* On/Off toggle button group */
.download-options-modal-toggle {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light, #e5e7eb);
  background: #f3f4f6;
}

.download-options-modal-toggle-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

.download-options-modal-toggle-btn:hover {
  background: rgba(237, 32, 71, 0.08);
  color: var(--text-dark, #111827);
}

.download-options-modal-toggle-btn.active {
  background: linear-gradient(135deg, var(--primary-red, #ed2047), var(--accent-orange, #f97316));
  color: #fff;
}

.download-options-modal-checkbox-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.download-options-modal-caption-options {
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid var(--border-light, #e5e7eb);
}

.download-options-modal-caption-options.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.download-options-modal-caption-title {
  margin: 0 0 20px 0;
  color: var(--text-dark, #111827);
  font-size: 18px;
}

.download-options-modal-label {
  display: block;
  font-weight: 500;
  color: var(--text-dark, #111827);
  margin-bottom: 8px;
  font-size: 14px;
}

.download-options-modal-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-options-modal-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light, #e5e7eb);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.download-options-modal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-red, #ed2047);
  cursor: pointer;
}

.download-options-modal-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-red, #ed2047);
  cursor: pointer;
  border: none;
}

.download-options-modal-slider-value {
  display: inline-block;
  font-weight: 600;
  color: var(--primary-red, #ed2047);
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light, #e5e7eb);
  min-width: 30px;
  text-align: center;
}

/* When slider value is an input (number) - keep same look, allow typing */
input.download-options-modal-slider-value {
  width: 52px;
  font-size: inherit;
  font-family: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}
input.download-options-modal-slider-value::-webkit-outer-spin-button,
input.download-options-modal-slider-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.download-options-modal-slider-value:focus {
  outline: 2px solid var(--primary-red, #ed2047);
  outline-offset: 1px;
}

.download-options-modal-radio-group {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.download-options-modal-radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-dark, #111827);
}

.download-options-modal-radio-label input {
  margin-right: 8px;
  accent-color: var(--primary-red, #ed2047);
}

/* Footer fixed at bottom - always visible */
.download-options-modal-footer {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 16px 32px 24px;
  border-top: 1px solid var(--border-light, #e5e7eb);
  background: #fff;
}

.download-options-modal-btn {
  flex: 1;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-options-modal-btn-cancel {
  background: #6b7280;
  color: #fff;
}

.download-options-modal-btn-cancel:hover {
  background: #4b5563;
}

.download-options-modal-btn-start {
  background: linear-gradient(135deg, var(--primary-red, #ed2047), var(--accent-orange, #f97316));
  color: #fff;
}

.download-options-modal-btn-start:hover {
  opacity: 0.95;
}
