/* DrawIO Plugin Styles */

.drawio-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.drawio-embed-container {
    background: #ffffff;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}

.drawio-caption {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    margin: 0 0 4px 0;
    padding: 0;
}

.drawio-content {
    position: relative;
    background: #fafafa;
}

.drawio-iframe {
    width: 100%;
    border: none;
    display: block;
    background: white;
}

.drawio-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f8f9fa;
    color: #6c757d;
}

.drawio-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: drawio-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes drawio-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.drawio-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    margin: 10px;
    border-radius: 6px;
    text-align: center;
}

.drawio-error h4 {
    margin: 0 0 10px 0;
    color: #721c24;
}

.drawio-error-details {
    font-size: 12px;
    background: rgba(0,0,0,0.05);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-family: monospace;
}

/* Mode minimal */
.drawio-minimal {
    border: none;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

.drawio-minimal .drawio-header {
    display: none;
}

.drawio-minimal .drawio-content {
    background: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .drawio-container {
        margin: 10px 0;
        border-radius: 6px;
    }
    
    .drawio-header {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .drawio-header .controls {
        gap: 5px;
    }
    
    .drawio-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Styles pour l'intégration dans docs */
.html-embed-container .drawio-container {
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.html-embed-container .drawio-header {
    background: #495057;
    font-size: 14px;
    padding: 8px 15px;
}

/* Animation d'entrée */
.drawio-container {
    animation: drawio-fade-in 0.3s ease-out;
}

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

/* États de chargement */
.drawio-container.loading .drawio-content {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawio-container.loaded .drawio-loading {
    display: none;
}

.drawio-container.error .drawio-iframe {
    display: none;
}