/**
 * AI React Manager - Frontend Embed Styles
 * 
 * © AI Administrator Ltd
 * Styles for embedded React applications in frontend
 */

/* React App Container */
.reactapp-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    background: #f8f9fa;
}

/* React App Iframe */
.reactapp-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    display: block;
    background: white;
    border-radius: 8px;
}

/* Loading State */
.reactapp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: 'Arial', sans-serif;
}

.reactapp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: reactapp-spin 1s ease-in-out infinite;
    margin-right: 15px;
}

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

/* Error State */
.reactapp-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.reactapp-error-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reactapp-container {
        margin: 10px 0;
        border-radius: 4px;
    }
    
    .reactapp-iframe {
        min-height: 300px;
    }
}

/* Security Notice */
.reactapp-security-notice {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px 15px;
    font-size: 12px;
    border-top: 1px solid #bee5eb;
    display: none;
}

.reactapp-container.debug-mode .reactapp-security-notice {
    display: block;
}

/* App Metadata */
.reactapp-metadata {
    background: rgba(0,0,0,0.05);
    padding: 8px 15px;
    font-size: 11px;
    color: #666;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: none;
}

.reactapp-container.show-metadata .reactapp-metadata {
    display: block;
}

/* Performance Optimization */
.reactapp-iframe {
    transition: opacity 0.3s ease;
}

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

/* Accessibility */
.reactapp-container:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .reactapp-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .reactapp-iframe {
        min-height: 200px;
    }
}
