/**
 * LLMUI Entreprise v1.1 - Upload Styles
 * Copyright © 2026 Nexios TF inc. - nexiostf.com
 * 
 * Styles pour l'upload de fichiers
 */

/* Zone de preview des fichiers */
.upload-preview-zone {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.upload-preview-zone:empty {
    display: none;
}

/* Preview d'un fichier */
.file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.file-preview:hover {
    background: rgba(255, 255, 255, 0.08);
}

.file-preview.uploading {
    opacity: 0.7;
}

.file-preview.uploaded {
    border-color: rgba(46, 213, 115, 0.4);
    background: rgba(46, 213, 115, 0.05);
}

.file-preview.error {
    border-color: rgba(255, 71, 87, 0.4);
    background: rgba(255, 71, 87, 0.05);
}

/* Icône du fichier */
.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Info du fichier */
.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary, #8b949e);
    margin-top: 0.25rem;
}

/* Status du fichier */
.file-status {
    flex-shrink: 0;
}

.status-icon {
    font-size: 1rem;
}

.file-preview.uploading .status-icon {
    animation: spin 1s linear infinite;
}

.file-preview.uploaded .status-icon {
    color: #2ed573;
}

.file-preview.error .status-icon {
    color: #ff4757;
}

/* Bouton de suppression */
.file-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary, #8b949e);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

.file-remove:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

/* Drag & Drop state */
.messages-area.drag-active {
    position: relative;
}

.messages-area.drag-active::before {
    content: "📎 Déposez vos fichiers ici";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(88, 166, 255, 0.1);
    border: 2px dashed #58a6ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #58a6ff;
    font-weight: 500;
    z-index: 100;
    pointer-events: none;
}

/* Bouton de fichier dans l'input */
#fileBtn {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Ajuster l'input wrapper pour le bouton fichier */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.input-wrapper #fileBtn {
    margin-right: 0;
}

/* Animation de rotation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar pour la zone de preview */
.upload-preview-zone::-webkit-scrollbar {
    width: 6px;
}

.upload-preview-zone::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.upload-preview-zone::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.upload-preview-zone::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Workspace Files Preview */
.attached-workspace-files-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(88, 166, 255, 0.05);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.attached-workspace-files-preview .preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #58a6ff;
}

.attached-workspace-files-preview .btn-clear-workspace-files {
    background: transparent;
    border: none;
    color: var(--text-secondary, #8b949e);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.attached-workspace-files-preview .btn-clear-workspace-files:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.attached-workspace-files-preview .preview-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attached-workspace-files-preview .preview-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.attached-workspace-files-preview .preview-file-item .file-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.attached-workspace-files-preview .preview-file-item .file-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attached-workspace-files-preview .preview-file-item .file-size {
    font-size: 0.75rem;
    color: var(--text-secondary, #8b949e);
    flex-shrink: 0;
}

/* Workspace Operations Notifications */
.workspace-operations-notification {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(88, 166, 255, 0.05);
    border-left: 3px solid #58a6ff;
    border-radius: 6px;
    animation: slideIn 0.3s ease-out;
}

.workspace-operations-notification .operations-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #58a6ff;
}

.workspace-operations-notification .operations-icon {
    font-size: 1.25rem;
}

.workspace-operations-notification .operations-title {
    font-size: 0.95rem;
}

.workspace-operations-notification .operations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.operation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.operation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.operation-item .op-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.operation-item .op-type {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #58a6ff;
    flex-shrink: 0;
    min-width: 60px;
}

.operation-item .op-path {
    flex: 1;
    color: var(--text-primary, #fff);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operation-item .op-status {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.operation-item .op-status.success {
    color: #2ed573;
    background: rgba(46, 213, 115, 0.1);
}

.operation-item .op-status.error {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.operation-item.operation-error {
    border-left: 2px solid #ff4757;
}

.operation-item.operation-success {
    border-left: 2px solid #2ed573;
}

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

/* Responsive */
@media (max-width: 768px) {
    .upload-preview-zone {
        max-height: 150px;
    }

    .file-preview {
        padding: 0.5rem;
    }

    .file-icon {
        font-size: 1.25rem;
    }

    .file-name {
        font-size: 0.85rem;
    }

    .file-size {
        font-size: 0.7rem;
    }

    .attached-workspace-files-preview {
        max-height: 150px;
    }

    .workspace-operations-notification {
        padding: 0.75rem;
    }

    .operation-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .operation-item .op-path {
        flex-basis: 100%;
        order: 3;
    }
}
