/**
 * Skillzy Tools — AI Text-to-Speech & Voice Studio CSS
 * Styled to match Skillzy's dark cyberpunk glassmorphism theme.
 */

.tts-studio-container {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 10px 0 60px;
}

/* Left Studio Navigation Sidebar */
.tts-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tts-sidebar-label {
    font-size: 10.5px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 6px 12px 2px;
}

.tts-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    width: 100%;
}

.tts-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.tts-nav-item.active {
    color: #fff;
    background: rgba(0, 200, 255, 0.08);
    border-color: rgba(0, 200, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 200, 255, 0.08);
}

.tts-nav-item svg {
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.2s;
}

.tts-nav-item.active svg {
    color: var(--cyan, #00c8ff);
}

.tts-sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

/* Main Studio Workspace */
.tts-workspace {
    flex: 1;
    min-width: 0;
}

.tts-workspace-header {
    margin-bottom: 24px;
}

.tts-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.05;
}

.tts-hero-title span {
    background: linear-gradient(135deg, #fff 40%, var(--cyan, #00c8ff) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tts-hero-desc {
    font-size: 13.5px;
    color: #94a3b8;
    max-width: 680px;
    line-height: 1.5;
    margin: 0;
}

.tts-voicestudio-connect {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(150px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 0 0 20px;
    padding: 14px;
    background: rgba(8, 15, 28, 0.8);
    border: 1px solid rgba(0, 200, 255, 0.18);
    border-radius: 14px;
}
.tts-voicestudio-connect > div { display: flex; flex-direction: column; gap: 4px; color: #e2e8f0; font-size: 12px; }
.tts-voicestudio-connect > div span { color: #fbbf24; font-size: 11px; }
.tts-voicestudio-connect > div span.connected { color: #34d399; }
.tts-voicestudio-connect input, .tts-clone-text-input {
    width: 100%; min-width: 0; height: 38px; padding: 0 10px; color: #e2e8f0;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
}
.tts-voicestudio-connect button { height: 38px; padding: 0 14px; color: #06121c; font-weight: 800; background: #00c8ff; border: 0; border-radius: 9px; cursor: pointer; }
.tts-voicestudio-connect small { grid-column: 1 / -1; color: #64748b; line-height: 1.4; }
.tts-clone-text-input { height: 44px; }
.tts-advanced-controls { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.tts-studio-field { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; color: #94a3b8; font-size: 11px; font-weight: 700; }
.tts-studio-field input:not([type="range"]), .tts-studio-field select { width: 100%; height: 36px; padding: 0 10px; color: #e2e8f0; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; }
.tts-studio-field select option { color: #111827; }
.tts-studio-field input[type="range"] { width: 100%; accent-color: var(--cyan, #00c8ff); }
.tts-studio-field > span { float: right; color: var(--cyan, #00c8ff); }
.tts-studio-checks { display: grid; gap: 9px; margin: 14px 0 4px; color: #94a3b8; font-size: 11px; }
.tts-studio-checks label { display: flex; gap: 8px; align-items: center; }
.tts-studio-checks input { accent-color: var(--cyan, #00c8ff); }
@media (max-width: 760px) { .tts-voicestudio-connect { grid-template-columns: 1fr; } .tts-voicestudio-connect small { grid-column: auto; } }

/* Two Columns: Editor (Left) & Settings (Right) */
.tts-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 980px) {
    .tts-studio-container {
        flex-direction: column;
    }
    .tts-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    .tts-grid {
        grid-template-columns: 1fr;
    }
}

/* Editor Glass Card */
.tts-editor-card {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.tts-editor-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.tts-editor-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #cbd5e1;
}

.tts-editor-badge svg {
    color: var(--cyan, #00c8ff);
}

.tts-btn-clear {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11.5px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.tts-btn-clear:hover {
    color: #ef4444;
}

.tts-textarea {
    flex: 1;
    width: 100%;
    min-height: 280px;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    resize: none;
}

.tts-textarea::placeholder {
    color: rgba(255, 255, 255, 0.22);
}

.tts-editor-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.tts-char-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tts-char-counter strong {
    color: #94a3b8;
}

.tts-btn-generate {
    background: linear-gradient(135deg, var(--cyan, #00c8ff), #0090ff);
    color: #060911;
    border: none;
    border-radius: 999px;
    padding: 12px 28px;
    font-family: 'Outfit', sans-serif;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.35);
    transition: all 0.2s ease;
}

.tts-btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 35px rgba(0, 200, 255, 0.5);
    filter: brightness(1.05);
}

.tts-btn-generate:active {
    transform: translateY(1px);
}

.tts-btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Audio Player Dock */
.tts-player-dock {
    margin-top: 16px;
    background: rgba(14, 20, 32, 0.85);
    border: 1px solid rgba(0, 200, 255, 0.25);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.tts-btn-play {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cyan, #00c8ff);
    color: #060911;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.tts-btn-play:hover {
    transform: scale(1.06);
}

.tts-track-info {
    flex: 1;
    min-width: 0;
}

.tts-track-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tts-track-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    color: #64748b;
}

.tts-btn-download-audio {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 16px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.tts-btn-download-audio:hover {
    background: rgba(0, 200, 255, 0.15);
    border-color: var(--cyan, #00c8ff);
    color: var(--cyan, #00c8ff);
}

/* Settings Column */
.tts-settings-card {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tts-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #cbd5e1;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tts-section-label {
    font-size: 10.5px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Voice Picker Card */
.tts-voice-card {
    background: #0d121f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-voice-card:hover {
    border-color: rgba(0, 200, 255, 0.4);
    background: #111728;
}

.tts-voice-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c8ff, #7928ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.tts-voice-info {
    flex: 1;
    min-width: 0;
}

.tts-voice-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tts-voice-sub {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 2px;
}

/* Control Sliders & Switches */
.tts-control-row {
    margin-bottom: 14px;
}

.tts-control-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.tts-control-val {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    color: #fff;
    font-size: 11.5px;
}

.tts-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.tts-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

.tts-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--cyan, #00c8ff);
}

/* Segmented Toggle (No/Yes, MP3/WAV) */
.tts-segment-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.tts-segment-label {
    font-size: 12px;
    color: #94a3b8;
}

.tts-segment-capsule {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tts-segment-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.tts-segment-btn.active {
    background: #fff;
    color: #060911;
}

/* Voice Modal */
.tts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.82);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tts-modal-overlay.active {
    display: flex;
}

.tts-voice-modal {
    background: #0a0e18;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

.tts-voice-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tts-voice-modal-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.tts-voice-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tts-voice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.15s;
}

.tts-voice-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 200, 255, 0.3);
}

.tts-voice-option.selected {
    background: rgba(0, 200, 255, 0.08);
    border-color: var(--cyan, #00c8ff);
}

/* Dual Generation & Switch */
.tts-dual-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px;
}

.tts-dual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.tts-dual-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tts-beta-badge {
    font-size: 9px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tts-dual-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

/* iOS / Apple Glass Style Toggle Switch */
.tts-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.tts-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tts-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.tts-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.tts-switch input:checked + .tts-switch-slider {
    background: var(--cyan, #00c8ff);
    border-color: var(--cyan, #00c8ff);
}

.tts-switch input:checked + .tts-switch-slider:before {
    transform: translateX(16px);
    background: #060911;
}

/* Audio Scrubber & Progress */
.tts-player-waveform {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tts-scrubber-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tts-scrubber-fill {
    height: 100%;
    background: var(--cyan, #00c8ff);
    width: 0%;
    border-radius: 999px;
    transition: width 0.08s linear;
}

.tts-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-family: 'IBM Plex Mono', monospace;
    color: #64748b;
}

/* Green circular icon indicator seen in bottom-right corner of editor card */
.tts-editor-status-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.tts-editor-status-dot:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: scale(1.1);
}

/* Subviews: Clone Voice & Explore */
.tts-subview {
    display: none;
    animation: ttsFadeIn 0.25s ease-out;
}

.tts-subview.active {
    display: block;
}

@keyframes ttsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Clone Voice Studio Styles */
.tts-clone-card {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    max-width: 820px;
}

.tts-clone-dropzone {
    border: 2px dashed rgba(0, 200, 255, 0.25);
    border-radius: 16px;
    padding: 38px 24px;
    text-align: center;
    cursor: pointer;
    background: rgba(0, 200, 255, 0.02);
    transition: all 0.2s;
    margin: 20px 0;
}

.tts-clone-dropzone:hover, .tts-clone-dropzone.dragover {
    border-color: var(--cyan, #00c8ff);
    background: rgba(0, 200, 255, 0.06);
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.1);
}

/* Explore Voices Grid */
.tts-explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.tts-explore-card {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tts-explore-card:hover {
    border-color: rgba(0, 200, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tts-explore-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tts-explore-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan, #00c8ff), #7928ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tts-explore-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.tts-btn-preview-voice {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.tts-btn-preview-voice:hover {
    background: rgba(0, 200, 255, 0.15);
    border-color: var(--cyan, #00c8ff);
    color: var(--cyan, #00c8ff);
}

.tts-btn-use-voice {
    background: var(--cyan, #00c8ff);
    color: #060911;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-btn-use-voice:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

