/**
 * Estilos para o Monitor de Conexão com Internet
 */

/* Indicador de Status */
#connection-status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    padding: 10px 15px;
    border-radius: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
}

#connection-status-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status.online {
    /* background: linear-gradient(135deg, #28a745, #20c997); */
}

.connection-status.offline {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.status-icon {
    font-size: 16px;
    animation: pulse 2s infinite;
}

.status-text {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Notificação de Offline */
#offline-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: white;
    border: 2px solid #dc3545;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 90%;
    animation: slideIn 0.3s ease-out;
}

.offline-alert .alert-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.offline-alert .alert-icon {
    font-size: 28px;
    margin-right: 15px;
    animation: shake 0.5s ease-in-out;
}

.offline-alert .alert-title {
    flex: 1;
    font-weight: bold;
    color: #dc3545;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offline-alert .alert-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.offline-alert .alert-close:hover {
    color: #333;
    background: #f8f9fa;
    transform: scale(1.1);
}

.offline-alert .alert-body p {
    margin: 12px 0;
    color: #666;
    font-size: 15px;
    line-height: 1.5;
}

.offline-alert .reconnect-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.offline-alert .progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.offline-alert .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.offline-alert .progress-text {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    display: block;
    font-weight: 500;
}

/* Notificação de Reconectado */
#reconnected-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 18px 30px;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(40,167,69,0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
    border: 2px solid rgba(255,255,255,0.3);
}

.reconnected-alert .alert-icon {
    font-size: 20px;
    animation: bounce 0.6s ease-in-out;
}

.reconnected-alert .alert-text {
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Botão de Recarregar */
.reload-button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

.reload-button:active {
    transform: translateY(0);
}

/* Animações */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsividade */
@media (max-width: 768px) {
    #connection-status-indicator {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #offline-notification {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    .offline-alert .alert-title {
        font-size: 16px;
    }
    
    .offline-alert .alert-body p {
        font-size: 14px;
    }
    
    #reconnected-notification {
        padding: 15px 25px;
        font-size: 14px;
        width: 90%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    #connection-status-indicator {
        bottom: 5px;
        right: 5px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .connection-status {
        gap: 5px;
    }
    
    .status-icon {
        font-size: 14px;
    }
    
    #offline-notification {
        padding: 15px;
    }
    
    .offline-alert .alert-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .offline-alert .alert-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}

/* Modo Escuro */
@media (prefers-color-scheme: dark) {
    #offline-notification {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #e53e3e;
    }
    
    .offline-alert .alert-body p {
        color: #cbd5e0;
    }
    
    .offline-alert .reconnect-progress {
        background: #4a5568;
        border-color: #718096;
    }
    
    .offline-alert .progress-bar {
        background: #4a5568;
    }
    
    .offline-alert .progress-text {
        color: #a0aec0;
    }
    
    .offline-alert .alert-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
}

/* Estados de Foco para Acessibilidade */
#connection-status-indicator:focus,
.offline-alert .alert-close:focus,
.reload-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Transições Suaves */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
