/* 
   OMEGA Patchbay Matrix 7.2 (Aseptic Industrial)
   High-Contrast High-Density Routing Workspace
*/

:root {
    --matrix-bg: #0b0f19;
    --matrix-panel-bg: #121826;
    --matrix-card-bg: #182030;
    --matrix-border: rgba(255, 255, 255, 0.1);
    --matrix-glow: rgba(0, 242, 255, 0.15);
}

/* Base Modal Overlay Refinement */
.modulation-modal-content, .module-patch-content {
    width: 90vw !important;
    height: 85vh !important;
    max-width: 1300px !important;
    background: var(--matrix-bg) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border: 1px solid var(--matrix-border) !important;
    border-radius: 8px !important;
    padding: 24px 30px !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0,0,0,0.95), 
                inset 0 0 100px rgba(0,242,255,0.02);
    position: relative;
    overflow: hidden;
    animation: modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
    from { transform: translateY(30px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Scintillating Border Effect */
.modulation-modal-content::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.4;
}

.modal-title {
    font-family: 'Outfit', 'Inter', monospace, sans-serif;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #ffffff;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

/* ASEPTIC / OMEGA Industrial Standard Buttons */
.aseptic-btn, .modal-ok-btn {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 8px 18px;
    font-family: 'Outfit', 'Inter', monospace, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.aseptic-btn:hover, .modal-ok-btn:hover {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    color: #ffffff;
    border-color: rgba(0, 242, 255, 0.6);
    box-shadow: 0 0 14px rgba(0, 242, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.aseptic-btn:active, .modal-ok-btn:active {
    transform: translateY(0);
}

.aseptic-btn.active {
    background: linear-gradient(180deg, rgba(0, 242, 255, 0.25) 0%, rgba(0, 242, 255, 0.08) 100%);
    color: var(--neon-cyan, #00f2ff);
    border-color: var(--neon-cyan, #00f2ff);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.35), inset 0 0 8px rgba(0, 242, 255, 0.15);
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.6);
}

#btn-clear-slot {
    background: linear-gradient(180deg, #2d1a1a 0%, #1a0f0f 100%);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

#btn-clear-slot:hover {
    background: linear-gradient(180deg, #451a1a 0%, #2b0f0f 100%);
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}

/* Header Status Indicators */
.status-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--neon-amber);
    background: rgba(255, 170, 0, 0.15);
    border: 1px solid rgba(255, 170, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 15px;
    vertical-align: middle;
}

.activity-led {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #222;
    border-radius: 50%;
    margin-left: 10px;
    vertical-align: middle;
    transition: all 0.1s;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.5);
}

.activity-led.activity-general {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.activity-led.activity-manual {
    background: var(--neon-amber);
    box-shadow: 0 0 15px var(--neon-amber);
}

.modulation-workspace {
    display: flex;
    flex: 1;
    gap: 24px;
    margin-top: 20px;
    min-height: 0;
    z-index: 20;
}

/* Grid Dashboard */
.matrix-grid-container {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    grid-auto-rows: minmax(140px, auto);
    gap: 12px;
    height: 100%;
    background: var(--matrix-panel-bg);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow-y: auto;
    align-content: start;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Matrix Card 2.0 High Contrast */
.matrix-card {
    background: var(--matrix-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease-out;
    cursor: pointer;
    position: relative;
    user-select: none;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.matrix-card:hover {
    background: #202a3f;
    border-color: rgba(0, 242, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 242, 255, 0.2);
}

.matrix-card.active {
    background: rgba(0, 242, 255, 0.02);
    border-color: rgba(0, 242, 255, 0.15);
}

.matrix-card.selected {
    background: rgba(0, 242, 255, 0.08);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 24px rgba(0, 242, 255, 0.25), inset 0 0 10px rgba(0, 242, 255, 0.1);
}

.matrix-card.add-card {
    border: 1px dashed rgba(0, 242, 255, 0.3);
    background: rgba(0, 242, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.7;
}

.matrix-card.add-card:hover {
    opacity: 1;
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 255, 0.08);
}

.add-icon {
    font-size: 24px;
    font-weight: 300;
    color: var(--neon-cyan);
}

/* Inspector Refinement High Contrast */
.matrix-inspector-container {
    flex: 1;
    background: var(--matrix-panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.inspector-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 2.5px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0,242,255,0.2);
    background: #050508;
}

.inspector-range {
    width: 100%;
    height: 4px;
    background: #222;
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
}

.inspector-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,242,255,0.5);
}

/* --- ASEPTIC OPTIMIZATIONS --- */
.matrix-card.no-transition {
    transition: none !important;
}

.inspector-select {
    width: 100%;
    background: #000;
    color: var(--neon-cyan);
    border: 1px solid #333;
    padding: 8px;
    font-size: 11px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.inspector-select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.2);
}

.inspector-range {
    width: 100%;
    accent-color: var(--neon-cyan);
    height: 4px;
    background: #222;
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

.inspector-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,242,255,0.5);
}

/* Pocket Patchbay (Module Focused) specific styles */
.module-patch-content {
    width: 80vw !important;
    max-width: 1000px !important;
}

.patch-bay-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    overflow: hidden;
}

.patch-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.patch-list {
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.patch-port-group {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 10px;
}

.patch-port-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.patch-type-badge {
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.type-cv { background: rgba(0, 242, 255, 0.2); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.type-audio { background: rgba(57, 255, 20, 0.2); color: #39ff14; border: 1px solid #39ff14; }
.type-midi { background: rgba(202, 0, 255, 0.2); color: #ca00ff; border: 1px solid #ca00ff; }

.patch-add-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid #444;
    color: #888;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.patch-add-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.patch-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
    background: rgba(255,255,255,0.03);
    padding: 5px;
    border-radius: 4px;
}

.patch-remove-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
}

.patch-remove-btn:hover { color: #ff5555; }

/* --- Era 6.3 Aseptic Empty State --- */
.empty-state-info {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.05);
}

.empty-state-info .info-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--neon-amber);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.empty-state-info p {
    color: #555;
    font-size: 11px;
    max-width: 400px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.metadata-warning {
    background: rgba(255, 170, 0, 0.05);
    border-left: 2px solid var(--neon-amber);
    padding: 12px;
    margin-bottom: 20px;
    font-size: 10px;
    font-weight: 800;
    color: var(--neon-amber);
}

/* Fix Modal Footer Z-Index Overlaps */
.modal-footer, .patch-modal-footer, .pref-footer {
    position: relative;
    z-index: 9999;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
    margin-top: auto;
}
