/* ============================================ */
/* VARIABLES GLOBALES */
/* ============================================ */
:root {
    --primary: rgba(4, 10, 52, 0.95);
    --primary-dark: rgba(4, 10, 52, 0.95);
    --secondary: #f1c40f;
    --gray-light: #f8f9fa;
    --gray: #6c757d;
    --text-dark: #2c3e50;
    --border-radius: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}



/* ============================================ */
/* CONTENEDOR PRINCIPAL - MOBILE FIRST */
/* ============================================ */
.documentos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 1rem 2rem;
}

/* ============================================ */
/* HEADER */
/* ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.6rem;
    color: var(--primary);
}

.section-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ============================================ */
/* FILTROS - MOBILE FIRST */
/* ============================================ */
.filtros-wrapper {
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eef2f5;
    padding: 1rem;
}

.filtros-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filtro-group {
    width: 100%;
}

.filtro-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtro-group select,
.filtro-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    font-size: 0.85rem;
    transition: var(--transition);
}

/* BÚSQUEDA MEJORADA */
.search-group {
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 0.85rem;
}

.search-input-wrapper input {
    padding-left: 2.2rem;
}

/* ============================================ */
/* RESULTADOS */
/* ============================================ */
.resultados-busqueda {
    background: #e8f0fe;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.resultados-busqueda .limpiar-busqueda {
    margin-left: auto;
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.7rem;
}

/* ============================================ */
/* LISTA DOCUMENTOS - MOBILE FIRST */
/* ============================================ */
.documentos-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.documento-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    border: 1px solid #eef2f5;
    border-radius: 20px;
    padding: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.3s ease-out;
}

.documento-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.doc-icon {
    text-align: center;
}

.doc-icon i {
    font-size: 2rem;
    color: #e74c3c;
}

.doc-info {
    flex: 1;
}

.doc-info h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.badge-destacado {
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 0.6rem;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    margin-left: 0.4rem;
    display: inline-block;
}

.doc-info p {
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* META */
.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.doc-meta span {
    background: #f0f2f5;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ACCIONES */
.doc-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
}

.btn-doc {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    text-align: center;
    transition: var(--transition);
}

.btn-doc.secundario {
    background: #ecf0f1;
    color: var(--text-dark);
}

.btn-doc:hover {
    opacity: 0.85;
}

/* VACÍO */
.no-documentos {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    background: var(--gray-light);
    border-radius: 20px;
}

.no-documentos i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-documentos p {
    font-size: 0.85rem;
}

/* ============================================ */
/* LOADER */
/* ============================================ */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
    z-index: 1000;
}

.loader-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e4e8;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ANIMACIÓN */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================ */
/* TABLETS (768px - 1024px) */
/* ============================================ */
@media (min-width: 768px) {
    .documentos-container {
        padding: 110px 1.5rem 3rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
    
    .filtros-wrapper {
        padding: 1.25rem;
    }
    
    .filtros-form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filtro-group {
        flex: 1;
        min-width: 180px;
    }
    
    .documento-card {
        flex-direction: row;
        gap: 1.2rem;
        padding: 1.2rem;
    }
    
    .doc-icon {
        text-align: left;
    }
    
    .doc-icon i {
        font-size: 2.2rem;
    }
    
    .doc-info h3 {
        font-size: 1.05rem;
    }
    
    .doc-actions {
        flex-direction: column;
        justify-content: center;
    }
    
    .btn-doc {
        flex: none;
        padding: 0.45rem 1rem;
        font-size: 0.75rem;
    }
}

/* ============================================ */
/* DESKTOP (1024px - 1440px) */
/* ============================================ */
@media (min-width: 1024px) {
    .documentos-container {
        padding: 120px 2rem 4rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .filtros-form {
        flex-wrap: nowrap;
    }
    
    .filtro-group {
        min-width: 160px;
    }
    
    .search-group {
        flex: 2;
    }
    
    .documento-card {
        padding: 1.5rem;
    }
    
    .doc-info h3 {
        font-size: 1.15rem;
    }
    
    .doc-meta span {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
}

/* ============================================ */
/* PANTALLAS GRANDES (1440px+) */
/* ============================================ */
@media (min-width: 1440px) {
    .documentos-container {
        max-width: 1400px;
        padding: 130px 2rem 5rem;
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .doc-info h3 {
        font-size: 1.25rem;
    }
    
    .doc-info p {
        font-size: 0.9rem;
    }
}

/* ============================================ */
/* MÓVILES PEQUEÑOS (hasta 480px) */
/* ============================================ */
@media (max-width: 480px) {
    .documentos-container {
        padding: 90px 0.8rem 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .section-header p {
        font-size: 0.8rem;
    }
    
    .filtros-wrapper {
        padding: 0.8rem;
    }
    
    .filtro-group select,
    .filtro-group input {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .documento-card {
        padding: 0.8rem;
    }
    
    .doc-info h3 {
        font-size: 0.95rem;
    }
    
    .badge-destacado {
        font-size: 0.55rem;
        padding: 0.1rem 0.35rem;
    }
    
    .doc-info p {
        font-size: 0.75rem;
    }
    
    .doc-meta span {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
    
    .btn-doc {
        font-size: 0.65rem;
        padding: 0.35rem 0.6rem;
    }
}

/* ============================================ */
/* MEJORAS DE ACCESIBILIDAD TÁCTIL */
/* ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn-doc, 
    .filtro-group select,
    .filtro-group input,
    .search-group button,
    .limpiar-filtro,
    .limpiar-busqueda {
        min-height: 44px;
    }
    
    .documento-card:hover {
        transform: none;
    }
}

