/* Blazor Connection Styles */
/* Melhora a experiência visual durante carregamento e detecta problemas de conexão */

/* Loading indicator */
.blazor-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.blazor-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.blazor-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Connection error styles */
#blazor-connection-error {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 12px;
    text-align: center;
    z-index: 10000;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Connection status indicator */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    z-index: 9998;
    transition: background-color 0.3s ease;
}

.connection-status.disconnected {
    background: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
    }
}

/* Smooth transitions for Blazor components */
.blazor-component {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.blazor-component.loading {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Error message styles */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Success message styles */
.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .connection-status {
        bottom: 10px;
        right: 10px;
        width: 10px;
        height: 10px;
    }
    
    #blazor-connection-error {
        padding: 8px;
        font-size: 14px;
    }
} 