/* ═══════════════════════════════════════════
   BOTONERA — Editor Styles
   Recording controls, waveform viewer, editing tools
   ═══════════════════════════════════════════ */

/* ── Editor Modal Overlay ── */
.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.editor-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Editor Container ── */
.editor-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    width: 90vw;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.editor-overlay.open .editor-container {
    transform: scale(1);
}

/* ── Editor Header ── */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-header h2 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.editor-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.editor-close-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    color: #ff5050;
}

/* ── Recording Section ── */
.editor-record-section {
    padding: var(--space-lg);
    text-align: center;
}

.record-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 50, 50, 0.15);
    border: 3px solid #ff3232;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.record-btn::after {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff3232;
    transition: all 0.2s ease;
}

.record-btn.recording::after {
    border-radius: 4px;
    width: 20px;
    height: 20px;
}

.record-btn:hover {
    background: rgba(255, 50, 50, 0.25);
    transform: scale(1.05);
}

.record-btn.recording {
    animation: record-pulse 1.5s ease-in-out infinite;
}

@keyframes record-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 50, 50, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(255, 50, 50, 0);
    }
}

.record-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    height: 20px;
}

.record-status.active {
    color: #ff3232;
}

/* ── Input Meter ── */
.input-meter {
    width: 200px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: var(--space-sm) auto;
    overflow: hidden;
}

.input-meter-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.05s linear;
}

.input-meter-fill.hot {
    background: var(--accent-warning);
}

.input-meter-fill.clip {
    background: var(--accent-danger);
}

/* ── Waveform ── */
.editor-waveform-section {
    padding: 0 var(--space-lg);
}

.waveform-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: crosshair;
    height: 120px;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Selection overlay */
.waveform-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(100, 255, 218, 0.15);
    border-left: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
    pointer-events: none;
}

/* Playback position line */
.waveform-position {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    pointer-events: none;
    transition: left 0.05s linear;
}

.waveform-time-labels {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* ── Editor Controls ── */
.editor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg);
    justify-content: center;
}

.editor-btn {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.editor-btn:active {
    transform: scale(0.95);
}

.editor-btn.destructive:hover {
    background: rgba(255, 80, 80, 0.1);
    border-color: #ff5050;
    color: #ff5050;
}

.editor-btn.primary {
    background: rgba(100, 255, 218, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.editor-btn.primary:hover {
    background: rgba(100, 255, 218, 0.25);
}

.editor-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Sample Name Input ── */
.editor-name-section {
    padding: var(--space-sm) var(--space-lg) var(--space-md);
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.editor-name-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
}

.editor-name-input:focus {
    border-color: var(--accent-primary);
}

/* ── Footer Actions ── */
.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Info Labels ── */
.editor-info {
    display: flex;
    gap: var(--space-md);
    padding: 0 var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.editor-info span::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-right: 4px;
    vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .editor-container {
        width: 96vw;
        max-height: 90vh;
    }

    .waveform-container {
        height: 90px;
    }

    .editor-controls {
        gap: 4px;
    }

    .editor-btn {
        font-size: 0.6rem;
        padding: 5px 10px;
    }
}