/**
 * Car Drive Management - CSS para Upload de Documentos
 * Estilos para interface de upload de arquivos
 */

/* Container principal do upload */
.file-upload {
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

/* Área de upload */
.upload-area {
    position: relative;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(0, 124, 186, 0.05);
}

.upload-area.drag-hover {
    background: rgba(0, 124, 186, 0.1);
    border-color: #007cba;
    transform: scale(1.02);
}

/* Input de arquivo (oculto) */
.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

/* Prompt de upload */
.upload-prompt {
    pointer-events: none;
}

.upload-prompt i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: block;
}

.upload-prompt p {
    font-size: 1.1rem;
    color: #495057;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.upload-prompt small {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Lista de arquivos enviados */
.uploaded-files {
    margin-top: 1rem;
}

.uploaded-files:empty::before {
    content: "Nenhum documento enviado";
    color: #6c757d;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 1rem;
}

/* Item de arquivo */
.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

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

.file-item.deleting {
    opacity: 0.5;
    pointer-events: none;
}

.file-item.progress-item {
    background: #f8f9fa;
    border-color: #007cba;
}

/* Ícone do arquivo */
.file-icon {
    flex: 0 0 40px;
    margin-right: 0.75rem;
    text-align: center;
}

.file-icon i {
    font-size: 1.5rem;
    color: #007cba;
}

.icon-file-pdf {
    color: #dc3545 !important;
}

.icon-file-image {
    color: #28a745 !important;
}

/* Informações do arquivo */
.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-status {
    font-size: 0.875rem;
    color: #007cba;
    font-weight: 500;
}

/* Ações do arquivo */
.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #495057;
}

.preview-file:hover {
    background: #e7f3ff;
    color: #007cba;
}

.delete-file:hover {
    background: #f8d7da;
    color: #dc3545;
}

/* Barra de progresso */
.file-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 4px;
    background: #007cba;
    border-radius: 2px;
    transition: width 0.3s ease;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e9ecef;
    z-index: -1;
}

.progress-text {
    font-size: 0.75rem;
    color: #6c757d;
    min-width: 35px;
    text-align: right;
}

/* Alertas de upload */
.upload-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.upload-alert.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-alert.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* Estado vazio */
.no-files {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    margin: 0;
}

/* Ícones emoji para melhor compatibilidade */
.file-icon {
    font-size: 1.5rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-prompt i {
        font-size: 2rem;
    }
    
    .upload-prompt p {
        font-size: 1rem;
    }
    
    .file-item {
        padding: 0.5rem;
    }
    
    .file-icon {
        flex: 0 0 32px;
        margin-right: 0.5rem;
    }
    
    .file-icon {
        font-size: 1.25rem;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
}

/* Estados de validação */
.file-upload.has-error {
    border-color: #dc3545;
    background: #f8f9fa;
}

.file-upload.has-success {
    border-color: #28a745;
    background: #f8f9fa;
}

/* Loading state */
.file-upload.loading .upload-area {
    pointer-events: none;
    opacity: 0.7;
}

.file-upload.loading .upload-prompt::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Melhorias de acessibilidade */
.upload-area:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.btn-icon:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Emoji fallbacks */
.icon-upload::before { content: "📁"; }
.icon-eye::before { content: "👁"; }
.icon-trash::before { content: "🗑"; }
.icon-file::before { content: "📄"; }
.icon-file-pdf::before { content: "📄"; }
.icon-file-image::before { content: "🖼"; }