/* Footer Mobile-First - Alluagro */

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(135deg, #00522d, #28a745);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.btn-footer,
.btn-footer-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 60px;
    height: 50px;
    line-height: 1.1;
}

.btn-footer i,
.btn-footer-selected i {
    font-size: 18px;
    margin-bottom: 4px;
    display: block;
}

.btn-footer-selected {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.btn-footer:hover,
.btn-footer:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-footer:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Ajustar margin-bottom do conteúdo principal quando footer estiver presente */
body:has(.footer) #app {
    margin-bottom: 70px;
    padding-bottom: 20px;
}

/* Fallback para navegadores que não suportam :has() */
#app {
    padding-bottom: 90px; /* Espaço padrão */
}

/* Tablets */
@media (min-width: 768px) {
    .footer {
        height: 80px;
    }
    
    .btn-footer,
    .btn-footer-selected {
        font-size: 12px;
        min-width: 70px;
        height: 60px;
        padding: 10px 15px;
    }
    
    .btn-footer i,
    .btn-footer-selected i {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    body:has(.footer) #app {
        margin-bottom: 80px;
    }
    
    #app {
        padding-bottom: 100px;
    }
}

/* Desktop - footer pode ser diferente ou oculto */
@media (min-width: 1024px) {
    .footer {
        height: 90px;
        justify-content: center;
        gap: 60px;
    }
    
    .btn-footer,
    .btn-footer-selected {
        font-size: 13px;
        min-width: 80px;
        height: 70px;
        padding: 12px 20px;
    }
    
    .btn-footer i,
    .btn-footer-selected i {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    body:has(.footer) #app {
        margin-bottom: 90px;
    }
    
    #app {
        padding-bottom: 110px;
    }
}

/* Dispositivos muito pequenos */
@media (max-width: 360px) {
    .footer {
        height: 65px;
    }
    
    .btn-footer,
    .btn-footer-selected {
        font-size: 10px;
        min-width: 50px;
        height: 45px;
        padding: 6px 8px;
    }
    
    .btn-footer i,
    .btn-footer-selected i {
        font-size: 16px;
        margin-bottom: 3px;
    }
    
    body:has(.footer) #app {
        margin-bottom: 65px;
    }
    
    #app {
        padding-bottom: 85px;
    }
}

/* Modo paisagem em dispositivos móveis */
@media (max-height: 500px) and (orientation: landscape) {
    .footer {
        height: 60px;
    }
    
    .btn-footer,
    .btn-footer-selected {
        font-size: 10px;
        min-width: 50px;
        height: 40px;
        padding: 5px 8px;
    }
    
    .btn-footer i,
    .btn-footer-selected i {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    body:has(.footer) #app {
        margin-bottom: 60px;
    }
    
    #app {
        padding-bottom: 80px;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .footer {
        border-top: 2px solid #fff;
    }
    
    .btn-footer:focus,
    .btn-footer-selected:focus {
        outline: 3px solid #fff;
        outline-offset: 3px;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .btn-footer,
    .btn-footer-selected {
        transition: none !important;
        transform: none !important;
    }
    
    .btn-footer:hover,
    .btn-footer:focus {
        transform: none !important;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .footer {
        background: linear-gradient(135deg, #003d1f, #1e5f32);
    }
}