/**
 * ContentBlocks Debug Core CSS
 * Grundlegende Styles für das Debug-System
 */

/* Globales Debug-Modal Styling */
.cb-debug-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    min-width: 500px;
    max-width: 700px;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    overflow: hidden;
    user-select: none; /* Prevent text selection during drag */
    cursor: move; /* Indicate draggable */
}

/* Mehrere Modals - Positionierung */
.cb-debug-modal:nth-of-type(2) {
    top: 20%;
    left: 20%;
    transform: none;
}

.cb-debug-modal:nth-of-type(3) {
    top: 20%;
    right: 20%;
    left: auto;
    transform: none;
}

.cb-debug-modal:nth-of-type(4) {
    bottom: 20%;
    left: 20%;
    top: auto;
    transform: none;
}

.cb-debug-modal:nth-of-type(5) {
    bottom: 20%;
    right: 20%;
    top: auto;
    left: auto;
    transform: none;
}

.cb-debug-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cb-debug-modal-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    cursor: grab; /* Indicate draggable header */
}

.cb-debug-modal-title {
    font-weight: bold;
    font-size: 14px;
    color: #495057;
}

.cb-debug-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.cb-debug-modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.cb-debug-modal-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    font-size: 12px; /* Kompaktere Schrift */
    max-height: calc(90vh - 120px); /* Höhe minus Header */
}

/* Scrollbar Styling */
.cb-debug-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cb-debug-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cb-debug-modal-body::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.cb-debug-modal-body::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Debug Toggle Button (global) */
.cb-debug-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cb-debug-toggle:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Debug Icons für einzelne Elemente */
.cb-debug-icon {
    position: absolute;
    z-index: 1000;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    transition: all 0.2s;
    display: flex !important; /* Ensure visibility */
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    visibility: visible !important; /* Ensure visibility */
}

.cb-debug-icon:hover {
    background: #0056b3;
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

/* Debug Content Styling */
.cb-debug-section {
    margin-bottom: 15px;
    padding: 10px;
    background: #e9ecef; /* Light gray background */
    border-radius: 5px;
    border-left: 4px solid #007bff; /* Blue left border */
}

.cb-debug-section strong {
    color: #343a40; /* Darker text for labels */
    display: block;
    /* margin-bottom: 8px; */
    font-size: 11px;
}

.cb-debug-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.cb-debug-field {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    /* margin-bottom: 4px !important; */
}

.cb-debug-field label {
    font-weight: 500 !important;
    margin-bottom: 0 !important;
    color: #333 !important;
    font-size: 12px !important;
    flex: 1 !important;
}

/* Checkbox-Felder in einer Zeile - Ultra-Kompakt */
.cb-debug-field.checkbox-field {
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 4px !important;
}

.cb-debug-field.checkbox-field label {
    margin-bottom: 0 !important;
    order: 2 !important;
    flex: 1 !important;
    font-size: 12px !important;
}

.cb-debug-field.checkbox-field input[type="checkbox"] {
    order: 1 !important;
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.cb-debug-field input,
.cb-debug-field select {
    padding: 4px 6px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    width: 63% !important;
    box-sizing: border-box !important;
}

.cb-debug-field input:focus,
.cb-debug-field select:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.cb-debug-stats {
    background: #f1f3f5; /* Lighter gray for stats */
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 10px;
    color: #495057;
    line-height: 1.4;
}

/* Media Queries für kleinere Bildschirme */
@media (max-width: 768px) {
    .cb-debug-modal {
        min-width: 90%;
        max-width: 90%;
    }
    .cb-debug-toggle {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Animationen */
.cb-debug-modal {
    animation: cb-debug-modal-fade-in 0.2s ease-out;
}

@keyframes cb-debug-modal-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.cb-debug-toggle {
    animation: cb-debug-toggle-bounce 0.3s ease-out;
}

@keyframes cb-debug-toggle-bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.cb-debug-icon {
    animation: cb-debug-icon-fade-in 0.3s ease-out;
}

@keyframes cb-debug-icon-fade-in {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 0.9;
        transform: scale(1);
    }
}
