/* ABN Certificate Modal Styles */

.abn-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.abn-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.abn-modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    max-width: 90%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (min-width: 768px) {
    .abn-modal-content {
        max-width: 800px;
    }
}

.abn-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.abn-modal-close:hover {
    color: #000;
}

.abn-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.abn-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.abn-modal-body {
    padding: 30px 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#abn-certificate-viewer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#abn-certificate-viewer img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#abn-certificate-viewer iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 4px;
}

.abn-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 8px 8px;
}

.abn-modal-footer .button {
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.abn-modal-footer #abn-certificate-download {
    background-color: #0073aa;
    color: white;
}

.abn-modal-footer #abn-certificate-download:hover {
    background-color: #005a87;
}

.abn-modal-footer .abn-modal-close-btn {
    background-color: #e0e0e0;
    color: #333;
}

.abn-modal-footer .abn-modal-close-btn:hover {
    background-color: #d0d0d0;
}

/* Clickable span styling */
.abn-certified.abn-clickable {
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.abn-certified.abn-clickable:hover {
    opacity: 0.8;
    font-weight: 600;
}

/* Loading spinner */
.abn-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .abn-modal-content {
        max-width: 95%;
    }

    .abn-modal-header,
    .abn-modal-footer,
    .abn-modal-body {
        padding: 15px;
    }

    .abn-modal-header h2 {
        font-size: 1.2rem;
    }

    .abn-modal-footer {
        flex-direction: column-reverse;
    }

    .abn-modal-footer .button {
        width: 100%;
        text-align: center;
    }
}