/**
 * 🔗 STYLES MULTI-HOP RETRIEVAL
 * Styles pour la visualisation des requêtes multi-sauts
 */

/* Container principal */
.multihop-container {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 450px;
    max-height: 80vh;
    background: #303D4E;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(100%);
}

.multihop-container.show {
    opacity: 1;
    transform: translateX(0);
}

.multihop-container.hidden {
    display: none;
}

/* Header */
.multihop-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.multihop-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.multihop-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.multihop-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Progress bar */
.multihop-progress {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.progress-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

/* Timeline des hops */
.hops-timeline {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.hop-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.hop-item.show {
    opacity: 1;
    transform: translateY(0);
}

.hop-item:hover .hop-content {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.hop-number {
    width: 40px;
    height: 40px;
    background: #303D4E;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.hop-content {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
}

.hop-query {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.hop-details {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.hop-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.confidence {
    color: #4CAF50;
}

.entities-count {
    color: #FF9800;
}

.docs-count {
    color: #2196F3;
}

.hop-reasoning {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.hop-connector {
    position: absolute;
    left: 19px;
    bottom: -25px;
    color: #3498db;
    font-size: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Détails Multi-hop */
.multihop-details {
    padding: 20px;
    background: #f8f9fa;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid #e0e0e0;
}

.multihop-details h4 {
    color: #333;
    font-size: 14px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

/* Tags d'entités */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.entity-tag {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    color: #3498db;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid #667eea30;
    cursor: pointer;
    transition: all 0.2s;
    animation: fadeIn 0.3s ease;
}

.entity-tag:hover {
    background: linear-gradient(135deg, #667eea25, #764ba225);
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Relations graph */
.relations-graph {
    max-height: 150px;
    overflow-y: auto;
}

.relation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: white;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    animation: slideIn 0.3s ease;
}

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

.relation-subject, .relation-object {
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 4px;
    color: #3498db;
}

.relation-arrow {
    color: #666;
    font-weight: bold;
}

/* Statistiques */
.multihop-stats {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.multihop-stats h4 {
    color: #333;
    font-size: 14px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.multihop-stat-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
}

.multihop-stat-item:hover {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    transform: translateY(-2px);
}

.multihop-stat-label {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
}

.multihop-stat-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #3498db;
}

/* Bouton toggle Multi-hop */
.multihop-toggle-btn {
    background: #ed747000;
    color: rgb(2, 2, 2);
    border: none;
    padding: 15px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-right: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.2);
}

.multihop-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    background: #ed747000;
}

.multihop-toggle-btn.active {
    background: #3498db;
    color: white;
}

.multihop-toggle-btn .badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

/* Notification Multi-hop */
.multihop-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    background: #303D4E;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    transition: right 0.3s ease;
    max-width: 350px;
}

.multihop-notification.show {
    right: 20px;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.notification-content i {
    font-size: 20px;
    margin-bottom: 5px;
}

.notification-content small {
    opacity: 0.9;
    font-size: 11px;
}

/* Modal détails hop */
.modal .docs-list {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 12px;
}

.doc-item i {
    color: #3498db;
}

.doc-item .score {
    margin-left: auto;
    background: #61C276;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

/* Animation de chargement pour les hops */
@keyframes hopPulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

.hop-item.processing .hop-number {
    animation: hopPulse 2s infinite;
}

/* Scrollbar personnalisée */
.hops-timeline::-webkit-scrollbar,
.relations-graph::-webkit-scrollbar {
    width: 6px;
}

.hops-timeline::-webkit-scrollbar-track,
.relations-graph::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.hops-timeline::-webkit-scrollbar-thumb,
.relations-graph::-webkit-scrollbar-thumb {
    background: #303D4E;
    border-radius: 3px;
}

.hops-timeline::-webkit-scrollbar-thumb:hover,
.relations-graph::-webkit-scrollbar-thumb:hover {
    background: #303D4E;
}

/* Responsive */
@media (max-width: 768px) {
    .multihop-container {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .multihop-details {
        grid-template-columns: 1fr;
    }
}