/* ============================================================
   GerbangWeb — Mobile App-Like Design
   Overrides for viewport < 992px (loaded after style.css)
   ============================================================ */

/* ---------- Global: native app feel ---------- */
@media (max-width: 991.98px) {
    :root {
        --app-header-h: 58px;
        --app-tabbar-h: 64px;
    }

    html {
        -webkit-text-size-adjust: 100%;
        scroll-behavior: smooth;
    }

    body {
        /* ruang agar konten tidak tertutup bottom tab bar */
        padding-bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom) + 12px);
        background: #f7f8fa;
        -webkit-tap-highlight-color: transparent;
    }

    /* sentuhan seperti native: hilangkan highlight tap */
    a, button, .btn, .nav-link, .app-tab {
        -webkit-tap-highlight-color: transparent;
    }

    /* target sentuh minimum yang nyaman */
    .btn:not(.btn-sm):not(.btn-square):not(.btn-sm-square):not(.btn-link) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn:active {
        transform: scale(.97);
    }

    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    ::-webkit-scrollbar-thumb {
        background: rgba(9, 63, 149, .25);
        border-radius: 8px;
    }
}

/* ---------- Top bar: disembunyikan, header jadi app bar ---------- */
@media (max-width: 991.98px) {
    .top-bar {
        display: none;
    }
}

/* ---------- Navbar: app header dengan backdrop blur ---------- */
@media (max-width: 991.98px) {
    .navbar-light,
    .sticky-top.navbar-light {
        position: sticky !important;
        top: 0;
        z-index: 1030;
        min-height: var(--app-header-h);
        background: rgba(255, 255, 255, .86) !important;
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        backdrop-filter: saturate(180%) blur(16px);
        box-shadow: 0 1px 0 rgba(9, 63, 149, .04), 0 10px 28px rgba(9, 63, 149, .08);
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .navbar-light .navbar-brand img {
        max-height: 38px;
        transition: transform .25s ease;
    }

    .navbar-light .navbar-toggler {
        border: 0;
        padding: 6px 10px;
        color: #093F95;
        border-radius: 12px;
        background: #f1f4fa;
    }
    .navbar-light .navbar-toggler:focus {
        box-shadow: none;
    }
    .navbar-light .navbar-toggler .fa {
        font-size: 22px;
    }

    .app-navbar-actions {
        gap: 8px !important;
    }
    .app-icon-btn {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 12px;
        background: #f1f4fa;
        color: #093F95;
        font-size: 16px;
    }
    .app-icon-btn:active {
        transform: scale(.92);
    }

    /* Panel menu: tampil sebagai "bottom sheet" di bawah header */
    .navbar-light .navbar-collapse {
        margin: 10px -8px 0;
        background: #ffffff;
        border: 1px solid #eef0f4;
        border-radius: 18px;
        padding: 8px;
        box-shadow: 0 18px 44px rgba(9, 63, 149, .14);
        max-height: calc(100vh - var(--app-header-h) - 20px);
        overflow-y: auto;
    }

    .navbar-light .navbar-nav .nav-link,
    .sticky-top.navbar-light .navbar-nav .nav-link {
        padding: 14px 16px !important;
        margin: 2px 0;
        font-size: 15px;
        font-weight: 500;
        letter-spacing: .2px;
        color: #1D2833 !important;
        border: 0;
        border-radius: 12px;
    }
    .navbar-light .navbar-nav .nav-link:hover,
    .navbar-light .navbar-nav .nav-link.active {
        color: #093F95 !important;
        font-weight: 700;
        background: #eef3ff;
    }

    .navbar-collapse .btn-secondary {
        width: 100%;
        margin: 8px 0 4px !important;
        padding: 13px 16px !important;
        border-radius: 14px;
        font-weight: 600;
    }
    .navbar-collapse .btn.text-secondary {
        display: none;
    }
}

/* ---------- Hero: kartu besar dengan sudut membulat ---------- */
@media (max-width: 991.98px) {
    .hero-header {
        padding-top: 18px !important;
        border-radius: 0 0 32px 32px;
        overflow: hidden;
        margin-bottom: 0 !important;
        background-size: cover;
    }
    /* jangan tumpang tindih dengan hero yang membulat */
    .pricing-section {
        margin-top: 0 !important;
    }
    .hero-header .container.my-5.py-5 {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 20px !important;
        padding-bottom: 40px !important;
    }
    .hero-header h1 {
        font-size: 2rem;
        line-height: 1.22;
        letter-spacing: -.4px;
    }
    .hero-header p {
        font-size: 15px;
        line-height: 1.7;
    }
    .hero-header img {
        max-width: 300px;
        margin: 0 auto;
        filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .22));
    }
    .hero-header .btn {
        border-radius: 16px;
        font-weight: 600;
        box-shadow: 0 10px 24px rgba(0, 166, 193, .35);
    }
}

@media (max-width: 575.98px) {
    .hero-header h1 {
        font-size: 1.7rem;
    }
    .hero-header .btn {
        width: 100%;
        margin: 0 0 10px !important;
        padding: 14px 20px !important;
        font-size: 15px;
    }
}

/* ---------- Page header (sub pages): app-like top bar ---------- */
@media (max-width: 991.98px) {
    .page-header {
        padding-top: 26px !important;
        padding-bottom: 52px !important;
        border-radius: 0 0 32px 32px;
        overflow: hidden;
        margin-bottom: 0 !important;
    }
    .page-header h1 {
        font-size: 1.9rem;
        letter-spacing: -.4px;
    }
    .page-header p {
        font-size: 14px;
    }
}

/* ---------- Section title & spacing ---------- */
@media (max-width: 575.98px) {
    .section-title h1 {
        font-size: 1.5rem;
        letter-spacing: -.3px;
    }
    .section-title p {
        font-size: 14px;
    }
    .container-xxl .container {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ---------- Kartu: sudut membulat + bayangan lembut ---------- */
@media (max-width: 991.98px) {
    .card-admin,
    .position-relative.shadow.rounded,
    .bg-white.shadow.rounded,
    .team-item {
        border-radius: 18px !important;
        box-shadow: 0 10px 28px rgba(9, 63, 149, .08) !important;
    }
}

/* ---------- Paket cards ---------- */
@media (max-width: 575.98px) {
    .paket-card h4 {
        font-size: 1.2rem;
    }
    .paket-card h1 {
        font-size: 2.05rem;
    }
    .paket-card .btn {
        width: 100%;
        padding: 13px 16px !important;
        border-radius: 14px;
    }
    .position-relative.shadow.rounded.border-top.border-5 {
        border-radius: 20px !important;
    }
}

/* ---------- Portfolio: grid 2 kolom ala aplikasi ---------- */
@media (max-width: 575.98px) {
    .portfolio-item {
        border-radius: 16px;
        overflow: hidden;
    }
    .portfolio-item .position-relative,
    .portfolio-item > div {
        border-radius: 16px;
    }
    .portfolio-item .p-3 {
        padding: 10px !important;
    }
    .portfolio-item h6 {
        font-size: 13px;
    }
    .portfolio-item small {
        font-size: 11px;
    }
    .portfolio-item .position-relative > div:first-child {
        height: 150px !important;
    }
    .portfolio-item .fa-4x {
        font-size: 2.6rem;
    }
    .portfolio-item .btn-sm {
        width: 30px !important;
        height: 30px !important;
    }
}

/* ---------- Portfolio filter: chip horizontal ala aplikasi ---------- */
@media (max-width: 767.98px) {
    .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
        padding: 6px 2px 10px;
        scrollbar-width: none;
        gap: 8px;
    }
    .nav-pills::-webkit-scrollbar {
        display: none;
    }
    .nav-pills .nav-link {
        white-space: nowrap;
        padding: 10px 18px;
        border-radius: 50px;
        background: #f0f2f6;
        font-size: 13px;
        font-weight: 600;
    }
    .nav-pills .nav-link.active {
        background: var(--primary);
        color: #fff !important;
        box-shadow: 0 6px 14px rgba(9, 63, 149, .28);
    }
}

/* ---------- Visi & Misi cards ---------- */
@media (max-width: 575.98px) {
    .bg-white.shadow.rounded.p-5 {
        padding: 1.5rem !important;
    }
}

/* ---------- Footer: disembunyikan di versi mobile ---------- */
@media (max-width: 991.98px) {
    .footer {
        display: none !important;
    }
}

/* ============================================================
   BOTTOM TAB BAR — navigasi utama ala aplikasi Android/iOS
   ============================================================ */
.app-tabbar {
    display: none;
}

@media (max-width: 991.98px) {
    .app-tabbar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 1020;
        display: flex;
        justify-content: space-around;
        align-items: flex-end;
        padding: 6px 8px;
        background: rgba(255, 255, 255, .94);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border: 1px solid rgba(9, 63, 149, .06);
        border-radius: 24px;
        box-shadow: 0 14px 40px rgba(9, 63, 149, .18);
        transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .32s ease;
    }

    .app-tabbar.app-tabbar-hidden {
        transform: translateY(130%);
        opacity: 0;
        pointer-events: none;
    }

    .app-tab {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 48px;
        padding: 6px 4px;
        border-radius: 14px;
        color: #8b94a6;
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        letter-spacing: .2px;
        transition: color .2s ease, transform .15s ease;
        cursor: pointer;
    }
    .app-tab i {
        font-size: 21px;
        line-height: 1;
    }
    .app-tab:active {
        transform: scale(.9);
    }
    .app-tab.active {
        color: var(--primary);
        font-weight: 700;
    }
    .app-tab.active i {
        transform: translateY(-1px);
    }
    .app-tab.active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        width: 5px;
        height: 5px;
        margin-left: -2.5px;
        border-radius: 50%;
        background: var(--primary);
    }

    /* Tab WhatsApp: FAB menonjol di tengah */
    .app-tab-wa {
        flex: 0 0 72px;
        color: #25D366;
    }
    .app-tab-wa .wa-fab {
        width: 54px;
        height: 54px;
        margin-top: -30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: linear-gradient(135deg, #25D366, #1eb858);
        color: #fff;
        font-size: 26px;
        border: 3px solid #fff;
        box-shadow: 0 8px 20px rgba(37, 211, 102, .45);
        transition: transform .18s ease;
        animation: app-wa-pulse 2.4s infinite;
    }
    .app-tab-wa .wa-fab:active {
        transform: scale(.9);
    }

    @keyframes app-wa-pulse {
        0%   { box-shadow: 0 8px 20px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, .4); }
        70%  { box-shadow: 0 8px 20px rgba(37, 211, 102, .45), 0 0 0 14px rgba(37, 211, 102, 0); }
        100% { box-shadow: 0 8px 20px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, 0); }
    }
}

/* ---------- Floating WhatsApp: disembunyikan di mobile (pakai tab bar) ---------- */
@media (max-width: 991.98px) {
    .wa-float {
        display: none !important;
    }
}

/* ---------- Smooth reveal card (mobile) ---------- */
@media (max-width: 991.98px) {
    .row.g-4 > [class*="col-"],
    .row.gy-5 > [class*="col-"] {
        will-change: transform, opacity;
    }
}
