/**
 * ========================================
 * IA4Os - WindowManager Fix Styles
 * Estilos para correcciones de WindowManager
 * Archivo: css/windowmanager-fix.css
 * ========================================
 */

/* Emergency Error Container */
.error-boundary {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(10px);
}

.error-boundary.hidden {
    display: none !important;
}

.error-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.error-content h2 {
    color: #FF3B30;
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
}

.error-content p {
    margin: 0 0 24px 0;
    opacity: 0.8;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-button {
    padding: 12px 24px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
}

.error-button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.error-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-details {
    margin-top: 20px;
    text-align: left;
}

.error-details summary {
    cursor: pointer;
    opacity: 0.7;
    font-size: 12px;
    margin-bottom: 10px;
}

.error-details pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 4px;
    font-size: 10px;
    overflow: auto;
    max-height: 200px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Package Installer Wrapper Fixes */
.package-installer-wrapper {
    height: 100%;
    overflow: hidden;
    position: relative;
}

.package-installer-loading {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Window Manager Debug Styles */
.windowmanager-debug {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10000;
    max-width: 300px;
    border: 1px solid #34C759;
}

.windowmanager-debug.error {
    border-color: #FF3B30;
    background: rgba(255, 59, 48, 0.1);
}

.windowmanager-debug h4 {
    margin: 0 0 8px 0;
    color: #34C759;
    font-size: 14px;
}

.windowmanager-debug.error h4 {
    color: #FF3B30;
}

.windowmanager-debug ul {
    margin: 0;
    padding-left: 16px;
}

.windowmanager-debug li {
    margin-bottom: 4px;
}

.windowmanager-debug li.ok {
    color: #34C759;
}

.windowmanager-debug li.error {
    color: #FF3B30;
}

.windowmanager-debug li.warning {
    color: #FF9500;
}

/* Loading Animation for Package System */
@keyframes packageSystemLoading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.package-system-loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0;
}

.package-system-loading-bar::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: #007AFF;
    animation: packageSystemLoading 2s infinite;
}

/* Notification Override for System Messages */
.notification-system-override {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: #007AFF !important;
    color: white !important;
    padding: 16px 24px !important;
    border-radius: 8px !important;
    z-index: 10001 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    max-width: 400px !important;
    animation: slideInFromRight 0.3s ease-out !important;
}

.notification-system-override.success {
    background: #34C759 !important;
}

.notification-system-override.error {
    background: #FF3B30 !important;
}

.notification-system-override.warning {
    background: #FF9500 !important;
}

/* Fix Button Styles */
.fix-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #34C759;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.fix-button:hover {
    background: #2ecc71;
    transform: scale(1.05);
}

.fix-button.danger {
    background: #FF3B30;
}

.fix-button.danger:hover {
    background: #e74c3c;
}

.fix-button.warning {
    background: #FF9500;
}

.fix-button.warning:hover {
    background: #f39c12;
}

.fix-button.info {
    background: #007AFF;
}

.fix-button.info:hover {
    background: #0056b3;
}

/* Console Override Styles */
.console-override {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-height: 200px;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 16px;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 10002;
    border: 1px solid rgba(0, 255, 0, 0.3);
    display: none;
}

.console-override.show {
    display: block;
}

.console-override .log-line {
    margin-bottom: 4px;
    padding: 2px 0;
}

.console-override .log-line.error {
    color: #ff4444;
}

.console-override .log-line.warning {
    color: #ffaa00;
}

.console-override .log-line.success {
    color: #44ff44;
}

.console-override .log-line.info {
    color: #4488ff;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .error-content {
        padding: 24px;
        margin: 20px;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .error-button {
        width: 100%;
    }
    
    .windowmanager-debug {
        position: relative;
        top: auto;
        left: auto;
        margin: 10px;
        max-width: none;
    }
    
    .notification-system-override {
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
    }
}

@media (max-width: 480px) {
    .error-content {
        padding: 20px;
    }
    
    .error-content h2 {
        font-size: 20px;
    }
    
    .error-icon {
        font-size: 48px;
    }
}