/* ==========================================================================
   Niffty DJ - MIDI Controller Modals & Live MIDI Monitor Drawer
   ========================================================================== */

.dj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.dj-modal-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    width: 540px;
    max-width: 90vw;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    font-weight: 800;
}

.modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.midi-devices-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.midi-device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background-color: var(--neon-green);
    box-shadow: 0 0 6px var(--neon-green);
}

.device-state {
    font-size: 10px;
    font-weight: 800;
    color: var(--neon-green);
}

.no-devices {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 12px;
}

.preset-selector-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preset-select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.learn-action-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.learn-btn {
    background-color: var(--neon-blue);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

/* Live MIDI Monitor Drawer */
.midi-monitor-drawer {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 380px;
    height: 240px;
    background-color: #080a10;
    border: 1px solid var(--border-strong);
    border-radius: 8px 8px 0 0;
    display: none;
    flex-direction: column;
    z-index: 500;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.8);
}

.midi-monitor-drawer.active {
    display: flex;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 10px;
    font-weight: 800;
    color: var(--neon-green);
}

.midi-log-stream {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.midi-log-row {
    display: flex;
    gap: 8px;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.midi-log-row .m-time { color: var(--text-muted); }
.midi-log-row .m-type { color: var(--neon-blue); font-weight: 700; }
.midi-log-row .m-ch { color: var(--neon-amber); }
.midi-log-row .m-d1 { color: var(--text-primary); }
.midi-log-row .m-d2 { color: var(--neon-pink); }
