/* Dashboard - Mobile-first design */

/* Tabs */
/* Tabs */
.dash-tabs { display: flex; gap: 4px; background: var(--bg-card); border-radius: 14px; padding: 4px; border: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; position: sticky; top: 136px; z-index: 100; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.dash-tab { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border: none; background: transparent; font-family: var(--font); transition: all 0.2s; white-space: nowrap; }
.dash-tab:hover { color: var(--text-primary); }
.dash-tab.active { background: var(--gradient); color: #000; font-weight: 600; }

/* Tab content - consistent layout */
.tab-content { width: 100%; }
.record-section { width: 100%; }

/* Sub-tabs */
.sub-tabs { display: flex; gap: 4px; background: var(--bg-secondary); border-radius: 12px; padding: 4px; margin-bottom: 16px; border: 1px solid var(--border); }
.sub-tab { flex: 1; padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border: none; background: transparent; font-family: var(--font); transition: all 0.2s; text-align: center; white-space: nowrap; }
.sub-tab:hover { color: var(--text-primary); }
.sub-tab.active { background: var(--gradient); color: #000; font-weight: 600; }
.method-content { display: none; }
.method-content.active { display: block; }

/* Recording Cards */
.record-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
.record-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.record-card-header .record-icon { font-size: 24px; }
.record-card-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
.record-card-header p { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.record-card-body { padding: 24px 20px; text-align: center; }

/* Sample Text */
.sample-text { position: relative; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: left; }
.sample-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.sample-content { font-size: 16px; line-height: 1.8; color: var(--text-primary); font-weight: 500; letter-spacing: 0.5px; }
.sample-refresh { position: absolute; top: 12px; right: 12px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; transition: all 0.2s; color: var(--text-secondary); font-family: var(--font); }
.sample-refresh:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,240,255,0.06); }

/* Record Button */
.record-btn { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--accent); background: rgba(0,240,255,0.06); color: var(--accent); font-size: 28px; cursor: pointer; transition: all 0.3s; position: relative; }
.record-btn:hover { box-shadow: 0 0 30px rgba(0,240,255,0.25); transform: scale(1.05); }
.record-btn.recording { border-color: var(--danger); background: rgba(255,68,68,0.1); color: var(--danger); animation: pulse-ring 1.5s infinite; }
.record-btn-inner { position: relative; z-index: 1; }
.record-time { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); margin: 16px 0 8px; letter-spacing: 2px; }
.record-status { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255,68,68,0.4); }
    70% { box-shadow: 0 0 0 12px rgba(255,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,68,68,0); }
}

/* Upload Area */
.upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 32px 16px; cursor: pointer; transition: all 0.3s; }
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: rgba(0,240,255,0.03); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area p { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* Audio Preview */
.audio-preview { margin-top: 16px; padding: 16px; background: var(--bg-secondary); border-radius: 12px; }
.audio-preview audio { width: 100%; border-radius: 8px; height: 36px; }
.audio-preview .actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* Empty State */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* Voice List */
.voice-list { display: flex; flex-direction: column; gap: 8px; }
.voice-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: all 0.2s; }
.voice-item:hover { border-color: var(--border-glow); }
.voice-item.selected { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,240,255,0.1); }
.voice-item-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.voice-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--gradient); color: #000; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.voice-info { min-width: 0; }
.voice-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.voice-item-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.voice-status { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.status-ready { background: rgba(0,255,100,0.12); color: var(--success); }
.status-fail { background: rgba(255,68,68,0.12); color: var(--danger); }
.status-wait { background: rgba(255,170,0,0.12); color: var(--warning); }
.voice-delete { background: rgba(255,68,68,0.08); border: 1px solid rgba(255,68,68,0.2); border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--danger); transition: all 0.2s; padding: 4px 8px; font-weight: 600; }
.voice-delete:hover { background: rgba(255,68,68,0.2); border-color: var(--danger); }

/* Synthesis Card */
.synth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 16px; }

/* Voice Selector Row */
.synth-voice-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.synth-voice-label { font-size: 13px; color: var(--text-muted); font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.synth-voice-select { flex: 1; padding: 6px 10px; font-size: 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: var(--font); cursor: pointer; min-width: 0; }
.synth-voice-select:focus { outline: none; border-color: var(--accent); }

/* Horizontal Sliders */
.synth-sliders { display: flex; flex-direction: column; gap: 0; margin-bottom: 4px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.slider-row-h { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
.slider-row-h + .slider-row-h { border-top: 1px solid var(--border); }
.srh-label { font-size: 12px; color: var(--text-muted); font-weight: 500; width: 32px; flex-shrink: 0; }
.srh-btn { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.12s; display: flex; align-items: center; justify-content: center; font-family: var(--font); flex-shrink: 0; }
.srh-btn:hover { border-color: var(--accent); color: var(--accent); }
.srh-btn:active { transform: scale(0.9); }
.srh-range { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: var(--border); border-radius: 2px; outline: none; cursor: pointer; min-width: 0; }
.srh-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gradient); cursor: pointer; border: 2px solid var(--bg-secondary); box-shadow: 0 1px 4px rgba(0,240,255,0.3); }
.srh-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--gradient); cursor: pointer; border: 2px solid var(--bg-secondary); }
.srh-val { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.synth-slider-hints { display: flex; justify-content: space-around; padding: 0 12px 4px; font-size: 10px; color: var(--text-muted); }

/* Textarea */
.synth-textarea-wrap { position: relative; margin-bottom: 12px; }
.synth-textarea { width: 100%; min-height: 220px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; color: var(--text-primary); padding: 16px; font-size: 15px; font-family: var(--font); resize: vertical; line-height: 1.8; }
.synth-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,240,255,0.08); }
.synth-textarea::placeholder { color: var(--text-muted); }

/* Info Bar */
.synth-info-bar { display: flex; margin-bottom: 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.info-item { flex: 1; text-align: center; padding: 8px 4px; }
.info-item + .info-item { border-left: 1px solid var(--border); }
.info-num { display: block; font-size: 18px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.info-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Sliders with +/- (old - kept for reference) */

/* Synthesize Button */
.synth-btn { width: 100%; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600; font-family: var(--font); border: none; background: var(--gradient); color: #000; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; }
.synth-btn:hover:not(:disabled) { box-shadow: 0 6px 24px rgba(0,240,255,0.3); transform: translateY(-1px); }
.synth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.synth-btn-icon { font-size: 20px; }

/* Loading dots */
.loading-dots span { animation: blink 1.4s infinite both; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

/* Result */
.synth-result { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; display: none; }
.result-header { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.synth-result audio { width: 100%; border-radius: 8px; height: 40px; margin-bottom: 12px; }

/* Legal Notice */
.legal-notice { margin-top: 12px; padding: 12px 16px; background: rgba(255,170,0,0.06); border: 1px solid rgba(255,170,0,0.15); border-radius: 10px; font-size: 12px; color: var(--warning); line-height: 1.6; text-align: center; }

/* Voice Name Modal */
.voice-name-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 24px; }
.voice-name-modal.show { display: flex; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; max-width: 380px; width: 100%; }
.modal-card h3 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* Emotion Chips - Grid */
.emotion-section { margin-bottom: 12px; }
.emotion-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.emotion-chip { padding: 6px 0; border-radius: 8px; font-size: 12px; font-family: var(--font); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: all 0.15s; text-align: center; text-decoration: none !important; outline: none; -webkit-tap-highlight-color: transparent; }
.emotion-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.emotion-chip.active { background: var(--gradient); color: #000; border-color: transparent; font-weight: 600; text-decoration: none !important; }

/* Emotion Intensity */
.emotion-intensity { display: flex; align-items: center; gap: 6px; margin-top: 8px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.intensity-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.int-btn { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.12s; display: flex; align-items: center; justify-content: center; font-family: var(--font); flex-shrink: 0; }
.int-btn:hover { border-color: var(--accent); color: var(--accent); }
.int-btn:active { transform: scale(0.9); }
.int-range { flex: 1; height: 4px; -webkit-appearance: none; appearance: none; background: var(--border); border-radius: 2px; outline: none; cursor: pointer; min-width: 0; }
.int-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gradient); cursor: pointer; border: 2px solid var(--bg-secondary); }
.int-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gradient); cursor: pointer; border: 2px solid var(--bg-secondary); }
.int-val { font-size: 12px; font-weight: 700; color: var(--accent); min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }

/* Advanced Options */
.advanced-row { display: flex; gap: 8px; margin-bottom: 14px; }
.adv-group { display: flex; align-items: center; gap: 6px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.adv-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.adv-select { padding: 4px 6px; font-size: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-family: var(--font); cursor: pointer; }
.adv-select:focus { outline: none; border-color: var(--accent); }

/* History */
#tab-history { padding: 0; }
.history-list { display: flex; flex-direction: column; gap: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 16px 40px; max-width: 1150px; margin: 0 auto; }
.history-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; transition: all 0.2s; }
.history-item:hover { border-color: var(--border-glow); }
.history-expired { opacity: 0.45; background: var(--bg-secondary); }
.hist-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); color: #000; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.hist-info { flex: 1; min-width: 0; }
.hist-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hist-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hist-actions audio { width: 180px; height: 36px; border-radius: 8px; background: #fff; filter: none; }
.hist-actions audio::-webkit-media-controls-panel { background: #fff; border-radius: 8px; }
.hist-actions audio::-webkit-media-controls-play-button,
.hist-actions audio::-webkit-media-controls-mute-button,
.hist-actions audio::-webkit-media-controls-timeline,
.hist-actions audio::-webkit-media-controls-volume-slider { filter: invert(0); }
.hist-btn { padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all 0.15s; border: none; display: inline-flex; align-items: center; gap: 4px; }
.hist-btn-download { background: rgba(0,240,255,0.08); color: var(--accent); text-decoration: none; }
.hist-btn-download:hover { background: rgba(0,240,255,0.18); }
.hist-btn-delete { background: rgba(255,68,68,0.08); color: var(--danger); }
.hist-btn-delete:hover { background: rgba(255,68,68,0.18); }
.hist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; max-width: 1150px; margin-left: auto; margin-right: auto; padding: 0 20px; }
.hist-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.hist-count { font-size: 12px; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 10px; border-radius: 20px; }

@media (max-width: 600px) {
    .history-list { padding: 12px 16px; max-width: 100%; }
    .history-item { flex-wrap: wrap; padding: 10px 12px; }
    .hist-icon { width: 30px; height: 30px; font-size: 12px; }
    .hist-actions { width: 100%; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 2px; gap: 8px; }
    .hist-actions audio { width: 100%; height: 40px; }
}

/* Responsive */
@media (max-width: 768px) {
    .dash-tabs { top: 104px; }
    .dash-tabs { border-radius: 12px; }
    .dash-tab { padding: 10px 12px; font-size: 12px; }
    .record-card-body { padding: 20px 16px; }
    .synth-card { padding: 16px; }
    .srh-label { width: 28px; font-size: 11px; }
    .srh-btn { width: 22px; height: 22px; font-size: 13px; }
    .srh-val { font-size: 12px; min-width: 24px; }
}
