/*
@feature:        ./assets/css/audio-tab-styles.css
@purpose:        Provides professional styling for the Audio Tab interface (AI Voice and Microphone)
@depends:        Used by: 10-creator/layout/1audio-tab.php

Filename:        audio-tab-styles.css
Path:            /wp-content/themes/buddyboss-theme-child-UI/assets/css/audio-tab-styles.css
Description:     Styles for the Audio Tab components, controls, waveform editor, and responsive layout.
*/

/* Header styles */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

p {
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* Audio Subtab Nav */
.audio-subtab-nav {
  display: flex;
  background-color: #1e293b;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  width: 100%;
}

.audio-subtab-nav button {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
}

.audio-subtab-nav button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.audio-subtab-nav button.active {
  background-color: #38bdf8;
  color: white;
}

/* Audio Subtab Content */
.audio-subtab-content {
  padding: 24px;
  background-color: white;
  border-radius: 0 0 8px 8px;
  border: 1px solid #e2e8f0;
  border-top: none;
  width: 100%;
  box-sizing: border-box;
}

/* Voice Selection */
.voice-selection-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #38bdf8;
}

.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.voice-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-badge {
  background-color: #38bdf8;
  color: white;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.voice-select-container {
  flex: 1;
}

/* Select Styling */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 11px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #1e293b;
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: white;
  font-size: 16px;
  color: #1e293b;
  appearance: none;
}

/* Button Styling */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.btn-primary {
  background-color: #38bdf8;
  color: white;
}

.btn-primary:hover {
  background-color: #0ea5e9;
}

.btn-outline {
  background-color: white;
  color: #38bdf8;
  border: 1px solid #38bdf8;
}

.btn-outline:hover {
  background-color: #e0f2fe;
  color: #0ea5e9;
  border-color: #0ea5e9;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

/* Waveform and Timeline */
.waveform-container {
  background-color: #f8fafc;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.waveform-header {
  background-color: #1e293b;
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.waveform-box {
  height: 140px;
  background-color: #111827;
  position: relative;
}

.waveform-timeline {
  height: 20px;
  background-color: #374151;
  border-bottom: 1px solid #4b5563;
}

/* Control Groups */
.control-group {
  margin-bottom: 24px;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.control-header {
  background-color: #1e293b;
  color: white;
  padding: 12px 16px;
  font-weight: 600;
}

.control-body {
  padding: 16px;
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Sliders and Track Grid */
.slider-bank {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 16px;
  justify-content: flex-start;
}

.slider-unit {
  background-color: white;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 200px;
  width: 60px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.slider-header {
  background-color: #111827;
  color: white;
  padding: 8px 4px;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
}

.slider-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  position: relative;
}

/* Range Controls */
.range-wrapper {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vertical-range {
  width: 130px;
  transform: rotate(-90deg);
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #38bdf8;
  border-radius: 50%;
  cursor: pointer;
}

/* Other Inputs */
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Vertical Layout Values */
.slider-value {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  color: #38bdf8;
  text-align: center;
}

/* Text Inputs */
.text-input-container {
  margin-top: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: vertical;
  font-size: 16px;
  font-family: inherit;
}

/* Microphone Recorder UI */
.mic-status {
  padding: 12px 16px;
  background-color: #f8fafc;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}

.recording-active {
  background-color: #fee2e2;
  color: #b91c1c;
  border-left: 4px solid #b91c1c;
}

/* Chapter Editor Specific Additions */
.chapter-content-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.chapter-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  text-align: left;
}

.chapter-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  justify-content: flex-end;
  white-space: nowrap;
}

.chapter-waveform-strip {
  margin-top: 8px;
  height: 40px;
  border-top: 1px dashed #ccc;
}

/* Responsive Adjustments */
@media (max-width: 1000px) {
  .slider-bank {
    justify-content: center;
  }

  .controls-row {
    flex-direction: column;
  }

  .voice-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* Textarea Sizing Fix */
#chapter-text-readonly {
  width: 100%;
  height: 200px;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
}

/* NEW ADDITIONS FOR IMPROVED AUDIO TAB */

/* Tab description */
.tab-description {
  color: #64748b;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Move audio controls to top for better visibility */
.audio-controls.top-controls {
  display: flex;
  align-items: center;
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

/* Audio Progress Bar Styles */
#audio-progress-container {
  margin: 20px 0;
  padding: 15px;
  background-color: #111827;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.audio-progress-container {
  width: 100%;
  height: 30px;
  background-color: #1e293b;
  border-radius: 4px;
  margin-bottom: 10px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.audio-progress-bar {
  width: 0%;
  height: 100%;
  background-color: #38bdf8;
  border-radius: 4px;
  transition: width 0.1s linear;
}

.audio-progress-cursor {
  position: absolute;
  top: 0;
  left: 0%;
  width: 2px;
  height: 100%;
  background-color: #ffffff;
  z-index: 5;
  transform: translateX(-50%);
}

.audio-time-display {
  color: #ffffff;
  font-size: 14px;
  font-family: monospace;
  margin-top: 10px;
  text-align: center;
}

.audio-controls-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.audio-control-button {
  padding: 8px 16px;
  background-color: #38bdf8;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.audio-control-button:hover:not(:disabled) {
  background-color: #0ea5e9;
}

.audio-control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #64748b;
}

.audio-bars-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 70px;
  margin-top: 15px;
  padding: 0 10px;
}

/* Play/pause buttons styling */
.btn-play {
  background-color: #e2e8f0;
  color: #1e293b;
  border: none;
  border-radius: 8px;
  padding: 12px;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play:hover {
  background-color: #cbd5e1;
}

.btn-play:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-play-main {
  background-color: #38bdf8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px;
  margin: 0 5px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play-main:hover {
  background-color: #0ea5e9;
}

.btn-play-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Prevent the microphone panel from displaying when not needed */
#mic-recording-panel.hidden {
  display: none !important;
}

/* Better disable style for mic mode button */
#mic-mode-btn:disabled {
  background-color: #cbd5e1;
  color: #64748b;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Make AI voice button clearly active */
#ai-mode-btn.active {
  background-color: #38bdf8;
  color: white;
}

/* Style for disabled options in dropdowns */
select option:disabled {
  color: #94a3b8;
}

/* Improve the appearance of the AI voice panel */
.ai-panel {
  background-color: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #38bdf8;
}

.ai-panel h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 16px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-panel h3::before {
  content: "🧠";
}

/* Improve AI voice selector */
.voice-selection {
  margin-bottom: 16px;
}

.voice-selection label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.voice-dropdown {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background-color: white;
  font-size: 16px;
  color: #1e293b;
  appearance: none;
}

/* Style for the button used to generate voice */
.btn-generate {
  background-color: #38bdf8;
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
  width: 100%;
  margin-top: 16px;
}

.btn-generate:hover {
  background-color: #0ea5e9;
}

.btn-generate::before {
  content: "🎙️";
}

/* Toast notifications - improved position and styling */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.toast-success {
  background-color: #10b981;
}

.toast-error {
  background-color: #ef4444;
}

/* Audio visualizer animation for browser TTS playback */
.audio-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin: 20px 0;
  gap: 3px;
}

.visualizer-bar {
  width: 5px;
  height: 40px;
  background-color: #38bdf8;
  border-radius: 2px;
  transform-origin: bottom;
  animation: visualizer-pulse 0.8s infinite;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; }
.visualizer-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualizer-pulse {
  0% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0.3); }
}

/* Make TTS playback more visible in waveform area */
.tts-playback-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #f8fafc;
  font-weight: 600;
  background-color: rgba(14, 165, 233, 0.2);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(14, 165, 233, 0.5);
  display: none;
}

.tts-playback-indicator.active {
  display: block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

/* REMOVE THE HUGE GREEN BOX */
/* Fix specifically for Verbatik preview success status */
.preview-status.success {
  display: inline-block !important;
  font-size: 13px !important;
  padding: 4px 8px !important;
  background-color: #4b5563 !important;
  color: white !important;
  border-radius: 3px !important;
  margin-bottom: 5px !important;
  text-align: center !important;
  box-shadow: none !important;
  border: none !important;
  font-weight: normal !important;
  max-width: fit-content !important;
}

/* Hide all emoji characters from status messages */
.preview-status::before,
.preview-status::after,
.preview-status.success::before,
.preview-status.success::after {
  content: none !important;
  display: none !important;
}

/* Completely hide the auto-generated green box container */
.audio-player-container .preview-status.success {
  position: fixed !important;
  bottom: 10px !important;
  right: 10px !important;
  z-index: 9999 !important;
  opacity: 0 !important;
  transition: opacity 0.2s !important;
}

/* Make it briefly visible then fade out for consistent experience */
.audio-player-container .preview-status.success:empty {
  display: none !important;
}

/* Hide verbatik content until ready and properly styled */
#verbatik-player-container {
  overflow: hidden !important;
}

/* Override any custom coloring */
.preview-status.success {
  background-color: #4b5563 !important;
  color: white !important;
}

/* Progress Editor Styles - ADDED STYLES */
#progress-editor {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  display: none; /* Hidden by default */
}

#progress-editor.active {
  display: block !important;
}

.progress-editor .editor-container {
  background-color: #111827;
  padding: 20px;
  border-radius: 8px;
}

.progress-editor .decorative-waveform {
  height: 140px;
  background-color: #1a2234;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 15px;
}

.progress-editor .decorative-waveform-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding: 0 10px;
}

.progress-editor .decorative-bar {
  width: 2px;
  background-color: #38bdf8;
  margin: 0 1px;
  transition: height 0.3s ease;
}

.progress-editor .timeline-container {
  color: white;
  margin-bottom: 20px;
}

.progress-editor .time-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 12px;
  color: #94a3b8;
}

.progress-editor .timeline {
  height: 30px;
  background-color: #1e293b;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.progress-editor .timeline-progress {
  height: 100%;
  background-color: #38bdf8;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-editor .timeline-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: white;
  z-index: 10;
  transform: translateX(-50%);
}

.progress-editor .current-time {
  margin-top: 8px;
  font-size: 14px;
  font-family: monospace;
  text-align: center;
}

.progress-editor .progress-control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.progress-editor .progress-control-group {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.progress-editor button {
  background-color: #38bdf8;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.progress-editor button:hover {
  background-color: #0ea5e9;
}

.progress-editor button:disabled {
  background-color: #64748b;
  cursor: not-allowed;
}

.progress-editor button.danger {
  background-color: #ef4444;
}

.progress-editor button.danger:hover {
  background-color: #dc2626;
}

.progress-editor button.secondary {
  background-color: #64748b;
}

.progress-editor button.secondary:hover {
  background-color: #4b5563;
}

/* Make sure audio elements are visible */
audio {
  display: block !important;
  width: 100% !important;
  margin: 10px 0 !important;
}