/* React App Renderer - Loading Styles */

.rwr-app-container {
    position: relative;
    display: block;
    overflow: hidden;
}

.rwr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

.rwr-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: rwr-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error states */
.rwr-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #c33;
    border-radius: 4px;
    color: #c33;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

.rwr-error strong {
    font-weight: 600;
}

/* Iframe specific styles */
.rwr-iframe-mode {
    background: transparent;
}

.rwr-iframe-mode iframe {
    display: block;
    width: 100%;
    border: none;
    background: white;
}

.rwr-iframe-loading iframe {
    opacity: 0.7;
}

.rwr-iframe-loaded iframe {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.rwr-iframe-error iframe {
    display: none;
}

/* Responsive utilities */
@media (max-width: 767px) {
    .rwr-loading {
        min-height: 150px;
        font-size: 12px;
    }
    
    .rwr-spinner {
        width: 16px;
        height: 16px;
    }
}

/* Accessibility */
.rwr-loading[aria-live] {
    /* Screen reader announcements */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .rwr-loading {
        border-color: #000;
        background: #fff;
        color: #000;
    }
    
    .rwr-spinner {
        border-color: #ccc;
        border-top-color: #000;
    }
    
    .rwr-error {
        background: #fff;
        border-color: #000;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .rwr-spinner {
        animation: none;
        border-top-color: transparent;
    }
    
    .rwr-iframe-loaded iframe {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .rwr-loading {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .rwr-spinner {
        border-color: #444;
        border-top-color: #0073aa;
    }
}