/* ===================================
   Tool: voice-pitch-changer
   ボイスピッチチェンジャー
   =================================== */

/* --- Tabs --- */
.tabs-nav {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.tab-btn {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}
.tab-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.tab-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* --- Upload Area --- */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-secondary);
}
.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: rgba(76, 175, 145, 0.05);
}
.upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}
.upload-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}
.upload-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* --- File Player Area --- */
#filePlayerArea {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Mic Recording Player --- */
#micRecordingPlayer {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-color);
}

/* --- File Info --- */
.file-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.file-icon { font-size: 1.5rem; }
.file-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.file-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.file-remove:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

/* --- Controls Section --- */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.label-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.label-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(76, 175, 145, 0.1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-secondary);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(76, 175, 145, 0.3);
}
.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(76, 175, 145, 0.3);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Preset Buttons --- */
.preset-section {
  margin-top: var(--space-sm);
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-md) var(--space-sm);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.preset-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.preset-btn.active {
  border-color: var(--accent);
  background: rgba(76, 175, 145, 0.08);
  color: var(--accent);
  font-weight: 600;
}
.preset-icon {
  font-size: 1.5rem;
}
.preset-name {
  font-size: 0.78rem;
  text-align: center;
}

/* --- Effect Controls --- */
.effect-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.effect-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
}
.effect-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.effect-row:last-child {
  margin-bottom: 0;
}

/* --- EQ Section --- */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.eq-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.eq-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}
.eq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-card);
  outline: none;
}
.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.eq-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* --- Waveform Visualizer --- */
.visualizer-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
}
.visualizer-canvas {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  background: #1a1a2e;
}

/* --- Action Buttons --- */
.action-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}
.action-row .btn {
  flex: 1;
  min-width: 140px;
}
.btn-reverse {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  border: none;
}
.btn-reverse:hover {
  background: linear-gradient(135deg, #d35400, #c0392b);
}

/* --- Mic Controls --- */
.mic-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: var(--space-lg);
}
.mic-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}
.mic-indicator.active {
  background: #e74c3c;
  animation: pulse-mic 1.2s ease-in-out infinite;
}
.mic-indicator.recording {
  background: #e74c3c;
  animation: pulse-mic 0.6s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.mic-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.mic-text.active {
  color: var(--accent);
  font-weight: 600;
}

.mic-buttons {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.btn-mic-start {
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  border: none;
}
.btn-mic-stop {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
}
.btn-record {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
}
.btn-record.recording {
  animation: pulse-record 1s ease-in-out infinite;
}
@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

/* --- Processing Overlay --- */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.processing-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 400px;
  width: 90%;
}
.processing-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-md);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.processing-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}
.progress-percent {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* --- Headphone Warning --- */
.headphone-warning {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
  color: #c0392b;
}
.headphone-warning .warn-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* --- Tips Section --- */
.tips-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.tips-header { margin-bottom: var(--space-lg); }
.tips-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.tip-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-md);
}
.tip-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.tip-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.tip-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .eq-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .eq-band {
    flex-direction: row;
    justify-content: space-between;
    gap: var(--space-md);
  }
  .eq-slider {
    flex: 1;
  }
  .action-row {
    flex-direction: column;
  }
  .action-row .btn {
    min-width: 100%;
  }
  .tips-grid {
    grid-template-columns: 1fr;
  }
  .mic-buttons {
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .tabs-nav {
    flex-direction: column;
  }
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .visualizer-canvas {
    height: 80px;
  }
}
