/* Estilos para o PWA (Progressive Web App) */

/* Botão de instalação */
.install-button {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    padding: 5px 8px;
    margin-right: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.install-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Notificação de atualização */
.update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #235aa7;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.update-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.update-notification button {
    margin-left: 8px;
    cursor: pointer;
}

/* Splash screen para PWA */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #235aa7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.pwa-splash.hidden {
    opacity: 0;
    pointer-events: none;
}

.pwa-splash img {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.pwa-splash h1 {
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.pwa-splash p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

.pwa-loading {
    margin-top: 20px;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Status offline */
.offline-indicator {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e74c3c;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 2002;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.offline-indicator i {
    margin-right: 8px;
}

/* Compatibilidade com Dark Mode */
.dark-mode .install-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border-color: #e0e0e0;
}

.dark-mode .install-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .update-notification {
    background-color: #1a3b6d;
}

.dark-mode .pwa-splash {
    background-color: #1a3b6d;
}

.dark-mode .offline-indicator {
    background-color: #c0392b;
}

/* Compatibilidade com High Contrast */
.high-contrast .install-button {
    background-color: #000000;
    color: #ff0;
    border: 2px solid #ff0;
}

.high-contrast .install-button:hover {
    background-color: #333;
}

.high-contrast .update-notification {
    background-color: #000000;
    color: #ff0;
    border: 2px solid #ff0;
}

.high-contrast .update-notification button {
    background-color: #333;
    color: #ff0;
    border: 1px solid #ff0;
}

.high-contrast .pwa-splash {
    background-color: #000000;
}

.high-contrast .pwa-splash h1,
.high-contrast .pwa-splash p {
    color: #ff0;
}

.high-contrast .pwa-loading {
    border-color: rgba(255, 255, 0, 0.3);
    border-top-color: #ff0;
}

.high-contrast .offline-indicator {
    background-color: #000000;
    color: #ff0;
    border: 2px solid #ff0;
}

/* Responsividade */
@media (max-width: 480px) {
    .install-button {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .update-notification {
        width: 90%;
        font-size: 14px;
    }
    
    .pwa-splash h1 {
        font-size: 20px;
    }
    
    .pwa-splash p {
        font-size: 14px;
    }
}
