/* ==========================================================================
   PWA INSTALLER COMPONENT - CONCURSOS IPM
   Estilos para Botão no Topbar, Menu Lateral, Banner Flutuante e Modal iOS
   ========================================================================== */

/* 1. Botão do Topbar */
.pwa-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e4b85 0%, #0f284e 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.pwa-topbar-btn:hover {
    background: linear-gradient(135deg, #255d9d 0%, #15386b 100%);
    border-color: #f7b731;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 183, 49, 0.25);
    color: #ffffff;
}

.pwa-topbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pwa-topbar-btn i {
    font-size: 0.95rem;
    color: #f7b731;
    transition: transform 0.25s ease;
    animation: pwaBounce 2s infinite ease-in-out;
}

.pwa-topbar-btn:hover i {
    transform: scale(1.15);
}

@keyframes pwaBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1.5px);
    }
}

/* 2. Item no Menu Lateral (Drawer) */
.pwa-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(30, 75, 133, 0.12) !important;
    border: 1px dashed rgba(30, 75, 133, 0.3) !important;
    border-radius: 8px !important;
    margin: 4px 0 !important;
    padding: 10px 14px !important;
    color: #1e4b85 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.pwa-menu-btn:hover {
    background: rgba(30, 75, 133, 0.2) !important;
    border-color: #1e4b85 !important;
    transform: translateX(4px);
}

.pwa-menu-btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-menu-btn-content i {
    font-size: 1.1rem;
    color: #f7b731;
}

.pwa-badge {
    background: #f7b731;
    color: #0f284e;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3. Banner Flutuante de Instalação (Mobile e Desktop) */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    width: calc(100% - 32px);
    background: linear-gradient(135deg, rgba(15, 40, 78, 0.98) 0%, rgba(20, 52, 98, 0.98) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(247, 183, 49, 0.35);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(247, 183, 49, 0.15);
    color: #ffffff;
    z-index: 999999;
    padding: 14px 16px;
    animation: pwaSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.pwa-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 2px 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-banner-desc {
    font-size: 0.78rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
}

.btn-pwa-install {
    background: #f7b731;
    color: #0f284e;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(247, 183, 49, 0.3);
}

.btn-pwa-install:hover {
    background: #ffa801;
    transform: scale(1.04);
    box-shadow: 0 5px 12px rgba(247, 183, 49, 0.45);
}

.btn-pwa-dismiss {
    background: transparent;
    color: #94a3b8;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-pwa-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* 4. Modal de Instruções para iOS (Safari) */
.pwa-ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    animation: pwaFadeIn 0.3s ease;
}

@keyframes pwaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pwa-ios-card {
    background: #ffffff;
    color: #1e293b;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
    animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 14px;
}

.pwa-ios-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.pwa-ios-title-wrap h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f284e;
}

.pwa-ios-title-wrap p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.pwa-ios-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.pwa-ios-close:hover {
    background: #e2e8f0;
    color: #0f284e;
}

.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #334155;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 12px;
}

.pwa-ios-step-num {
    background: #0f284e;
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-ios-step-icon {
    color: #007aff;
    font-size: 1.1rem;
}

.pwa-ios-btn-ok {
    width: 100%;
    background: #0f284e;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-ios-btn-ok:hover {
    background: #194380;
}

/* 5. Responsividade */
@media (max-width: 640px) {
    .pwa-topbar-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .pwa-topbar-btn .pwa-btn-text {
        display: none; /* Em telas muito pequenas mostra apenas o ícone elegante com pulso */
    }

    .pwa-install-banner {
        bottom: 16px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}
