/* ============================================================================
 * css/components/settings_modal.css  —  Settings-Modal (Fragment settings-modal.html)
 * Migriert in CSS-Reorg 6/12: Off-Brand-Bootstrap-Blau (#007bff/#0056b3) ->
 * Brand-Accent, Status #28a745/#dc3545/#ffc107 -> --status-success/-error/
 * -warning. Belassen: Neutrale Grautoene + Light-BG-Boxen (#ffe6e6/#fff3cd),
 * Courier-New (Debug-Log, bewusst monospace). Font-/Radius-/z-index-
 * Konsolidierung -> CSS-Reorg 11/12.
 * ==========================================================================*/
 /*
 Settings Button - rechts oben
.settings-btn {
    position: fixed;
    top: 18%;
    right: 10%;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: background 0.3s;
}

.settings-btn:hover {
    background: var(--color-accent-active);
}
*/
/* Debug Log Styling */
.debug-log-container {
    width: 100%;
    margin-top: 10px;
}

.debug-log {
    width: 100%;
    height: 200px;
    font-family: 'Courier New', monospace;
    font-size: var(--text-caption);
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    padding: 8px;
    background-color: #f8f9fa;
    color: #333;
    resize: vertical;
    overflow-y: auto;
    white-space: pre-wrap;
}

.debug-log-controls {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: flex-start;
}

.debug-log-controls .setting-btn {
    padding: 4px 12px;
    font-size: var(--text-caption);
}

/* Updated 3-Column Layout */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 20px;
    margin-top: 20px;
}

.settings-left {
    min-width: 280px;
}

.settings-center {
    min-width: 280px;
}

.settings-right {
    min-width: 350px;
}

/* Responsive für 3-Spalten */
@media (max-width: 1200px) {
    .settings-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .settings-right {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    
    .settings-left,
    .settings-center,
    .settings-right {
        min-width: auto;
    }
}
/* Modal Overlay - Basis */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.visible {
    display: flex !important;
}

/* Produktiv: settingsModal ist natives <dialog> (Dialog-A11y 5/8).
   Bleibt Vollbild-Flex-Wrapper (Karte = .modal-content); Dim -> ::backdrop. */
dialog.modal-overlay {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
}
dialog.modal-overlay[open] {
    display: flex; /* ueberschreibt Basis display:none beim Oeffnen */
}
dialog.modal-overlay:not([open]) {
    display: none;
}
dialog.modal-overlay::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: var(--text-heading);
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

/* Settings Modal */
.settings-modal {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    background: #f9f9f9;
}

.settings-section h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-btn {
    padding: 8px 16px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--color-accent);
    cursor: pointer;
    transition: all 0.3s;
}

.setting-btn:hover {
    background: var(--color-accent);
    color: white;
}

.setting-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    min-width: 150px;
}

/* Settings Modal - Fullscreen Layout */
.settings-modal-wide {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    min-height: 100vh;
    overflow-y: auto;
    border-radius: 0;
}

.audio-strings-grid {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.audio-string-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
}

.audio-string-row label {
    min-width: 20px;
    font-weight: bold;
    color: #333;
}

.audio-string-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.test-audio-btn {
    background: none;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: var(--text-body);
    min-width: 32px;
    height: 32px;
    transition: background 0.3s;
}

.test-audio-btn:hover {
    background: var(--color-accent);
}

.audio-editor-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.save-btn {
    background: var(--status-success) !important;
    color: white !important;
}

.reset-btn {
    background: var(--status-error) !important;
    color: white !important;
}

/* Color Picker Styling */
#squareColorPicker {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 0;
}

#squareColorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#squareColorPicker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

#squareColorValue {
    min-width: 80px;
    font-weight: bold;
    color: #333;
}

/* Settings Modal Close Button - sichtbar machen */
.modal-header .close-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .close-btn:hover {
    background: #e0e0e0;
    color: #333;
}
/* Button Mapping Styles */
.button-mapping-grid {
    display: grid;
    gap: 15px;
    margin: 15px 0;
}

.button-mapping-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.button-mapping-row label {
    min-width: 100px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.manual-text {
    line-height: 1.4;
    border-radius: var(--radius-sm);
    font-size: var(--text-body);
    font-weight: bold;
    color: #ffffff;
    left: 19%;
 
}

.key-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: var(--text-body);
    font-weight: bold;
    background: white;
    color: #333;
    text-transform: uppercase;
}

.key-input:focus {
    outline: none;
    border-color: var(--color-accent-active);
    box-shadow: 0 0 0 2px rgba(22, 83, 126, 0.25);
}

.key-display {
    flex: 1;
    font-size: 14px;
    color: #666;
    font-style: italic;
    min-width: 180px;
}

.button-mapping-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Key Input Validation */
.key-input.error {
    border-color: var(--status-error);
    background-color: #ffe6e6;
}

.key-input.duplicate {
    border-color: var(--status-warning);
    background-color: #fff3cd;
}

/* Responsive Button Mapping */
@media (max-width: 768px) {
    .button-mapping-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .button-mapping-row label {
        min-width: auto;
    }
    
    .key-display {
        min-width: auto;
        width: 100%;
    }
}

/* Settings Button auch im Training/Pause Modus sichtbar */
.training-container .settings-btn,
.pause-overlay .settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 3000;
    transition: background 0.3s;
    display: block;
}

.training-container .settings-btn:hover,
.pause-overlay .settings-btn:hover {
    background: var(--color-accent-active);
}