@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* RESET Y ESTILOS GENERALES */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    list-style: none;
}

/* ANIMACIONES CONSISTENTES CON EL SITIO */
@keyframes fadeIn {
    0% {
        opacity: 0;
        visibility: hidden;
    }
    100% {
        opacity: 1;
        visibility: visible;
    }
}

@keyframes fadeBackground {
    0% {opacity: 1;}
    50% {opacity: 1;}
    100% {opacity: 0.2;}
}

body::after {
    animation: fadeBackground 4s ease-in-out;
}

body > * {
    animation: fadeIn 2s ease-in-out 2s forwards; 
    visibility: hidden; 
    animation-fill-mode: forwards;
}

/* El modal NO debe estar afectado por la animación del body */
.pdf-modal {
    visibility: visible !important;
    animation: none !important;
}

/* FONDO ANIMADO CON LOGO */
body::after {
    content: "";
    background-image: url('https://imposurimgs.s3.us-east-2.amazonaws.com/Logosuniversales/ANIMADO+GIF.gif');
    background-repeat: no-repeat;
    background-size: 20%;
    background-position: center;
    background-attachment: absolute;
    opacity: 0.15;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    z-index: -2;
}

/* ================================
   HEADER SECTION
================================ */
.legal-header {
    padding: 40px 0 30px;
    background: linear-gradient(135deg, #29A4DA 0%, #22b8f0 100%);
    color: white;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.logo-header {
    max-width: 250px;
    height: auto;
    filter: brightness(0) invert(1);
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: left;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.95;
    text-align: left;
    margin-bottom: 0;
}

/* ================================
   LEGAL CONTENT
================================ */
.legal-content {
    padding: 30px 0 50px;
}

.legal-category {
    margin-bottom: 50px;
    padding: 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.legal-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #91B635;
}

.category-icon {
    font-size: 2rem;
    color: #29A4DA;
    margin-right: 15px;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* ================================
   DOCUMENTS GRID
================================ */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.document-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #91B635;
    transition: all 0.3s ease;
    gap: 15px;
}

.document-card:hover {
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateX(5px);
    border-left-color: #29A4DA;
}

.document-icon {
    font-size: 2.5rem;
    color: #29A4DA;
    min-width: 50px;
    text-align: center;
    transition: transform 0.3s ease;
}

.document-card:hover .document-icon {
    transform: scale(1.1);
    color: #91B635;
}

.document-info {
    flex: 1;
    min-width: 200px;
}

.document-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.document-date {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* ================================
   DOWNLOAD BUTTON
================================ */
.download-btn {
    background: linear-gradient(135deg, #91B635 0%, #7da028 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(145, 182, 53, 0.3);
    white-space: nowrap;
}

.download-btn:hover {
    background: linear-gradient(135deg, #29A4DA 0%, #22b8f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 164, 218, 0.4);
    color: white;
    text-decoration: none;
}

.download-btn i {
    font-size: 1rem;
}

.download-btn span {
    font-size: 0.9rem;
}

/* ================================
   NAVIGATION BUTTONS
================================ */
.navigation-section {
    padding: 40px 0 30px;
    /*background: #f8f9fa;*/
}

.nav-button {
    background-color: #91B635;
    color: white;
    border: none;
    padding: 15px 30px;
    text-decoration: none;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 10px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(145, 182, 53, 0.3);
}

.nav-button:hover {
    background-color: #29A4DA;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(41, 164, 218, 0.4);
}

.nav-button i {
    margin-right: 8px;
}

/* ================================
   FOOTER
================================ */
footer {
    background-color: #22b8f0;
    color: #fff;
    font-size: 16px;
    text-align: center;
    padding: 20px 8px;
    width: 100%;
    flex-shrink: 0;
}

/* ================================
   RESPONSIVE DESIGN
================================ */

/* Tablets */
@media (max-width: 992px) {
    .main-title {
        font-size: 2rem;
        text-align: center;
    }

    .subtitle {
        font-size: 1rem;
        text-align: center;
    }

    .logo-header {
        max-width: 200px;
        margin: 0 auto 20px;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .documents-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .legal-header {
        padding: 30px 0 20px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .legal-category {
        padding: 20px;
        margin-bottom: 30px;
    }

    .category-header {
        flex-direction: column;
        text-align: center;
    }

    .category-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .category-title {
        font-size: 1.3rem;
    }

    .document-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .document-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .document-info {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .document-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .view-btn,
    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-button {
        width: 100%;
        margin: 10px 0;
        font-size: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .main-title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .category-title {
        font-size: 1.1rem;
    }

    .document-name {
        font-size: 0.9rem;
    }

    .document-date {
        font-size: 0.75rem;
    }

    .document-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .view-btn,
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ESTILOS PARA BOTONES DE ACCIÓN
   ============================================ */
.document-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.view-btn {
    background: linear-gradient(135deg, #29A4DA 0%, #22b8f0 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(41, 164, 218, 0.3);
    white-space: nowrap;
}

.view-btn:hover {
    background: linear-gradient(135deg, #91B635 0%, #7da028 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(145, 182, 53, 0.4);
}

.view-btn i {
    font-size: 1rem;
}

/* ============================================
   MODAL PARA VISUALIZAR PDF
   ============================================ */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Cuando el modal está visible, asegurar que se muestre correctamente */
.pdf-modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: white;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #91B635 0%, #7da028 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    background: #f5f5f5;
}

#pdfViewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95%;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 1rem;
    }

    .modal-close {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
}
