/* PWA UI v4.2 - Estilos da Barra Simples + Loading (apenas no PWA) */

/* --- Estilos do Menu Simples --- */
.pwa-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 99999;
    transform: translateY(0); /* Inicia visível */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transição suave */
}

.pwa-mode .pwa-bottom-nav {
    display: block;
}

.pwa-mode {
    padding-bottom: 80px;
}

.pwa-bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.pwa-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #555;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    position: relative;
}

.pwa-nav-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.pwa-nav-item.active {
    color: #0073aa;
}

.pwa-nav-item.loading {
    opacity: 0.6;
}

.pwa-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.pwa-nav-text {
    font-size: 11px;
    font-weight: 500;
}

/* --- Estilos do Indicador de Loading (apenas visível no PWA) --- */
.pwa-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Loading overlay só aparece no modo PWA */
.pwa-mode .pwa-loading-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.pwa-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: pwa-spin 1s linear infinite;
    margin-bottom: 16px;
}

.pwa-loading-text {
    color: #555;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

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



/* Adicione após os estilos existentes do .pwa-nav-icon */
.pwa-message-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 12px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pwa-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    position: relative; /* IMPORTANTE: adicione esta linha aos estilos existentes */
}

/* --- Tela Offline (apenas PWA) --- */
.pwa-offline-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 999999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    color: white;
}

.pwa-mode .pwa-offline-screen.show {
    display: flex;
}

.pwa-offline-icon {
    font-size: 120px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.pwa-offline-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pwa-offline-message {
    font-size: 16px;
    line-height: 1.6;
    max-width: 300px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.pwa-offline-retry {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.pwa-offline-retry:hover {
    background: white;
    color: #667eea;
}

.pwa-offline-status {
    font-size: 14px;
    opacity: 0.7;
}

/* Animação da tela offline */
@keyframes fadeInOffline {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.pwa-offline-screen.show {
    animation: fadeInOffline 0.3s ease-out;
}