/* Error Handling CSS for Aether Chronicles
 * Provides styles for connection warnings, error messages, and reconnection overlays
 */

/* Connection Warning Banner */
#connection-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 165, 0, 0.9);
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-weight: bold;
    z-index: 1010;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#connection-warning.visible {
    transform: translateY(0);
}

#connection-warning .message {
    margin: 0;
    font-size: 16px;
}

/* Reconnecting Overlay */
#reconnecting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#reconnecting-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.reconnecting-container {
    background-color: #222;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.reconnecting-title {
    color: #fff;
    font-size: 24px;
    margin-bottom: 20px;
}

.reconnecting-status {
    color: #ccc;
    font-size: 16px;
    margin-bottom: 30px;
}

.reconnecting-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Connection Error Dialog */
#connection-error-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#connection-error-dialog.visible {
    opacity: 1;
    visibility: visible;
}

.error-dialog-container {
    background-color: #222;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-top: 4px solid #e74c3c;
}

.error-dialog-title {
    color: #e74c3c;
    font-size: 24px;
    margin-bottom: 20px;
}

.error-dialog-message {
    color: #ccc;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.error-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.error-dialog-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.error-dialog-button:hover {
    background-color: #2980b9;
}

.error-dialog-button.secondary {
    background-color: #7f8c8d;
}

.error-dialog-button.secondary:hover {
    background-color: #95a5a6;
}

/* Responsive adjustments */
@media (max-width: 480px) {

    .reconnecting-container,
    .error-dialog-container {
        width: 95%;
        padding: 20px;
    }

    .error-dialog-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .error-dialog-button {
        width: 100%;
    }
}