/* Iframe Modal Overlay Styles */

.iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iframe-modal.hidden {
    display: none;
}

/* Modal backdrop - dark overlay */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Modal container - holds iframe and controls */
.modal-container {
    position: relative;
    width: 95%;
    height: 90%;
    max-width: 1920px;
    max-height: 1080px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    z-index: 2;
    /* Performance optimization */
    contain: layout style paint;
}

/* Iframe element */
.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Loading indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    font-size: 18px;
    z-index: 3;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error display */
.error-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
    z-index: 3;
    display: none;
}

.error-display.active {
    display: block;
}

.error-display h3 {
    margin: 0 0 15px;
    font-size: 20px;
    color: #ff6b6b;
}

.error-display p {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
}

.error-display .error-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.error-display button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.error-display .btn-retry {
    background-color: #4CAF50;
    color: white;
}

.error-display .btn-retry:hover {
    background-color: #45a049;
}

.error-display .btn-open-tab {
    background-color: #2196F3;
    color: white;
}

.error-display .btn-open-tab:hover {
    background-color: #0b7dda;
}
