/**
 * 🌳 STYLES - ARBRES DE CONNAISSANCES HIÉRARCHIQUES
 * Inspiré de ragApi, adapté au design de OpFlow Police
 */

/* Container global */
#knowledge-tree-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#knowledge-tree-container.visible {
    display: flex;
}

.knowledge-tree-wrapper {
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.knowledge-tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #293F50;
    border-bottom: none;
    color: white;
}

.knowledge-tree-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}


.knowledge-tree-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.knowledge-tree-controls select {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.knowledge-tree-controls select option {
    background: #3B4858;
    color: white;
}

.knowledge-tree-controls .btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.knowledge-tree-controls .btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #DC714A;
}

.knowledge-tree-controls .btn-primary:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.knowledge-tree-controls .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.knowledge-tree-controls .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.knowledge-tree-controls .btn-icon {
    background: transparent;
    color: white;
    padding: 0.5rem;
    min-width: auto;
}

.knowledge-tree-controls .btn-icon:hover {
    background: #293F50;
}

/* Content layout */
.knowledge-tree-content {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.tree-panel,
.details-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tree-panel {
    border-right: 1px solid #e0e0e0;
    background: #fafafa;
}

.details-panel {
    background: white;
}

/* Tree view (left panel) */
.tree-view {
    overflow-y: auto;
    padding: 1.5rem;
    flex: 1;
}

/* Tree statistics */
.tree-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tree-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #DC714A;
}

.tree-stats .stat-item i {
    font-size: 1.1rem;
}

/* Tree node */
.tree-node {
    margin-left: 0;
}

.tree-node.level-1 {
    margin-left: 20px;
}

.tree-node.level-2 {
    margin-left: 40px;
}

.tree-node.level-3 {
    margin-left: 60px;
}

.tree-node.level-4 {
    margin-left: 80px;
}

/* Node header */
.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tree-node-header:hover {
    background-color: var(--hover-bg, #f0f0f0);
}

.tree-node-header.selected {
    background-color: var(--selected-bg, #e3f2fd);
    border-left: 3px solid var(--primary-color, #2196F3);
}

/* Expand icon */
.expand-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.expand-icon.collapsed {
    transform: rotate(0deg);
}

.expand-icon:not(.collapsed) {
    transform: rotate(0deg);
}

.expand-icon.empty {
    opacity: 0.3;
    cursor: default;
}

/* Node type icon */
.node-type-icon {
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Node title */
.tree-node-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #333);
}

.tree-node.level-0 .tree-node-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color, #2196F3);
}

.tree-node.level-1 .tree-node-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.tree-node.level-3 .tree-node-title {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary, #666);
}

/* Node badge */
.tree-node-badge {
    padding: 0.25rem 0.5rem;
    background-color: var(--badge-bg, #e0e0e0);
    color: var(--badge-text, #666);
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.tree-node.level-0 .tree-node-badge {
    background-color: var(--primary-color, #2196F3);
    color: white;
}

.tree-node.level-1 .tree-node-badge {
    background-color: var(--accent-color, #DC714A);
    color: white;
}

/* Children container */
.tree-node-children {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.tree-node-children.collapsed {
    max-height: 0;
    transition: max-height 0.2s ease-in;
}

/* Node details panel (right side) */
.node-details {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.node-details-content {
    animation: fadeIn 0.3s ease;
}

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

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    gap: 1rem;
    overflow: hidden;
}

.node-level-badge {
    padding: 0.375rem 0.75rem;
    background: #DC714A;
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    white-space: nowrap;
}

.node-details .placeholder {
    color: var(--text-secondary, #999);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.node-details-content h4 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary, #333);
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.node-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light, #f9f9f9);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    border: 1px solid var(--border-light, #eee);
}

.node-summary h5 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: var(--text-primary, #333);
    font-weight: 600;
}

.node-summary p {
    margin: 0;
    line-height: 1.7;
    color: #555;
    font-size: 0.95rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.node-metadata {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.node-metadata h5 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-grid {
    display: grid;
    gap: 0.5rem;
}

.metadata-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.375rem 0;
}

.metadata-key {
    font-weight: 600;
    color: #DC714A;
    min-width: 120px;
}

.metadata-value {
    color: #666;
    word-break: break-word;
}

.node-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Loading state */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading .spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 1.5rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #DC714A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading p {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Placeholder */
.placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
    font-style: italic;
}

/* Error state */
.error {
    color: var(--error-color, #f44336);
    padding: 1rem;
    text-align: center;
}

/* Buttons dans le panneau de détails */
.node-actions .btn-sm {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.node-actions .btn-sm.btn-primary {
    background: #3498db;
    color: white;
    border: none;
}

.node-actions .btn-sm.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.node-actions .btn-sm.btn-secondary {
    background: white;
    color: #3498db;
    border: 1px solid #3498db;
}

.node-actions .btn-sm.btn-secondary:hover {
    background: #3498db;
    color: white;
}

/* Responsive design */
@media (max-width: 1024px) {
    .knowledge-tree-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 400px;
    }

    .node-details {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .knowledge-tree-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .knowledge-tree-controls {
        width: 100%;
        justify-content: space-between;
    }

    .knowledge-tree-content {
        grid-template-rows: 1fr 300px;
    }
}

/* Scrollbar styling */
.tree-view::-webkit-scrollbar,
.node-details::-webkit-scrollbar,
.node-summary p::-webkit-scrollbar {
    width: 8px;
}

.tree-view::-webkit-scrollbar-track,
.node-details::-webkit-scrollbar-track,
.node-summary p::-webkit-scrollbar-track {
    background: var(--bg-light, #f1f1f1);
}

.tree-view::-webkit-scrollbar-thumb,
.node-details::-webkit-scrollbar-thumb,
.node-summary p::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #888);
    border-radius: 4px;
}

.tree-view::-webkit-scrollbar-thumb:hover,
.node-details::-webkit-scrollbar-thumb:hover,
.node-summary p::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover, #555);
}

/* Accessibility */
.tree-node-header:focus {
    outline: 2px solid var(--primary-color, #3498db);
    outline-offset: 2px;
}

.expand-icon:focus {
    outline: 2px solid var(--primary-color, #3498db);
    outline-offset: 1px;
    border-radius: 2px;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tree-node-children:not(.collapsed) {
    animation: slideDown 0.3s ease-out;
}

/* Color scheme variants */
.knowledge-tree-content.dark-mode {
    --background-primary: #1e1e1e;
    --background-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --hover-bg: #3a3a3a;
    --selected-bg: #264f78;
}

.knowledge-tree-content.dark-mode .tree-view,
.knowledge-tree-content.dark-mode .node-details {
    background: var(--background-primary);
    color: var(--text-primary);
}

/* Search results */
.search-results {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.search-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-count {
    padding: 0.25rem 0.75rem;
    background: #DC714A;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    padding: 1rem;
    background: #f8f9fa;
    border-left: 3px solid #DC714A;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: #f0f2f5;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-index {
    font-weight: 600;
    color: #DC714A;
    font-size: 0.85rem;
}

.result-score {
    font-size: 0.75rem;
    color: #666;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.result-content {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #333;
    font-size: 0.9rem;
}

.result-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-style: italic;
}

/* Q&A Answer Styles */
.qa-answer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #DC714A;
}

.qa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.qa-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-badge {
    padding: 0.25rem 0.75rem;
    background: #DC714A;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.qa-question {
    background: #f0f4ff;
    padding: 1rem;
    border-left: 4px solid #DC714A;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.qa-question strong {
    color: #DC714A;
    display: block;
    margin-bottom: 0.5rem;
}

.qa-question p {
    margin: 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.6;
}

.qa-response {
    background: #f8f9fa;
    padding: 1.25rem;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.qa-response strong {
    color: #28a745;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.qa-response p {
    margin: 0;
    color: #222;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.qa-sources {
    margin-top: 1.5rem;
}

.qa-sources h6 {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.source-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.source-item:hover {
    border-color: #DC714A;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.source-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.source-index {
    font-weight: 700;
    color: #DC714A;
    font-size: 0.85rem;
    min-width: 28px;
}

.source-file {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.source-page {
    font-size: 0.8rem;
    color: #666;
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.source-score-kg {
    font-size: 0.75rem;
    color: #999;
    margin-left: auto;
}

.source-content {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    padding-left: 36px;
}

/* Button outline style */
.btn-sm.btn-outline {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.btn-sm.btn-outline:hover {
    background: #f8f9fa;
    border-color: #DC714A;
    color: #DC714A;
}

/* ========================================
   CHAT INTERFACE - Remplace les modals
   ======================================== */

.knowledge-tree-chat-panel {
    position: fixed;
    right: -50vw;
    top: 0;
    bottom: 0;
    width: 50vw;
    background: #ffffff;
    border-left: 1px solid var(--kt-border-color);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transition: right 0.3s ease;
}

.knowledge-tree-chat-panel.open {
    right: 0;
}

.chat-header {
    padding: 20px;
    background: #293F50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-node-context {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.chat-close-btn {
    background: #293F50;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user .message-content {
    background: var(--kt-node-theme, #3498db);
    color: white;
    margin-left: auto;
    border-radius: 18px 18px 4px 18px;
}

.chat-message.assistant .message-content {
    background: white;
    color: var(--kt-text-primary);
    border: 1px solid var(--kt-border-color);
    border-radius: 18px 18px 18px 4px;
}

.chat-message.system .message-content {
    background: #f8f9fa;
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    border-radius: 12px;
    padding: 8px 16px;
}

.message-content {
    padding: 12px 16px;
    max-width: 100%;
    display: inline-block;
    word-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--kt-text-secondary);
    font-size: 13px;
    padding: 8px 12px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: thinking 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.chat-sources {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--kt-node-theme, #3498db);
}

.chat-sources-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--kt-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-source-item {
    padding: 8px;
    margin: 6px 0;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 12px;
    transition: all 0.2s;
}

.chat-source-item:hover {
    border-color: var(--kt-node-theme, #3498db);
    transform: translateX(4px);
}

.chat-source-file {
    font-weight: 600;
    color: var(--kt-node-theme, #3498db);
    display: block;
    margin-bottom: 4px;
}

.chat-source-score {
    display: inline-block;
    padding: 2px 6px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
}

.chat-source-preview {
    color: var(--kt-text-secondary);
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--kt-border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--kt-border-color);
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--kt-node-theme, #3498db);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--kt-node-theme, #3498db);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--kt-node-theme-dark, #2980b9);
    transform: scale(1.1);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

.chat-new-conversation-btn {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    background: #f8f9fa;
    border: 1px dashed var(--kt-border-color);
    border-radius: 8px;
    color: var(--kt-text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-new-conversation-btn:hover {
    background: white;
    border-color: var(--kt-node-theme, #3498db);
    color: var(--kt-node-theme, #3498db);
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--kt-border-color);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* ========================================
   Modal d'input pour la recherche
   ======================================== */

.kt-input-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
}

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

.kt-input-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

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

.kt-input-modal h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.kt-input-modal p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 0.95rem;
}

.kt-input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.kt-input-field:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.kt-input-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.kt-input-modal-buttons .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-weight: 500;
}

.kt-input-modal-buttons .btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.kt-input-modal-buttons .btn-secondary:hover {
    background: #d0d0d0;
}

.kt-input-modal-buttons .btn-primary {
    background: #4a90e2;
    color: white;
}

.kt-input-modal-buttons .btn-primary:hover {
    background: #357abd;
}

/* Animation du spinner pour le loader */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
