/* === COMPONENTE DE UPLOAD MODERNO === */

/* ===========================
   TERMO DE RESPONSABILIDADE
   =========================== */

.termo-responsabilidade {
    margin-bottom: 2rem;
}

.termo-box {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.termo-box h4 {
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-align: center;
}

.termo-texto {
    background: white;
    border-left: 4px solid #0066cc;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
}

.termo-texto p {
    margin: 0 0 0.75rem 0;
}

.termo-texto p:last-child {
    margin-bottom: 0;
}

.termo-aceite {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 15px;
    border-radius: 8px;
    background: white;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.termo-aceite:hover {
    border-color: #00995d;
    background: #f0f9f5;
}

.termo-aceite input[type="checkbox"] {
    margin-top: 2px;
    min-width: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #00995d;
}

.termo-aceite span {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    user-select: none;
    line-height: 1.6;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.termo-aceite input[type="checkbox"]:checked + span {
    color: #00995d;
    font-weight: 600;
}

/* Upload desabilitado quando termo não aceito */
.upload-dropzone.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.upload-dropzone.disabled .dropzone-content {
    background: #e9ecef;
}

/* ======================== */

.upload-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e1e5e9;
    overflow: hidden;
    margin: 20px 0;
    transition: box-shadow 0.3s ease;
}

.upload-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.upload-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.upload-header h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    font-size: 16px;
}

.upload-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    background: rgba(23, 162, 184, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.info-icon {
    color: #17a2b8;
    flex-shrink: 0;
}

.upload-info strong {
    color: #495057;
}

/* DROPZONE */
.upload-dropzone {
    position: relative;
    margin: 24px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover {
    border-color: #00995d;
    background: #f0f9f4;
    transform: translateY(-2px);
}

.upload-dropzone.dragover {
    border-color: #00995d;
    background: #e6f7ed;
    box-shadow: inset 0 0 0 1px #00995d;
    transform: scale(1.02);
}

.dropzone-content {
    text-align: center;
    padding: 20px;
}

.upload-icon {
    color: #9ca3af;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

.upload-dropzone:hover .upload-icon {
    color: #00995d;
}

.dropzone-text .primary-text {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 8px 0;
}

.dropzone-text .secondary-text {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 16px 0;
}

.btn-select-files {
    background: linear-gradient(135deg, #00995d 0%, #00b366 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 153, 93, 0.2);
}

.btn-select-files:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 153, 93, 0.3);
    background: linear-gradient(135deg, #00b366 0%, #00995d 100%);
}

.btn-select-files:active {
    transform: translateY(0);
}

/* LISTA DE ARQUIVOS MELHORADA */
#lista-arquivos {
    margin: 0;
    padding: 0;
    border-radius: 0;
    min-height: auto;
}

.lista-arquivos-cabecalho {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    padding: 16px 24px;
    border-bottom: 1px solid #d4edda;
    margin: 0;
    border-radius: 0;
}

.lista-arquivos-cabecalho h4 {
    margin: 0;
    color: #155724;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lista-arquivos-cabecalho h4:before {
    content: '📁';
    font-size: 18px;
}

.arquivos-lista {
    border: none;
    border-radius: 0;
    background: white;
}

.arquivo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.arquivo-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.arquivo-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s ease;
}

.arquivo-item:hover:before {
    background: #00995d;
}

.arquivo-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.arquivo-nome {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.arquivo-status {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nome {
    color: #2d3748;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.extensao {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arquivo-detalhes {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.tamanho {
    font-weight: 600;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    color: #4a5568;
}

.erro {
    color: white;
    font-weight: 500;
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.btn-remover-arquivo {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.2);
}

.btn-remover-arquivo:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.3);
}

.btn-remover-arquivo:active {
    transform: scale(0.9) rotate(90deg);
}

.sem-arquivos {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px 24px;
    margin: 0;
    background: #f9fafb;
    border: none;
    font-size: 16px;
}

/* AÇÕES DE UPLOAD */
.upload-actions {
    background: #f8f9fa;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-add-more {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

.btn-add-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-clear-all {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(160, 174, 192, 0.2);
}

.btn-clear-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(160, 174, 192, 0.3);
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
}

/* ANIMAÇÕES E TRANSIÇÕES */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* RESPONSIVIDADE AVANÇADA */
@media (max-width: 768px) {
    .upload-header {
        padding: 16px;
    }
    
    .upload-dropzone {
        margin: 16px;
        min-height: 140px;
    }
    
    .dropzone-content {
        padding: 16px;
    }
    
    .dropzone-text .primary-text {
        font-size: 16px;
    }
    
    .btn-select-files {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .arquivo-item {
        padding: 16px;
    }
    
    .nome {
        max-width: 180px;
    }
    
    .arquivo-detalhes {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .upload-actions {
        padding: 16px;
        flex-direction: column;
    }
    
    .btn-add-more,
    .btn-clear-all {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .upload-header h4 {
        font-size: 16px;
    }
    
    .upload-info {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .dropzone-text .primary-text {
        font-size: 14px;
    }
    
    .nome {
        max-width: 120px;
    }
}

.lista-arquivos-cabecalho {
    background: #f8f9fa;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.lista-arquivos-cabecalho h4 {
    margin: 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.arquivos-lista {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: white;
}

.arquivo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.arquivo-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.arquivo-item:hover {
    background-color: #f8f9fa;
}

.arquivo-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.arquivo-nome {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.arquivo-status {
    font-size: 16px;
}

.nome {
    color: #333;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.extensao {
    background: #e9ecef;
    color: #6c757d;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.arquivo-detalhes {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.tamanho {
    font-weight: 600;
}

.erro {
    color: #dc3545;
    font-weight: 500;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 3px;
}

.btn-remover-arquivo {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remover-arquivo:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-remover-arquivo:active {
    transform: scale(0.95);
}

.sem-arquivos {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
    margin: 0;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
}

/* Animações para mensagens */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Botão adicionar mais arquivos */
.btn-adicionar-arquivos {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 10px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-adicionar-arquivos:hover {
    background: #218838;
    transform: scale(1.05);
}

.btn-adicionar-arquivos:active {
    transform: scale(0.95);
}

/* Responsividade */
@media (max-width: 768px) {
    .arquivo-item {
        padding: 12px;
    }
    
    .nome {
        max-width: 150px;
    }
    
    .arquivo-detalhes {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .arquivos-acoes {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-adicionar-arquivos {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* Estilos adicionais para arquivo-icon e btn-remover-arquivo */
.arquivo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.arquivo-icon svg {
    width: 24px;
    height: 24px;
}

.arquivo-info {
    flex: 1;
    min-width: 0;
}

.arquivo-nome {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.arquivo-size {
    font-size: 12px;
    color: #718096;
}

.btn-remover-arquivo {
    background: transparent;
    border: none;
    color: #dc3545;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-remover-arquivo:hover {
    background: #fee;
    color: #c82333;
    transform: scale(1.1);
}

.btn-remover-arquivo svg {
    width: 16px;
    height: 16px;
}

/* Animação fadeIn */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}