/**
 * Estilos para Loading e Mensagens
 * Sistema de feedback visual para o usuário
 */

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.loading-content p {
    margin-top: 20px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* ===== Spinner ===== */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00a859;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Mensagens de Alerta ===== */
.mensagem-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.mensagem-alerta {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mensagem-alerta::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

/* Tipos de mensagem */
.mensagem-alerta.sucesso {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem-alerta.sucesso::before {
    background-color: #28a745;
}

.mensagem-alerta.erro {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensagem-alerta.erro::before {
    background-color: #dc3545;
}

.mensagem-alerta.aviso {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mensagem-alerta.aviso::before {
    background-color: #ffc107;
}

.mensagem-alerta.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.mensagem-alerta.info::before {
    background-color: #17a2b8;
}

/* ===== Animações ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ===== Responsividade ===== */
@media (max-width: 768px) {
    .mensagem-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .loading-content {
        padding: 30px 20px;
    }

    .mensagem-alerta {
        font-size: 13px;
        padding: 14px 16px;
    }
}

/* ===== Lista de Arquivos ===== */
#lista-arquivos {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.arquivo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.arquivo-item:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.arquivo-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.arquivo-icone {
    color: #6c757d;
    flex-shrink: 0;
}

.arquivo-detalhes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.arquivo-nome {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arquivo-tamanho {
    font-size: 12px;
    color: #6c757d;
}

.btn-remover-arquivo {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #dc3545;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remover-arquivo:hover {
    background-color: #dc3545;
    color: white;
}

.btn-remover-arquivo svg {
    display: block;
}

/* ===== Ações de Upload ===== */
#arquivos-acoes {
    display: none;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

#arquivos-acoes button {
    flex: 1;
    min-width: 150px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-more {
    background-color: #00a859;
    color: white;
}

.btn-add-more:hover {
    background-color: #008a48;
}

.btn-clear-all {
    background-color: #6c757d;
    color: white;
}

.btn-clear-all:hover {
    background-color: #545b62;
}

/* ===== Upload Dropzone ===== */
#upload-dropzone.dragover {
    background-color: #e7f5ef;
    border-color: #00a859;
}

#upload-dropzone.dragover .dropzone-content {
    transform: scale(1.02);
}
