:root {
    --primary-color: #e63946;
    --secondary-color: #457b9d;
    --dark-color: #1d3557;
    --light-color: #f1faee;
    --success-color: #2a9d8f;
    --warning-color: #e9c46a;
}

.unique-id-certificate {
    margin-top: 10px;
    font-size: 16px;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    border: 2px dashed var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#unique-id-display {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 18px;
    letter-spacing: 1px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

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

body {
    background-color: rgba(0,0,0,0.85);
    color: #333;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.runner-certificate {
    background-color: white;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.certificate-header {
    height: 60px;
    width: 100%;
    background-color: var(--primary-color);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
}

.certificate-verification-badge {
    position: absolute;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    display: flex;
    align-items: center;
}

.verification-badge-title {
    margin-right: 5px;
}

.header-unique-id {
    font-weight: bold;
    font-family: monospace;
    letter-spacing: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.certificate-logo-container {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.certificate-logo {
    max-width: 140px;
    height: auto;
}

.certificate-title-container {
    color: white;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.certificate-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.certificate-subtitle {
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    line-height: 1.2;
}

.certificate-event {
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.certificate-body {
    padding: 30px 20px;
    text-align: center;
    position: relative;
    min-height: 500px;
}

.certificate-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z' fill='%23f1faee' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.certificate-medal {
    width: 80px;
    height: 80px;
    background-color: #000000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -70px auto 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 5px solid white;
}

.certificate-medal i {
    font-size: 36px;
    color: white;
}

.runner-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.runner-description {
    font-size: 16px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.runner-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.runner-stat-box {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}

.runner-stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--primary-color);
}

.runner-stat-box:hover {
    background-color: rgba(0,0,0,0.5);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.runner-stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.runner-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
}

.certificate-time {
    font-family: monospace;
}

.certificate-qr-container {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 250px;
    margin: 10px auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.certificate-qr {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.certificate-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.verification-text {
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

.certificate-verification {
    font-size: 11px;
    color: #666;
    margin: 0 0 3px 0;
    line-height: 1.2;
}

.verification-id {
    font-size: 11px;
    color: #666;
    margin: 0;
    font-weight: 600;
}

.certificate-footer {
    background-color: #f8f9fa;
    padding: 10px;
    text-align: center;
    border-top: 1px solid #eee;
    position: relative;
}

.certificate-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.certificate-signature {
    margin-bottom: 20px;
}

.signature-img {
    max-width: 120px;
    height: auto;
    margin-bottom: 5px;
}

.certificate-signature-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.certificate-signature-title {
    font-size: 12px;
    color: #666;
}

.certificate-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background-color: white;
    color: #666;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.social-button:hover {
    transform: translateY(-3px) scale(1.05);
}

.social-button.facebook:hover {
    background-color: #3b5998;
    color: white;
}

.social-button.twitter:hover {
    background-color: #1da1f2;
    color: white;
}

.social-button.whatsapp:hover {
    background-color: #25d366;
    color: white;
}

.social-button.instagram:hover {
    background-color: #c13584;
    color: white;
}

.download-button,
.email-button {
    width: 182px;
    height: 38px;
    min-width: 182px;
    max-width: 182px;
    justify-content: center;
    font-size: 0.92em;
    font-weight: 100;
    padding: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
}

.download-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    border: none;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.download-button i {
    margin-right: 8px;
}

.download-button:hover {
    background-color: #c1303c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4);
}

.finish-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #000,
        #000 20px,
        #fff 20px,
        #fff 40px
    );
}

.responsive-note {
    color: white;
    text-align: center;
    margin: 15px;
    font-size: 14px;
    position: fixed;
    bottom: 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .runner-certificate {
        max-width: 650px;
        margin: 30px auto;
        border-radius: 15px;
    }
    
    .certificate-header {
        border-radius: 15px 15px 0 0;
    }

    .runner-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .certificate-footer {
        border-radius: 0 0 15px 15px;
    }
    
    .responsive-note {
        display: none;
    }
}

.event-image {
    width: 100%;
    max-width: 576px;
    margin: 20px auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.event-header-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 20px;
    gap: 20px;
}

.social-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.qr-column {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.certificate-qr-container {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.certificate-qr {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
}

.certificate-verification {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin: 0;
    line-height: 1.3;
}

.certificate-social {
    display: flex;
    gap: 15px;
    margin: 0;
}

.download-button {
    margin: 0;
}

@media (max-width: 768px) {
    .runner-certificate {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .certificate-header {
        height: 40px;
        border-radius: 0;
    }

    .certificate-subtitle {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .runner-stats {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0 10px;
    }
    
    .runner-stat-box {
        flex: 0 1 calc(50% - 15px);
        min-width: calc(50% - 15px);
    }

    .event-image {
        max-width: 90%;
    }
    
    .runner-name {
        font-size: 24px;
        padding: 0 10px;
    }

    .runner-description {
        font-size: 14px;
        padding: 0 15px;
    }

    .footer-columns {
        flex-direction: column;
        gap: 15px;
    }

    .social-column {
        width: 100%;
        align-items: center;
    }

    .certificate-social {
        justify-content: center;
    }

    .qr-column {
        width: 100%;
    }

    .certificate-qr-container {
        margin: 5px auto;
    }
}

@media (max-width: 480px) {
    .certificate-header {
        height: 70px;
    }

    .certificate-subtitle {
        font-size: 18px;
    }

    .runner-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .runner-stat-box {
        width: 100%;
        min-width: 100%;
    }

    .runner-stat-value {
        font-size: 20px;
    }

    .runner-stat-label {
        font-size: 12px;
    }

    .event-image {
        max-width: 95%;
    }

    .social-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .download-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .certificate-qr {
        width: 90px;
        height: 90px;
    }

    .certificate-verification {
        font-size: 10px;
    }
}

.runner-category-info {
    text-align: center;
    font-size: 20px;
    color: #1d3557;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: -10px;
}

.email-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    box-shadow: 0 4px 15px rgba(69, 123, 157, 0.3);
}

.email-button i {
    margin-right: 8px;
}

.email-button:hover {
    background-color: #3d6d8c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(69, 123, 157, 0.4);
}

/* Modal de correo electrónico */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    position: relative;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal h2 {
    color: var(--dark-color);
    margin-bottom: 20px;
    font-size: 20px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #666;
    font-size: 14px;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(69, 123, 157, 0.1);
}

.send-email-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.send-email-button:hover {
    background-color: #3d6d8c;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .email-button {
        width: 100%;
        justify-content: center;
    }
}

/* Media query para ocultar el botón de descarga en móviles */
@media screen and (max-width: 768px) {
    .download-button {
        display: none !important;
    }
}

.footer-buttons > div {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    width: 100%;
}