/* AfriFlex mobile styles */

/* ============================================
   Header
   ============================================ */
.af-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(11,11,15,.95), rgba(11,11,15,.75));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 16px;
}
.af-logo { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.af-logo span { color: var(--af-red); }

/* ============================================
   Hero
   ============================================ */
.af-hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: flex-end;
    padding: 20px 16px 28px;
    background-size: cover;
    background-position: center;
}
.af-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(11,11,15,.6) 55%, var(--af-bg) 100%);
}
.af-hero-content { position: relative; z-index: 2; width: 100%; }
.af-hero h1 { font-size: 1.8rem; line-height: 1.15; margin-bottom: 8px; }
.af-hero .meta { color: var(--af-muted); font-size: .85rem; margin-bottom: 10px; }
.af-hero p.desc { font-size: .95rem; color: #d6d6dd; margin-bottom: 16px; }
.af-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--af-radius-sm);
    font-weight: 600;
    font-size: .9rem;
    transition: .2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--af-red); color: #fff; }
.btn-primary:hover { background: var(--af-red-dark); }
.btn-secondary {
    background: rgba(255,255,255,.12);
    color: #fff;
    backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(255,255,255,.2); }
.btn-block { width: 100%; }

/* ============================================
   Content rows + cards
   ============================================ */
.af-row { margin: 24px 0; }
.af-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 10px;
}
.af-row-head h2 { font-size: 1.05rem; }
.af-row-head a { color: var(--af-muted); font-size: .8rem; }
.af-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 16px 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.af-scroller::-webkit-scrollbar { display: none; }
.af-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    border-radius: var(--af-radius);
    overflow: hidden;
    background: var(--af-surface);
    transition: transform .2s;
}
.af-card:active { transform: scale(.97); }
.af-card img { width: 100%; height: 200px; object-fit: cover; }
.af-card .title { padding: 8px 10px; font-size: .82rem; font-weight: 600; }
.af-card .sub { padding: 0 10px 10px; font-size: .72rem; color: var(--af-muted); }

/* ============================================
   Tabs
   ============================================ */
.af-tabs { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; }
.af-tab {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--af-surface-2);
    font-size: .82rem;
    white-space: nowrap;
    color: #cfcfd6;
    text-decoration: none;
}
.af-tab.active { background: var(--af-red); color: #fff; }

/* ============================================
   Search bar
   ============================================ */
.af-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--af-surface-2);
    border-radius: var(--af-radius);
    padding: 12px 14px;
    margin: 8px 16px;
}
.af-search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: .95rem;
}

/* ============================================
   MOBILE BOTTOM NAVIGATION (single clean block)
   ============================================ */
.af-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
    background: rgba(15, 15, 20, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.af-bottom-nav .af-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    color: #8a8a95;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
}

.af-bottom-nav .af-nav-item:active { transform: scale(0.94); }
.af-bottom-nav .af-nav-item.active { color: #e50914; }

.af-bottom-nav .af-nav-icon {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
    /* No fill, no filter — the SVG uses stroke="currentColor" */
}

.af-bottom-nav .af-nav-item span {
    display: block;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================================
   Body padding so content isn't hidden behind the fixed nav
   ============================================ */
body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }
.af-main, .af-dashboard { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }

/* ═══════════════════════════════════════════
   Hero layout tightening — remove top gap
   ═══════════════════════════════════════════ */
.af-hero {
    min-height: auto;
    padding: 24px 16px 28px;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.af-hero-empty h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.af-hero-empty p {
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Tighten header */
.af-header {
    padding: 10px 16px;
}

/* Remove any excessive top margin on the main container */
.af-main > *:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   Hero layout tightening — remove top gap
   ═══════════════════════════════════════════ */
.af-hero {
    min-height: auto;
    padding: 24px 16px 28px;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.af-hero-empty h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.af-hero-empty p {
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Tighten header */
.af-header {
    padding: 10px 16px;
}

/* Remove any excessive top margin on the main container */
.af-main > *:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   Hero layout tightening — remove top gap
   ═══════════════════════════════════════════ */
.af-hero {
    min-height: auto;
    padding: 24px 16px 28px;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.af-hero-empty h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.af-hero-empty p {
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Tighten header */
.af-header {
    padding: 10px 16px;
}

/* Remove any excessive top margin on the main container */
.af-main > *:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   Hero layout tightening — remove top gap
   ═══════════════════════════════════════════ */
.af-hero {
    min-height: auto;
    padding: 24px 16px 28px;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.af-hero-empty h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.af-hero-empty p {
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Tighten header */
.af-header {
    padding: 10px 16px;
}

/* Remove any excessive top margin on the main container */
.af-main > *:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   Hero layout tightening — remove top gap
   ═══════════════════════════════════════════ */
.af-hero {
    min-height: auto;
    padding: 24px 16px 28px;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.af-hero-empty h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.af-hero-empty p {
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Tighten header */
.af-header {
    padding: 10px 16px;
}

/* Remove any excessive top margin on the main container */
.af-main > *:first-child {
    margin-top: 0;
}

/* Mobile hero — compact banner instead of full-screen */
@media (max-width: 767px) {
    .af-hero {
        min-height: auto;
        padding: 32px 16px;
        background-position: center;
        background-size: cover;
    }

    .af-hero::after {
        background: linear-gradient(180deg, rgba(11,11,15,.5) 0%, rgba(11,11,15,.85) 100%);
    }

    .af-hero-content {
        max-width: 100%;
    }

    .af-hero h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 6px;
    }

    .af-hero .meta {
        font-size: .78rem;
        margin-bottom: 8px;
    }

    .af-hero p.desc {
        font-size: .88rem;
        line-height: 1.4;
        margin-bottom: 14px;
    }
}

/* Remove all spacing between header and hero */
.af-header + .af-main,
.af-header ~ .af-main {
    margin-top: 0;
    padding-top: 0;
}

.af-main > .af-hero:first-child,
.af-main > section.af-hero:first-child {
    margin-top: 0;
}

/* Remove space between hero and next section */
.af-hero + .af-row,
.af-hero + section {
    margin-top: 16px;
}

/* Reset main container padding */
.af-main {
    padding-top: 0;
    margin-top: 0;
}

main.af-main {
    padding-top: 0;
}

/* ═══════════════════════════════════════════
   Layout tightening — remove vertical gaps
   ═══════════════════════════════════════════ */

/* Compact header */
.af-header {
    padding: 10px 16px;
}

/* Remove gap between header and main content */
.af-main {
    padding-top: 0;
    margin-top: 0;
}

/* Compact hero — starts right below the header */
.af-hero {
    min-height: auto;
    padding: 32px 16px 36px;
    background-size: cover;
    background-position: center;
    align-items: center;
}

.af-hero-content {
    padding-top: 0;
    margin-top: 0;
}

.af-hero-empty {
    min-height: 55vh;
    padding: 40px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Mobile-specific hero */
@media (max-width: 767px) {
    .af-hero {
        min-height: auto;
        padding: 28px 16px 32px;
    }

    .af-hero::after {
        background: linear-gradient(180deg, rgba(11,11,15,.4) 0%, rgba(11,11,15,.9) 100%);
    }

    .af-hero h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 6px;
    }

    .af-hero .meta {
        font-size: .78rem;
        margin-bottom: 8px;
    }

    .af-hero p.desc {
        font-size: .88rem;
        line-height: 1.4;
        margin-bottom: 14px;
    }

    .af-hero-empty h1 {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .af-hero-empty p {
        font-size: .85rem;
        margin-bottom: 16px;
    }
}

/* Tighter spacing after hero */
.af-hero + .af-row,
.af-hero + section {
    margin-top: 12px;
}

/* Remove first-child top margin */
.af-main > *:first-child {
    margin-top: 0;
}
