
/* Custom Gate Section */
.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.matrix-grid.compact {
    gap: 10px 12px;
    margin-bottom: 8px;
}

.matrix-panel {
    position: relative;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
}

.matrix-panel::before,
.matrix-panel::after {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    width: 10px;
    border-top: 2px solid rgba(212, 175, 55, 0.6);
    border-bottom: 2px solid rgba(212, 175, 55, 0.6);
}

.matrix-panel::before {
    left: 6px;
    border-left: 2px solid rgba(212, 175, 55, 0.6);
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.matrix-panel::after {
    right: 6px;
    border-right: 2px solid rgba(212, 175, 55, 0.6);
    border-left: none;
    border-radius: 0 4px 4px 0;
}

.matrix-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.matrix-label {
    font-size: 0.75em;
    color: rgba(212, 175, 55, 0.7);
    font-family: var(--font-main);
    letter-spacing: 0.5px;
}

.matrix-input {
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--gold-light);
    font-family: var(--font-main);
    font-size: 0.95em;
    letter-spacing: 0.3px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.viz-select {
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--gold-light);
    font-family: var(--font-main);
    font-size: 0.95em;
    letter-spacing: 0.3px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    appearance: none;
}

.viz-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.viz-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.viz-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    color: var(--gold-light);
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.viz-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.granular-settings {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    margin-bottom: 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Collapsible Subsections */
.collapsible-subsection {
    margin-bottom: 6px;
    padding: 12px 16px !important;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.2s ease;
}

.collapsible-subsection:hover {
    border-color: rgba(212, 175, 55, 0.25);
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
    user-select: none;
}

.subsection-header .basis-label {
    font-size: 0.82em;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.subsection-header:hover {
    opacity: 0.85;
}

.subsection-arrow {
    font-size: 0.75em;
    transition: transform 0.3s ease;
    color: var(--gold);
    margin-left: 8px;
    opacity: 0.7;
}

.collapsible-subsection:not(.collapsed) .subsection-arrow {
    transform: rotate(90deg);
}

.subsection-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.collapsible-subsection:not(.collapsed) .subsection-body {
    max-height: 3000px;
    opacity: 1;
    margin-top: 12px;
    padding-bottom: 12px;
    overflow: visible;
}

.matrix-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.matrix-input::placeholder {
    color: rgba(212, 175, 55, 0.4);
    font-style: italic;
}

.matrix-input.invalid {
    border-color: #E74C3C;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.matrix-input.valid {
    border-color: #27AE60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.3);
}

.validation-status {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85em;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.validation-status.pending {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: rgba(212, 175, 55, 0.7);
}

.validation-status.valid {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.5);
    color: #27AE60;
}

.validation-status.invalid {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #E74C3C;
}

.custom-gate-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.custom-gate-actions .quantum-btn {
    flex: 1;
}

.input-hint {
    font-size: 0.8em;
    color: rgba(212, 175, 55, 0.5);
    font-style: italic;
    text-align: center;
    margin-bottom: 10px;
}

