/**
 * 🎨 STYLES CSS POUR L'INTÉGRATION QDRANT
 * Styles pour l'interface de gestion Qdrant dans semtools-workspace
 */

/* ===============================================
   INDICATEUR DE STATUT QDRANT
   =============================================== */

.qdrant-status-indicator {
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(224, 224, 224, 0.2);
}

.qdrant-status {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.qdrant-status i {
    color: #4CAF50;
    font-size: 14px;
}

.status-badge {
    font-size: 12px;
    margin-left: auto;
    transition: color 0.3s ease;
}

.qdrant-status:hover {
    color: #333;
}

/* ===============================================
   PANNEAU DE CONTRÔLES QDRANT
   =============================================== */

.qdrant-controls {
    display: flex;
    flex-direction: row-reverse;
    margin: 15px 0;
    padding: 0;
}

.qdrant-control-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(224, 224, 224, 0.15);
    border-radius: 8px;
    padding: 12px;
}

.qdrant-control-panel h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qdrant-control-panel h4 i {
    color: #4CAF50;
    font-size: 13px;
}

.qdrant-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.qdrant-buttons .btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qdrant-buttons .btn i {
    font-size: 10px;
}

.qdrant-buttons .btn-primary {
    background-color: linear-gradient(135deg, #3498db 0%, #3498db 100%);
    border-color: var(--secondary-color);
    color: white;
}

.qdrant-buttons .btn-primary:hover {
    background-color: linear-gradient(135deg, #3498db 0%, #3498db 100%);
    border-color: var(--secondary-color);
}

.qdrant-buttons .btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.qdrant-buttons .btn-info:hover {
    background-color: #117a8b;
    border-color: #117a8b;
}

.qdrant-buttons .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.qdrant-buttons .btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.qdrant-buttons .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===============================================
   PANNEAU DE STATISTIQUES
   =============================================== */

.qdrant-stats-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qdrant-stats-display {
    font-size: 13px;
}

.stat-card {
    border: 1px solid #5d5a5a5c;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    margin-bottom: 10px;
}

.stat-card h6 {
    font-size: 15px;
    font-weight: 600;
    color: #4CAF50;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.qdrant-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #2e7d32;
}

/* ===============================================
   LISTE DES COLLECTIONS
   =============================================== */

.collections-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
}

.collection-item {
    background: rgba(0, 123, 255, 0.05);
    border: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
}

.collection-item:last-child {
    margin-bottom: 0;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.collection-header strong {
    color: #007bff;
    font-size: 13px;
}

.collection-header .badge {
    font-size: 10px;
    padding: 2px 6px;
}

.collection-details {
    font-size: 11px;
    color: #666;
    line-height: 1.4;
}

/* ===============================================
   MODAL QDRANT
   =============================================== */

.modal .qdrant-stats-display .row {
    margin: 0;
}

.modal .qdrant-stats-display .col-md-6 {
    padding: 0 5px;
}

.modal .stat-card {
    margin-bottom: 15px;
}

.modal .collections-list {
    max-height: 600px;
    background: #f8f9fa;
}

/* ===============================================
   INDICATEURS D'ÉTAT
   =============================================== */

.qdrant-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #007bff;
    font-size: 12px;
}

.qdrant-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

.qdrant-success {
    color: #28a745;
}

.qdrant-error {
    color: #dc3545;
}

.qdrant-warning {
    color: #ffc107;
}

/* ===============================================
   INTÉGRATION AVEC LES STYLES EXISTANTS
   =============================================== */

/* S'assurer que les contrôles Qdrant s'intègrent bien */
.search-params .qdrant-controls {
    border-top: 1px solid rgba(224, 224, 224, 0.2);
    padding-top: 12px;
    margin-top: 12px;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .qdrant-control-panel {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .qdrant-control-panel h4 {
        color: #000000;
    }
    
    .qdrant-status {
        color: #ccc;
    }
    
    .qdrant-status:hover {
        color: #fff;
    }
    
    .collection-item {
        background: rgba(0, 123, 255, 0.1);
        border-color: rgba(0, 123, 255, 0.2);
    }
    
    .collection-details {
        color: #aaa;
    }
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .qdrant-buttons {
        justify-content: center;
    }
    
    .qdrant-buttons .btn {
        flex: 1;
        min-width: 70px;
        font-size: 10px;
        padding: 6px 4px;
    }
    
    .collection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .qdrant-stats-display .row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .qdrant-control-panel {
        padding: 8px;
    }
    
    .qdrant-control-panel h4 {
        font-size: 13px;
    }
    
    .qdrant-buttons .btn {
        font-size: 9px;
        padding: 4px 6px;
    }
    
    .collections-list {
        max-height: 200px;
    }
}

/* ===============================================
   ANIMATIONS ET TRANSITIONS
   =============================================== */

.qdrant-controls {
    animation: slideIn 0.3s ease-out;
}

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

.collection-item {
    transition: all 0.2s ease;
}

.collection-item:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card {
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* ===============================================
   ÉTAT DES BOUTONS AVEC ICÔNES
   =============================================== */

.qdrant-buttons .btn .fa-sync {
    transition: transform 0.3s ease;
}

.qdrant-buttons .btn:hover .fa-sync {
    transform: rotate(180deg);
}

.qdrant-buttons .btn .fa-spinner {
    animation: spin 1s linear infinite;
}

/* ===============================================
   BADGES ET INDICATEURS
   =============================================== */

.qdrant-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10px;
}

.qdrant-badge.success {
    background-color: #28a745;
}

.qdrant-badge.warning {
    background-color: #ffc107;
    color: #212529;
}

.qdrant-badge.error {
    background-color: #dc3545;
}

.qdrant-badge.info {
    background-color: #17a2b8;
}

/* ===============================================
   UTILITAIRES
   =============================================== */

.qdrant-hidden {
    display: none !important;
}

.qdrant-visible {
    display: block !important;
}

.qdrant-text-small {
    font-size: 11px;
}

.qdrant-text-muted {
    color: #6c757d;
}

.qdrant-mt-10 {
    margin-top: 10px;
}

.qdrant-mb-10 {
    margin-bottom: 10px;
}

/* ===============================================
   INTÉGRATION AVEC LE THÈME EXISTANT
   =============================================== */

/* S'assurer que les couleurs correspondent au thème */
:root {
    --qdrant-primary: #4CAF50;
    --qdrant-secondary: #007bff;
    --qdrant-success: #28a745;
    --qdrant-warning: #ffc107;
    --qdrant-danger: #dc3545;
    --qdrant-info: #17a2b8;
    --qdrant-light: #f8f9fa;
    --qdrant-dark: #343a40;
}

/* Appliquer les couleurs du thème */
.qdrant-control-panel h4 i {
    color: var(--qdrant-primary);
}

.qdrant-status i {
    color: var(--qdrant-primary);
}

.qdrant-stat-card h6 {
    color: var(--qdrant-primary);
}

.qdrant-stat-value {
    color: var(--qdrant-success);
}