/* ========================================
   NAVEGAÇÃO INFERIOR (BOTTOM NAV)
   FIXO - sem tremor no mobile
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    /* ANTI-TREMOR */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    padding: 8px 0;
    position: relative;
}

.bottom-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-weight: 500;
}

.bottom-nav-item.active {
    color: #2a9d8f;
}

/* Botão de adicionar (FAB) no meio */
.bottom-nav-item.add-button {
    position: relative;
    bottom: 15px;
}

.add-circle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2a9d8f 0%, #1a7a6e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.4);
    /* ANTI-TREMOR */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.add-circle i {
    font-size: 24px;
    color: white;
    margin: 0;
}

/* ========================================
   ANTI-TREMOR GLOBAL
   ======================================== */

/* Desabilita animações que causam tremor */
body {
    overscroll-behavior: none !important;
    -webkit-overflow-scrolling: touch;
    /* Remove animação fadeIn que causa tremor */
    animation: none !important;
}

/* Remove transform de elementos que causam tremor */
.conta-card:active,
.category-chip:active,
.nav-link:active {
    transform: none !important;
}

/* Elementos fixos não devem ter transição */
.bottom-nav,
.add-header,
.contas-header,
.save-button {
    transition: none !important;
}

/* ========================================
   BOTÃO SALVAR - POSIÇÃO CORRIGIDA
   ======================================== */

@media (max-width: 768px) {

    /* Botão salvar acima do bottom-nav, sem sobrepor campos */
    .save-button {
        position: fixed !important;
        bottom: 85px !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        margin: 0 !important;
        z-index: 998 !important;
        /* ANTI-TREMOR */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    /* Espaço extra para o formulário não ficar coberto */
    .add-form,
    form {
        padding-bottom: 180px !important;
    }
}

/* Safe area para iPhones com notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .save-button {
            bottom: calc(85px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* Remove qualquer animação de página */
@keyframes fadeIn {

    from,
    to {
        opacity: 1;
        transform: none;
    }
}