* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    /* Fondo con imagen elegante */
    background-image: url('background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    min-height: 100vh;
}

/* Capa overlay para mejorar legibilidad */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.62) 0%, rgba(248, 249, 250, 0.85) 100%);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(74, 100, 145, 0.95));
    color: white;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filtros */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(221, 221, 221, 0.5);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.filter-btn:hover {
    background-color: rgba(240, 240, 240, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background-color: rgba(44, 62, 80, 0.95);
    color: white;
    border-color: rgba(44, 62, 80, 0.8);
}

/* Grid de certificados */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.certificate-card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98);
}

.certificate-img {
    height: 200px;
    background: linear-gradient(135deg, rgba(233, 236, 239, 0.9), rgba(206, 212, 218, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a6491;
    position: relative;
    overflow: hidden;
}

.certificate-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shine 3s infinite linear;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

.certificate-card:hover .certificate-img img {
    transform: scale(1.05);
}

.certificate-img i {
    font-size: 4rem;
    z-index: 1;
    position: relative;
}

.certificate-info {
    padding: 20px;
}

.certificate-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.certificate-issuer {
    color: #4a6491;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.certificate-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.certificate-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background-color: rgba(233, 236, 239, 0.8);
    color: #495057;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    backdrop-filter: blur(5px);
}

/* Modal para vista detallada */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 10px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: #333;
    cursor: pointer;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.close-modal:hover {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-img {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, rgba(233, 236, 239, 0.9), rgba(206, 212, 218, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.modal-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: shine 3s infinite linear;
}

.modal-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    position: relative;
}

.modal-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: rgba(248, 249, 250, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-label {
    font-weight: 600;
    color: #4a6491;
    margin-bottom: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-description {
    line-height: 1.7;
    color: #555;
    padding: 20px;
    background-color: rgba(248, 249, 250, 0.5);
    border-radius: 8px;
    border-left: 4px solid #4a6491;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: #6c757d;
    border-top: 1px solid rgba(233, 236, 239, 0.5);
    margin-top: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 768px) {
    .certificates-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    h1 {
        font-size: 2rem;
    }

    .modal-body {
        padding: 20px;
    }
    
    body {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .certificates-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .modal-img {
        height: 200px;
    }
}

/* Animación de carga suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.certificate-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Desplazamiento suave */
html {
    scroll-behavior: smooth;
}