/* Global Styles & Variables */
:root {
    --bg-dark: #0a0b10;
    --bg-card: rgba(20, 22, 37, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --color-primary: #8b5cf6;      /* Neon Violet */
    --color-primary-glow: rgba(139, 92, 246, 0.4);
    --color-secondary: #ec4899;    /* Neon Pink */
    --color-secondary-glow: rgba(236, 72, 153, 0.4);
    --color-cyan: #06b6d4;         /* Neon Cyan */
    --color-cyan-glow: rgba(6, 182, 212, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-display: 'Orbitron', system-ui, -apple-system, sans-serif;
    --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Spheres */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
}

.glow-primary {
    top: -10%;
    left: 10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    animation: floating-glow 15s ease-in-out infinite alternate;
}

.glow-secondary {
    bottom: -10%;
    right: 10%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
    animation: floating-glow 12s ease-in-out infinite alternate-reverse;
}

@keyframes floating-glow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 8%) scale(1.1); }
}

/* Main Container Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 1.5rem;
}

/* Header */
.app-header {
    position: relative;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px var(--color-primary));
    animation: pulse-mic 2s infinite ease-in-out;
}

@keyframes pulse-mic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 40%, var(--color-primary) 70%, var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text h1 span {
    color: var(--color-secondary);
    -webkit-text-fill-color: initial;
    background: initial;
    text-shadow: 0 0 15px var(--color-secondary-glow);
}

.brand-text .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.btn-power {
    background: linear-gradient(135deg, var(--color-primary), #6366f1);
    color: white;
    box-shadow: 0 0 20px var(--color-primary-glow);
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-power:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

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

.btn-power.active {
    background: linear-gradient(135deg, var(--color-secondary), #db2777);
    box-shadow: 0 0 25px var(--color-secondary-glow);
}

.btn-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-circle:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 15px var(--color-primary-glow);
    color: white;
    transform: scale(1.05);
}

.btn-circle:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Alert Warning */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    animation: fadeIn 0.4s ease;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-content h3 {
    font-size: 1rem;
    color: #fbbf24;
    margin-bottom: 0.25rem;
}

.alert-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
}

.alert-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.alert-close:hover {
    color: var(--text-main);
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}



@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .visualizer-card {
        height: 240px;
        flex-shrink: 0;
    }
}

/* Controls Section - Sidebar Drawer */
.controls-section {
    position: fixed;
    right: 0;
    top: 0;
    width: 380px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 17, 28, 0.98);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 0.75rem;
    overflow-y: auto;
}

.controls-section.active {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.btn-close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-sidebar:hover {
    color: var(--danger);
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visualizer-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stage-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Control Card Container */
.control-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.control-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    padding: 1.25rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: 0.5px;
}

.header-icon {
    font-size: 1.2rem;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Custom Checkbox Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #e5e7eb;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
    border-color: var(--color-primary);
}

input:checked + .slider-toggle:before {
    transform: translateX(24px);
    background-color: #ffffff;
}

/* Small Switch style */
.switch-sm {
    width: 38px;
    height: 20px;
}
.switch-sm .slider-toggle:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}
input:checked + .switch-sm .slider-toggle:before {
    transform: translateX(18px);
}

/* Control Row and Alignments */
.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.label-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.control-row-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 0.5rem 0;
}

/* Slider Controls */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.control-value {
    color: var(--color-cyan);
    font-family: var(--font-display);
    font-weight: 600;
}

/* Input Slider Customization */
.input-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    margin: 10px 0;
    position: relative;
}

.input-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    transition: transform 0.1s ease, background 0.1s ease;
}

.input-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--color-cyan);
    border-color: var(--color-cyan);
    box-shadow: 0 0 15px var(--color-cyan);
}

/* Card custom glows */
.card-mic:focus-within, .card-mic:hover {
    border-color: rgba(139, 92, 246, 0.3);
}
.card-echo:focus-within, .card-echo:hover {
    border-color: rgba(6, 182, 212, 0.3);
}
.card-reverb:focus-within, .card-reverb:hover {
    border-color: rgba(236, 72, 153, 0.3);
}

/* Drag and Drop File Uploader */
.file-uploader {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
}

.file-uploader:hover, .file-uploader.drag-over {
    border-color: var(--color-primary);
    background: rgba(139, 92, 246, 0.05);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.uploader-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.uploader-text {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.uploader-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Music Controls */
.music-player-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: opacity 0.3s ease;
}

.music-player-controls.disabled {
    opacity: 0.25;
    pointer-events: none;
}

.music-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.music-note-icon {
    font-size: 1.2rem;
    color: var(--color-secondary);
    animation: spin 3s linear infinite paused;
}

.playing .music-note-icon {
    animation-play-state: running;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.music-text-scroll {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}

.music-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.music-time {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
    box-shadow: 0 0 6px var(--color-primary-glow);
}

/* Visualizer Cards & Display */
.visualizer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-grow: 1;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.visualizer-modes {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--border-color);
}

.btn-vis-mode {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-vis-mode.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.visualizer-container {
    flex-grow: 1;
    position: relative;
    min-height: 250px;
    background: rgba(5, 6, 12, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

#canvas-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.mic-inactive-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    z-index: 5;
    padding: 2rem;
    transition: opacity 0.3s ease;
}

.overlay-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
}

.mic-inactive-overlay p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 250px;
    line-height: 1.4;
}

/* Info & Tips Card */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tips-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    position: relative;
    padding-left: 1.25rem;
}

.tips-list li::before {
    content: "•";
    color: var(--color-cyan);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: -0.1rem;
}

.tips-list li strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Footer styling */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.78rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header Actions & Settings Popover */
.header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-settings-cog {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-settings-cog:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary-glow);
    transform: rotate(30deg);
}

.device-settings-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: rgba(15, 17, 28, 0.95);
    border: 1px solid var(--color-primary);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-primary-glow);
    backdrop-filter: blur(16px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-settings-popover.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.popover-header h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.popover-body {
    display: flex;
    flex-direction: column;
    gap: 0.88rem;
}

.popover-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.popover-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.popover-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%239ca3af' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 30px;
}

.popover-select:hover, .popover-select:focus {
    border-color: var(--color-primary);
    background-color: rgba(0, 0, 0, 0.6);
}

.support-text-hint {
    font-size: 0.72rem;
    margin-top: 2px;
}

.support-text-hint.unsupported {
    color: var(--danger);
}

.support-text-hint.supported {
    color: var(--success);
}

.popover-latency-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-color);
    margin-top: 0.25rem;
}

.latency-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.latency-value {
    font-size: 0.78rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-cyan);
}

/* Layout Overrides for Single Screen (Viewport Height) */

.app-footer {
    flex-shrink: 0;
    padding: 0.5rem 0;
    margin-top: 0;
}

/* Vocal Processor Unified Grid */
.vocal-effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.fx-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
}

.fx-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.fx-column-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.fx-column-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compact-toggle-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.toggle-control-sm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Extra Small Switch */
.switch-xs {
    width: 32px;
    height: 18px;
}

.switch-xs .slider-toggle:before {
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
}

input:checked + .switch-xs .slider-toggle:before {
    transform: translateX(14px);
}

/* Slim File Uploader */
.slim-uploader {
    padding: 0.75rem;
    border-style: dashed;
    border-width: 1.5px;
    background: rgba(255, 255, 255, 0.01);
}

.uploader-content-slim {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.uploader-icon-sm {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.uploader-text-sm {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Compact Backing Track Player Controls */
.music-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -0.25rem;
}

.music-info-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}

.music-bottom-controls {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.25rem;
}

.playback-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-circle-sm {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
}

.flex-group {
    gap: 0.25rem;
}

.slider-sm {
    margin: 5px 0 !important;
}

/* Floating Warning Card */
.alert-warning-floating {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    max-width: 360px;
    background: rgba(15, 17, 28, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    animation: slideUpIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Help Popover List */
.tips-list-popover {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0;
}

.tips-list-popover li {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    position: relative;
    padding-left: 1.6rem;
}

.tips-list-popover li strong {
    color: var(--text-main);
}

/* Header Device Settings Styles */
.header-devices {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    margin: 0 1rem;
    max-width: 550px;
}

.device-select-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.device-select-group label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.device-select-header {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
    width: 100%;
    max-width: 200px;
    padding: 0.35rem 0.65rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%239ca3af' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 8px;
    padding-right: 22px;
}

.device-select-header:hover, .device-select-header:focus {
    border-color: var(--color-cyan);
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

/* Lucide Icons Global Styling */
.lucide {
    stroke-width: 2px;
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    vertical-align: middle;
}

/* Specific icon adjustments */
.brand-logo-icon {
    width: 2.2rem;
    height: 2.2rem;
    color: var(--color-primary);
    stroke-width: 2px;
    filter: drop-shadow(0 0 8px var(--color-primary-glow));
    margin-right: 0.5rem;
}

.btn-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    stroke-width: 2px;
}



.header-icon {
    color: var(--color-cyan);
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.4rem;
    stroke-width: 2px;
}

.column-icon {
    color: var(--color-primary);
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.4rem;
    stroke-width: 2px;
}

.vis-icon {
    width: 0.95rem;
    height: 0.95rem;
    margin-right: 0.3rem;
}

.tip-icon {
    color: var(--color-cyan);
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.4rem;
}

.bullet-icon {
    color: var(--color-cyan);
    width: 1rem;
    height: 1rem;
    position: absolute;
    left: 0;
    top: 0.15rem;
}

.select-icon {
    color: var(--text-muted);
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 0.2rem;
}

.upload-icon {
    width: 2.2rem;
    height: 2.2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.overlay-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- High-end Vocal Processor Extensions --- */

.col-dynamics {
    background: rgba(139, 92, 246, 0.02);
}

.col-eq {
    background: rgba(6, 182, 212, 0.02);
}

.col-space {
    background: rgba(236, 72, 153, 0.02);
}

/* Dynamics Compressor Sub-block */
.dynamics-subcard {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-top: 0.5rem;
}

.subcard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 0.35rem;
}

/* EQ Slider Specific Adjustments */
.eq-slider-rack {
    justify-content: space-around;
    flex-grow: 1;
}

.eq-slider-rack .control-group {
    margin-bottom: 0.25rem;
}

.space-fx-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Synth Backing Track Controls */
.synth-actions {
    display: flex;
    align-items: center;
}

.btn-synth {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    border-radius: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--color-cyan);
    font-family: var(--font-body);
}

.btn-synth:hover {
    background: var(--color-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 10px var(--color-cyan-glow);
}

.btn-synth.active {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
    box-shadow: 0 0 10px var(--color-secondary-glow);
}

/* --- Recording Panel --- */
.card-recorder {
    flex-shrink: 0;
}

.recording-panel-body {
    padding: 1rem 1.25rem;
}

.recording-controls-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.btn-record, .btn-record-mid, .btn-record-down {
    flex-grow: 1;
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body);
}

.btn-record {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.btn-record:hover:not(:disabled) {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.btn-record-mid {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-record-mid:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.btn-record-down {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
}
.btn-record-down:hover:not(:disabled) {
    background: var(--success);
    color: white;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-record:disabled, .btn-record-mid:disabled, .btn-record-down:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}

.recording-timer-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.record-badge {
    font-size: 0.7rem;
    font-family: var(--font-display);
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.record-badge.active-rec {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.5);
    animation: blink-rec 1.2s infinite ease-in-out;
}

.record-badge.active-pause {
    background: rgba(245, 158, 11, 0.2);
    color: #fde047;
    border-color: rgba(245, 158, 11, 0.5);
}

@keyframes blink-rec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer-digits {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 0.5px;
}

/* --- Synced Lyrics Panel --- */
.lyrics-card {
    flex-grow: 1.2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 350px;
    position: relative;
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lyrics-sync-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
}

.sync-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.15rem;
}

.btn-sync-step {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sync-step:hover {
    background: var(--color-cyan);
    color: var(--bg-dark);
    border-color: var(--color-cyan);
}

.sync-offset-badge {
    font-size: 0.7rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-cyan);
    padding: 0 0.25rem;
    min-width: 34px;
    text-align: center;
    cursor: pointer;
}

.sync-offset-badge:hover {
    text-decoration: underline;
}

.lyrics-view-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent 0%, white 25%, white 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 25%, white 75%, transparent 100%);
}

/* Custom Scrollbar for Lyrics */
.lyrics-view-container::-webkit-scrollbar {
    width: 4px;
}

.lyrics-view-container::-webkit-scrollbar-track {
    background: transparent;
}

.lyrics-view-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.lyric-spacer {
    height: 60px;
    flex-shrink: 0;
}

.lyrics-placeholder {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin: auto 0;
    line-height: 1.5;
    max-width: 250px;
}

.lyric-line {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    transition: font-size 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    padding: 0.3rem 1rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    opacity: 0.45;
    user-select: none;
}

.lyric-text {
    display: inline-block;
    transition: color 0.2s ease;
}

.lyric-line:hover {
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.85;
}

.lyric-line.active {
    font-size: 1.25rem;
    font-weight: 700;
    opacity: 1;
    transform: scale(1.04);
}

.lyric-line.active .lyric-text {
    background: linear-gradient(
        to right,
        #ffffff 0%,
        #38bdf8 var(--lyric-progress, 0%),
        rgba(255, 255, 255, 0.45) var(--lyric-progress, 0%),
        rgba(255, 255, 255, 0.45) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
}

.lyric-line.past {
    color: var(--text-muted);
    opacity: 0.25;
}

.lyric-line.future {
    color: var(--text-muted);
    opacity: 0.55;
}

/* Floating Recenter Button */
.btn-lyrics-recenter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid var(--color-cyan);
    color: var(--color-cyan);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--color-cyan-glow);
    backdrop-filter: blur(8px);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-lyrics-recenter.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.btn-lyrics-recenter:hover {
    background: var(--color-cyan);
    color: var(--bg-dark);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.recenter-icon {
    width: 0.9rem;
    height: 0.9rem;
}

/* Header Latency Indicator Badge */
.latency-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.latency-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--color-cyan);
}

/* --- Song Library Playlist Styles --- */
.music-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.library-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.5px;
}

.title-icon {
    color: var(--color-primary);
    width: 1.05rem;
    height: 1.05rem;
}

.count-badge {
    font-size: 0.72rem;
    font-family: var(--font-display);
    font-weight: 800;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--color-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.1);
}

.library-list-container {
    max-height: 180px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Custom Scrollbar for Library List */
.library-list-container::-webkit-scrollbar {
    width: 4px;
}

.library-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.library-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.library-empty-placeholder {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.empty-icon {
    width: 2.2rem;
    height: 2.2rem;
    color: var(--text-muted);
    opacity: 0.35;
    animation: spin 8s linear infinite;
}

.library-empty-placeholder p {
    font-size: 0.75rem;
    line-height: 1.4;
    max-width: 220px;
}

.library-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.library-item:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
    transform: translateX(2px);
}

.library-item.active {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-grow: 1;
    min-width: 0;
}

.item-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.library-item.active .item-icon {
    color: var(--color-cyan);
    animation: pulse-mic 1.5s infinite ease-in-out;
}

.item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sub-icon {
    width: 0.75rem;
    height: 0.75rem;
    opacity: 0.6;
}

.item-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.btn-item-load, .btn-item-delete {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-item-load:hover {
    background: var(--color-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 8px var(--color-cyan-glow);
}

.btn-item-delete:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}


@media (min-width: 1025px) {
    body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .app-container {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 0.75rem 1.5rem;
        gap: 0.75rem;
        overflow: hidden;
        max-width: 100%;
        width: 100%;
    }

    .app-header {
        flex-shrink: 0;
        padding: 0.75rem 1.25rem;
    }

    .main-layout {
        flex-grow: 1;
        height: 0; /* Allow columns to scale properly inside the viewport */
        min-height: 0;
        display: grid;
        grid-template-columns: 30% 1fr 30%;
        gap: 1.25rem;
        overflow: hidden;
    }

    .controls-section {
        padding-right: 4px; /* spacing for custom scrollbar */
    }

    /* Custom Scrollbar for Controls Section */
    .controls-section::-webkit-scrollbar {
        width: 4px;
    }

    .controls-section::-webkit-scrollbar-track {
        background: transparent;
    }

    .controls-section::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }

    .controls-section::-webkit-scrollbar-thumb:hover {
        background: var(--color-primary-glow);
    }

    .visualizer-section {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .card-recorder {
        flex: 0 0 auto;
    }

    .visualizer-container {
        min-height: 100px; /* Allow visualizer container to shrink if needed */
    }

    .visualizer-card {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
        display: flex;
        flex-direction: column;
    }

    .lyrics-card {
        flex: 1 1 0;
        min-height: 0; /* Override global 350px min-height to fit single screen */
    }

    .card-music {
        flex: 0 0 auto;
        align-self: start;
    }

    /* --- Space-Efficient Layout Improvements (Desktop-only) --- */
    .card-vocal {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
    }

    .card-vocal .card-body {
        flex-grow: 1;
    }

    .fx-column-body {
        flex-grow: 1;
    }

    /* Ultra-compact card header and body sizes for desktop */
    .card-header {
        padding: 0.6rem 0.9rem;
    }

    .card-body {
        padding: 0.6rem 0.9rem;
        gap: 0.6rem;
    }

    /* Compact Vocal Effects Grid */
    .vocal-effects-grid {
        padding: 0.6rem;
        gap: 0.6rem;
        grid-template-columns: 1fr; /* Stack vertically in the narrow sidebar */
    }

    .fx-column {
        padding: 0.5rem;
        gap: 0.35rem;
    }

    .fx-column-header {
        padding-bottom: 0.25rem;
        margin-bottom: 0.1rem;
    }

    .fx-column-body {
        gap: 0.35rem;
    }

    /* Compact Slider elements */
    .input-slider {
        margin: 4px 0;
    }

    .control-group {
        gap: 0.2rem;
    }

    .control-label {
        font-size: 0.78rem;
    }

    /* Compact dynamics subcard */
    .dynamics-subcard {
        padding: 0.35rem 0.45rem;
        margin-top: 0.2rem;
    }

    .subcard-header {
        margin-bottom: 0.2rem;
        padding-bottom: 0.2rem;
        font-size: 0.75rem;
    }

    /* Compact space-fx-block reverb section */
    .space-fx-block {
        gap: 0.2rem;
    }

    .space-fx-block[style] {
        margin-top: 0.4rem !important;
        padding-top: 0.4rem !important;
    }

    /* 2x2 compact grid for recorder buttons */
    .recording-controls-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .btn-record, .btn-record-mid, .btn-record-down {
        padding: 0.45rem 0.55rem;
        font-size: 0.75rem;
    }

    /* Slim File Uploader spacing */
    .slim-uploader {
        padding: 0.5rem;
    }
}

/* --- Toast Notifications System --- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    min-width: 280px;
    max-width: 380px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(15, 17, 28, 0.92);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-item.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-item.hide {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.toast-info {
    border-color: rgba(6, 182, 212, 0.4);
}
.toast-info .toast-icon { color: var(--color-cyan); }

.toast-success {
    border-color: rgba(16, 185, 129, 0.4);
}
.toast-success .toast-icon { color: var(--success); }

.toast-warning {
    border-color: rgba(245, 158, 11, 0.4);
}
.toast-warning .toast-icon { color: var(--warning); }

.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
}
.toast-error .toast-icon { color: var(--danger); }

.toast-message {
    flex-grow: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}

.toast-close:hover {
    color: #fff;
}

/* --- Vocal Presets Bar --- */
.vocal-presets-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.preset-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 0.25rem;
}

.btn-vocal-preset {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-vocal-preset:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-vocal-preset.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

/* --- Custom Modal Dialog --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-box {
    background: rgba(15, 17, 28, 0.95);
    border: 1px solid var(--color-primary);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--color-primary-glow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: scale(0.92);
    transition: transform 0.25s ease;
}

.custom-modal-overlay.show .custom-modal-box {
    transform: scale(1);
}

.custom-modal-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.custom-modal-box p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

/* --- Footer Hotkeys Guide --- */
.hotkeys-guide {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.hotkey-item {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-cyan);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

