/**
 * Estilos para Sistema de Anexos Categorizados
 * Interface de upload e visualização por categoria
 */

/* ========================================
   CONTAINER PRINCIPAL
======================================== */

.anexos-categorias-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.anexos-categorias-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

/* ========================================
   TABS DE CATEGORIAS
======================================== */

.categorias-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.categoria-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.categoria-tab:hover {
    background: #e8e8e8;
    border-color: #d0d0d0;
}

.categoria-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tab-icone {
    font-size: 20px;
    line-height: 1;
}

.tab-nome {
    font-size: 14px;
}

.tab-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.categoria-tab:not(.active) .tab-badge {
    background: #667eea;
    color: white;
}

/* ========================================
   CONTEÚDO DA CATEGORIA
======================================== */

.categoria-conteudo {
    padding: 20px 0;
}

.categoria-header {
    margin-bottom: 20px;
}

.categoria-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.categoria-descricao {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.categoria-formatos {
    margin: 5px 0;
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* ========================================
   ÁREA DE UPLOAD
======================================== */

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
}

.upload-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.upload-hint {
    margin: 15px 0 0 0;
    color: #999;
    font-size: 13px;
}

/* ========================================
   LISTA DE ANEXOS
======================================== */

.anexos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.empty-anexos {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 12px;
}

.empty-anexos p {
    margin: 0;
    color: #999;
    font-size: 14px;
}

/* ========================================
   CARD DE ANEXO
======================================== */

.anexo-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.anexo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

/* Preview */
.anexo-preview {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.anexo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arquivo-icone {
    font-size: 60px;
    opacity: 0.3;
}

/* Info */
.anexo-info {
    padding: 15px;
    flex: 1;
}

.anexo-info h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.anexo-meta {
    margin: 5px 0;
    color: #999;
    font-size: 12px;
}

.anexo-descricao {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Ações */
.anexo-acoes {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.btn-anexo {
    flex: 1;
    padding: 8px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-anexo:hover {
    transform: scale(1.1);
}

.btn-download:hover {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.btn-delete:hover {
    background: #f44336;
    border-color: #f44336;
    color: white;
}

/* ========================================
   RESPONSIVIDADE
======================================== */

@media (max-width: 768px) {
    .categorias-tabs {
        flex-direction: column;
    }

    .categoria-tab {
        width: 100%;
        justify-content: space-between;
    }

    .anexos-lista {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .upload-button {
        width: 100%;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .anexos-categorias-container {
        padding: 15px;
    }

    .categoria-tab {
        padding: 10px 15px;
    }

    .tab-nome {
        font-size: 13px;
    }

    .anexo-preview {
        height: 150px;
    }
}

/* ========================================
   ANIMAÇÕES
======================================== */

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

.anexo-card {
    animation: slideIn 0.3s ease-out;
}

/* Delay progressivo */
.anexo-card:nth-child(1) { animation-delay: 0s; }
.anexo-card:nth-child(2) { animation-delay: 0.05s; }
.anexo-card:nth-child(3) { animation-delay: 0.1s; }
.anexo-card:nth-child(4) { animation-delay: 0.15s; }
.anexo-card:nth-child(5) { animation-delay: 0.2s; }
.anexo-card:nth-child(6) { animation-delay: 0.25s; }

/* Upload Progress (para implementação futura) */
.upload-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
    transition: width 0.3s ease;
}

/* Drag and Drop States */
.upload-area.drag-over {
    border-color: #4caf50;
    background: linear-gradient(135deg, #4caf5015 0%, #66bb6a15 100%);
}

/* ========================================
   BADGE DE STATUS
======================================== */

.categoria-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completo {
    background: #4caf50;
    color: white;
}

.status-parcial {
    background: #ff9800;
    color: white;
}

.status-vazio {
    background: #e0e0e0;
    color: #999;
}

/* ========================================
   RESUMO DE ANEXOS
======================================== */

.anexos-resumo {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.resumo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.resumo-icone {
    font-size: 18px;
}

.resumo-texto {
    font-size: 13px;
    color: #666;
}

.resumo-numero {
    font-weight: 700;
    color: #333;
}
