/* ==========================================
   FOOTER PADRÃO - COMPONENTE REUTILIZÁVEL
   ========================================== */

/* Footer principal */
.standard-footer {
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Seção escura do footer */
.footer-section-dark {
    background-color: #6c757d;
    color: white;
    padding: 6px 0;
    font-size: 0.75rem;
    line-height: 1.2;
}

.footer-section-dark .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    flex-wrap: wrap;
}

/* Links ANS */
.ans-link,
.ans-code {
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: normal;
    display: inline-block;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.ans-link:hover,
.ans-code:hover {
    color: #e9ecef;
    text-decoration: underline;
}

/* Texto de copyright */
.copyright-text {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 0;
    padding: 0 15px;
    flex: 1;
}

/* Seção clara do footer */
.footer-section-light {
    background-color: #d1d3d4;
    padding: 4px 0;
    font-size: 0.7rem;
    line-height: 1.1;
}

.footer-section-light .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    flex-wrap: wrap;
}

/* Informações de versão */
.version-info {
    text-align: left;
    padding: 0;
    flex: 1;
}

.version-text {
    color: #333;
    font-size: 0.7rem;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

/* Seção de apps */
.apps-section {
    text-align: center;
    padding: 0;
    flex: 0 0 auto;
}

.apps-text {
    margin: 0 0 3px 0;
    font-size: 0.7rem;
    color: #333;
    font-weight: normal;
}

.app-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

/* Botões dos apps */
.app-button {
    display: inline-block;
    text-decoration: none;
    border: none;
    outline: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    background: none;
    padding: 0;
    margin: 0;
    line-height: 0;
}

.app-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.app-button:active {
    transform: scale(0.95);
}

/* SVG dos ícones */
.app-button svg {
    display: block;
    width: 86px;
    height: 23px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    vertical-align: top;
}

/* Específico para tela de login */
body.login-layout .standard-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

body.login-layout #main {
    padding-bottom: 70px;
}

/* Responsividade */
@media (max-width: 767px) {
    .footer-section-dark {
        padding: 4px 0;
    }
    
    .footer-section-light {
        padding: 3px 0;
    }
    
    .footer-section-dark .row,
    .footer-section-light .row {
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }
    
    .copyright-text {
        order: 2;
        padding: 1px 0;
        flex: none;
    }
    
    .ans-link {
        order: 1;
        flex: none;
    }
    
    .ans-code {
        order: 3;
        flex: none;
    }
    
    .version-info {
        order: 1;
        text-align: center;
        flex: none;
    }
    
    .apps-section {
        order: 2;
        flex: none;
    }
    
    .app-buttons {
        gap: 4px;
        justify-content: center;
    }
    
    .app-button svg {
        width: 70px;
        height: 18px;
    }
    
    body.login-layout #main {
        padding-bottom: 80px;
    }
}

/* Esconder footer antigo quando usar o padrão */
footer:not(.standard-footer) {
    display: none !important;
}

/* Garantir que o footer padrão seja sempre visível */
.standard-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
}

/* Correção específica para alinhamento dos ícones */
.app-button svg text {
    dominant-baseline: middle;
    text-anchor: middle;
    font-family: Arial, sans-serif !important;
    font-size: 9px !important;
    font-weight: bold !important;
}

/* Garantir que os ícones sejam visíveis e alinhados */
.app-button svg {
    display: block !important;
    width: 86px !important;
    height: 23px !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    vertical-align: top !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Correção para mobile */
@media (max-width: 767px) {
    .app-button svg {
        width: 70px !important;
        height: 18px !important;
    }
    
    .app-button svg text {
        font-size: 7px !important;
    }
}

/* Garantir que o código ANS seja visível */
.ans-code {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* SOBRESCREVER REGRAS ANTIGAS DOS BOTÕES */
/* Esconder botões antigos que usam sprite */
footer .apps .btn-android,
footer .apps .btn-ios,
footer .btn-android,
footer .btn-ios {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Garantir que apenas os botões do footer padrão sejam visíveis */
.standard-footer .app-button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forçar uso dos ícones SVG */
.standard-footer .app-button svg {
    display: block !important;
    width: 86px !important;
    height: 23px !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    vertical-align: top !important;
    margin: 0 !important;
    padding: 0 !important;
    background-image: none !important;
    background-color: transparent !important;
}

/* Garantir que o texto dentro do SVG seja visível */
.standard-footer .app-button svg text {
    dominant-baseline: middle !important;
    text-anchor: middle !important;
    font-family: Arial, sans-serif !important;
    font-size: 9px !important;
    font-weight: bold !important;
    fill: white !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Correção para mobile */
@media (max-width: 767px) {
    .standard-footer .app-button svg {
        width: 70px !important;
        height: 18px !important;
    }
    
    .standard-footer .app-button svg text {
        font-size: 7px !important;
    }
}
