/* =================================================================
   VHouse Error Handling Styles
   Personalización del manejo de errores de Blazor
   ================================================================= */

/* Ocultar el error UI por defecto de Blazor */
#blazor-error-ui {
    display: none !important;
}

/* =================================================================
   Custom Error Toast (esquina inferior derecha)
   ================================================================= */
.vhouse-error-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 450px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #e74c3c;
    border-left: 4px solid #e74c3c;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(231, 76, 60, 0.3);
    z-index: 99999;
    font-family: 'Inter', sans-serif;
    animation: slideInRight 0.4s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.vhouse-error-toast.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.vhouse-error-toast__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vhouse-error-toast__title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e74c3c;
    font-weight: 600;
    font-size: 1rem;
}

.vhouse-error-toast__icon {
    font-size: 1.4rem;
}

.vhouse-error-toast__close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.vhouse-error-toast__close:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.vhouse-error-toast__message {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.vhouse-error-toast__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vhouse-error-toast__btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.vhouse-error-toast__btn--primary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.vhouse-error-toast__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.vhouse-error-toast__btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.vhouse-error-toast__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* =================================================================
   Error Details Modal
   ================================================================= */
.vhouse-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vhouse-error-modal__content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #333;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.vhouse-error-modal__header {
    background: rgba(231, 76, 60, 0.15);
    padding: 20px 24px;
    border-bottom: 1px solid rgba(231, 76, 60, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vhouse-error-modal__title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: 600;
}

.vhouse-error-modal__close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.vhouse-error-modal__close:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.vhouse-error-modal__body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.vhouse-error-modal__section {
    margin-bottom: 20px;
}

.vhouse-error-modal__section-title {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.vhouse-error-modal__section-content {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #ddd;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.vhouse-error-modal__section-content--error {
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.vhouse-error-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =================================================================
   ErrorBoundary Styles
   ================================================================= */
.error-boundary-fallback {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.1) 100%);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin: 20px;
}

.error-boundary-fallback__icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-boundary-fallback__title {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-boundary-fallback__message {
    color: #999;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.error-boundary-fallback__btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.error-boundary-fallback__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* Error Details Textarea */
.error-details-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0;
    text-align: left;
}

.error-details-label {
    display: block;
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.error-details-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    background: #0d1117;
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: #c9d1d9;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.error-details-textarea:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-details-textarea::selection {
    background: rgba(231, 76, 60, 0.3);
}

/* =================================================================
   Connection Status Indicator
   ================================================================= */
.vhouse-connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 99998;
    display: none;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.4s ease-out;
}

.vhouse-connection-status.reconnecting {
    display: flex;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.vhouse-connection-status.failed {
    display: flex;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.vhouse-connection-status__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

