/**
 * FIX FOOTER POSITION - Remove Gap Below Footer
 * Ensures "Built by Veterans" footer sits directly above bottom navigation
 */

/* Desktop and all screens */
.app-footer {
    position: relative !important;
    margin-bottom: 0 !important;
    padding-bottom: 0.25rem !important;
    background: #0a1628 !important;
    z-index: 100 !important;
}

/* Mobile - Footer should be just above bottom nav */
@media (max-width: 768px) {
    .app-footer {
        position: fixed !important;
        bottom: 60px !important; /* Bottom nav height */
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0.25rem 1rem !important; /* Reduced from 0.5rem */
        background: rgba(10, 22, 40, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 500 !important;
        font-size: 0.8rem !important; /* Smaller text */
        gap: 0.05rem !important;
    }

    /* Smaller footer text */
    .app-footer p {
        font-size: 0.85rem !important; /* Reduced from 1rem */
        margin: 0.1rem 0 !important;
    }

    .app-footer-copyright {
        font-size: 0.6rem !important; /* Reduced from 0.68rem */
    }

    /* Adjust main content to account for fixed footer - more space for content */
    main,
    .page,
    .dashboard-page,
    .nutrition-page,
    .training-page,
    .rehab-page,
    .community-page,
    .timetable-page,
    .profile-page {
        padding-bottom: calc(95px + env(safe-area-inset-bottom, 0)) !important;
        /* 60px bottom nav + 35px footer (reduced from 50px) */
    }

    /* Ensure no body/html gaps */
    body {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    html {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Community page specific - already has fixed positioning */
    .dc-layout {
        bottom: 95px !important; /* bottom nav + smaller footer */
    }
}

/* Tablet and above - footer at natural position */
@media (min-width: 769px) {
    .app-footer {
        position: relative !important;
        margin-top: auto !important;
    }
}

/* Safe area inset support for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .app-footer {
            bottom: calc(60px + env(safe-area-inset-bottom, 0)) !important;
            padding-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0)) !important;
        }

        main,
        .page {
            padding-bottom: calc(95px + env(safe-area-inset-bottom, 0)) !important;
        }
    }
}
