/**
 * MTV Accessibility Audit Styles
 * Combined styles for progress display, iframe container, and PDF generation overlay
 *
 * @package MTV\Accessibility\Audit
 * @since 1.1
 */

/*
 * ========================================
 * Progress Container Styles
 * ========================================
 */
.mtv-audit-progress {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
}

.mtv-audit-info-section {
    display: block;
    margin-bottom: 20px;
    width:100%;
}

.mtv-audit-pipeline-info {
    flex: 0 0 40%;
    padding-right: 20px;
    width:100%;
}

.mtv-audit-progress-info {
    flex: 0 0 60%;
    width:100%;
}

.mtv-audit-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    background-color: #e9e9e9;
    font-family: monospace;
}

.mtv-audit-domain {
    margin-bottom: 10px;
    font-size: 1.1em;
    word-break: break-all;
}

/*
 * ========================================
 * Progress Bar Styles
 * ========================================
 */
.mtv-audit-progress-container {
    width: 100%;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.mtv-audit-progress-bar {
    height: 100%;
    background-color: var(--wp--preset--color--contrast-3, #0073aa);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/*
 * ========================================
 * Iframe Container Styles
 * ========================================
 */
.mtv-audit-iframe-wrapper {
    margin-top: 20px;
    width: 100%;
}

.mtv-audit-iframe-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    pointer-events: none;
}

/* Dark overlay for scanning effect that also prevents clicks */
.mtv-audit-iframe-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* Dark dim overlay */
    z-index: 5;
    pointer-events: auto; /* Block clicks from reaching the iframe */
    cursor: not-allowed; /* Show not-allowed cursor when hovering */
}

/* Scanning Animation Effect */
.mtv-audit-scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, transparent, rgba(0, 115, 170, 0.8), transparent);
    animation: scanAnimation 4s infinite ease-in-out;
    z-index: 10;
    pointer-events: none;
}

@keyframes scanAnimation {
    0% {
        top: 0;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0;
    }
}

/*
 * ========================================
 * PDF Generation Overlay Styles
 * ========================================
 */
/* Body class to prevent scrolling during PDF generation */
body.pdf-generating {
    overflow: hidden;
    position: relative;
}

#mtv-pdf-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1;
    display: none; /* Initially hidden, will be set to flex by JavaScript */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    max-width: 100vw !important;
}

body.pdf-generating #mtv-pdf-progress-overlay {
    display: flex !important;
    z-index: 999999999;
}

#mtv-pdf-progress-overlay .message {
    margin-bottom: 20px;
    font-weight: 500;
}

#mtv-pdf-progress-container {
    width: 300px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto;
}

#mtv-pdf-progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--wp--preset--color--contrast-3);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/*
 * ========================================
 * Responsive Styles
 * ========================================
 */
@media (max-width: 767px) {
    .mtv-audit-pipeline-info,
    .mtv-audit-progress-info {
        flex: 0 0 100%;
        padding-right: 0;
        margin-bottom: 15px;
    }
}
