/* Estilos Generales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    font-size: 2.8em;
    color: #2c2c2c;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    color: #666;
}

/* Galería de PDFs */
.pdf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 40px 0;
}

.pdf-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--animation-order) * 0.15s);
}

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

.pdf-card-category {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.category-manual {
    background-color: #e0f2f7; /* Light Blue */
    color: #2196f3; /* Blue */
}

.category-informe {
    background-color: #e8f5e9; /* Light Green */
    color: #4caf50; /* Green */
}

.category-catalogo {
    background-color: #f3e5f5; /* Light Purple */
    color: #9c27b0; /* Purple */
}

.category-monitoreo {
    background-color: #fff3e0; /* Light Orange */
    color: #ff9800; /* Orange */
}

.category-documento {
    background-color: #f5f5f5; /* Light Gray */
    color: #757575; /* Gray */
}

.pdf-card-title {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 5px;
}

.pdf-card-description {
    font-size: 0.9em;
    color: #777;
}

.pdf-card-content {
    padding: 10px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.pdf-card-size {
    font-size: 0.85em;
    color: #999;
}

.pdf-card-button {
    background-color: #e0e0e0; /* Light Gray */
    color: #555; /* Darker Gray */
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pdf-card-button:hover {
    background-color: #d0d0d0; /* Slightly Darker Gray on Hover */
    color: #333;
    border-color: #bbb;
}

/* Footer */
footer {
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
    color: #777;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.03);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #555; /* Darker gray spinner */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Estilos para las previsualizaciones */
.pdf-preview-container {
    height: 200px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    position: relative;
}

.pdf-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pdf-card:hover .pdf-preview {
    transform: scale(1.05);
}

.pdf-preview-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.03);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-card:hover .pdf-preview-container::after {
    opacity: 1;
}

/* Ajustes para mantener la estructura */
.pdf-card-header {
    padding: 20px;
    padding-bottom: 10px;
    flex-grow: 1;
}

/* Ajustar altura de tarjetas */
.pdf-card {
    min-height: 450px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1em;
    }

    .pdf-gallery {
        grid-template-columns: 1fr;
    }

    .pdf-card-title {
        font-size: 1.2em;
    }

    .pdf-card-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .pdf-preview-container {
        height: 160px;
    }
}

/* Animación reducida para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .pdf-card {
        animation: fadeIn 0.5s ease-out forwards !important;
        animation-delay: 0s !important;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}