/* debug.css - Styles pour le système de debug console - Thème Clair */

/* Badge pour les erreurs/warnings dans le bouton debug */
#debugToggle {
    position: relative;
}

.debug-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF9800;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse-badge 2s infinite;
    z-index: 1;
}

.debug-badge.has-errors {
    background: #f44336;
    animation: pulse-error 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse-error {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(244, 67, 54, 0.4);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 0 2px 8px rgba(244, 67, 54, 0.6);
    }
}

/* Modal de Debug */
.debug-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.debug-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    height: 85%;
    max-height: 800px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Header de la modal */
.debug-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #303D4E;
    color: white;
}

.debug-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-modal-header h3 i {
    color: #FFD700;
}

.debug-modal-controls {
    display: flex;
    gap: 10px;
}

.debug-modal-controls button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.debug-modal-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.debug-btn-close {
    background: #ED7470 !important;
}

.debug-btn-close:hover {
    background: #ED7470 !important;
}

/* Filtres */
.debug-filters {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

/* Filtres de source */
.debug-source-filters {
    display: flex;
    gap: 10px;
    padding-right: 15px;
    border-right: 1px solid #dee2e6;
}

.filter-separator {
    color: #adb5bd;
    margin: 0 5px;
}

.debug-filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.debug-filter-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Labels pour les sources */
.filter-label.source-js {
    background: #f7df1e;
    color: #323330;
}

.filter-label.source-python {
    background: #3776ab;
    color: white;
}

/* Labels pour les types de logs */
.filter-label.log {
    background: #e3f2fd;
    color: #1565c0;
}

.filter-label.warn {
    background: #fff3e0;
    color: #e65100;
}

.filter-label.error {
    background: #ffebee;
    color: #c62828;
}

.filter-label.info {
    background: #e8f5e9;
    color: #2e7d32;
}

.filter-label.debug {
    background: #f3e5f5;
    color: #6a1b9a;
}

.debug-search {
    margin-left: auto;
}

.debug-search input {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
    transition: all 0.3s ease;
    background: white;
}

.debug-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.debug-search input::placeholder {
    color: #adb5bd;
}

/* Corps de la modal (logs) */
.debug-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    background: #fafbfc;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
}

/* Scrollbar personnalisée */
.debug-modal-body::-webkit-scrollbar {
    width: 10px;
}

.debug-modal-body::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 5px;
}

.debug-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
}

.debug-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.debug-log-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: white;
    border-left: 4px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: slideInLog 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    color: #212529;
}

@keyframes slideInLog {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.debug-log-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

/* Couleurs pour les différents types de logs */
.debug-log-item.debug-log {
    border-left-color: #2196f3;
    background: #ffffff;
}

.debug-log-item.debug-error {
    border-left-color: #f44336;
    background: #fff5f5;
}

.debug-log-item.debug-warn {
    border-left-color: #ff9800;
    background: #fffaf0;
}

.debug-log-item.debug-info {
    border-left-color: #4caf50;
    background: #f6fff7;
}

.debug-log-item.debug-debug {
    border-left-color: #9c27b0;
    background: #fef5ff;
}

/* Badge de source (JS/Python) */
.debug-log-source {
    position: absolute;
    top: 12px;
    right: 15px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.debug-log-source.source-js {
    background: #f7df1e;
    color: #323330;
}

.debug-log-source.source-python {
    background: #3776ab;
    color: white;
}

.debug-log-time {
    color: #6c757d;
    font-size: 12px;
    margin-right: 10px;
    font-weight: 500;
}

.debug-log-type {
    font-weight: bold;
    margin-right: 10px;
    font-size: 12px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f3f5;
}

.debug-error .debug-log-type {
    color: #f44336;
    background: #ffebee;
}

.debug-warn .debug-log-type {
    color: #ff9800;
    background: #fff3e0;
}

.debug-info .debug-log-type {
    color: #4caf50;
    background: #e8f5e9;
}

.debug-debug .debug-log-type {
    color: #9c27b0;
    background: #f3e5f5;
}

.debug-log-message {
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #2c3e50;
    line-height: 1.5;
    font-size: 13px;
}

.debug-log-stack {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    color: #6c757d;
    white-space: pre-wrap;
    border: 1px solid #e9ecef;
}

.debug-empty {
    text-align: center;
    padding: 60px;
    color: #adb5bd;
    font-style: italic;
    font-size: 16px;
}

.debug-empty::before {
    content: "📭";
    display: block;
    font-size: 48px;
    margin-bottom: 20px;
}

/* Footer de la modal */
.debug-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.debug-stats {
    font-size: 14px;
    color: #6c757d;
    display: flex;
    gap: 15px;
}

.debug-stats span {
    font-weight: 600;
    color: #495057;
}

.debug-modal-footer label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
}

.debug-modal-footer input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .debug-modal-content {
        width: 95%;
        height: 90%;
        max-height: none;
    }
    
    .debug-filters {
        padding: 10px 15px;
    }
    
    .debug-source-filters {
        border-right: none;
        padding-right: 0;
    }
    
    .debug-search {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }
    
    .debug-search input {
        width: 100%;
    }
    
    .debug-modal-header {
        padding: 15px;
    }
    
    .debug-modal-header h3 {
        font-size: 16px;
    }
    
    .debug-modal-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .debug-modal-controls button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .debug-log-source {
        position: static;
        display: inline-block;
        margin-left: 10px;
    }
    
    .debug-stats {
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }
}

/* Animation de chargement */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

/* Effet de survol pour les boutons */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}