/* Shared public landing navbar + Android mobile shell */

.navbar-custom {
    background: rgba(30, 58, 138, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 48px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.navbar-custom.scrolled {
    padding: 14px 48px;
    background: rgba(30, 58, 138, 0.98);
}

.navbar-custom > .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 50px;
    column-gap: 24px;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}

.navbar-custom .navbar-header {
    float: none;
    margin: 0;
    z-index: 2;
    grid-column: 1;
    justify-self: start;
    position: static;
    transform: none;
}

.navbar-brand-custom {
    font-size: 22px;
    font-weight: 700;
    color: #fff !important;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    gap: 10px;
}

.navbar-brand-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar-brand-text {
    line-height: 1.2;
}

.landing-top-login {
    display: none !important;
}

.navbar-custom .navbar-collapse {
    float: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    grid-column: 2;
    justify-self: center;
    justify-content: center;
    align-items: center;
    width: auto;
}

@media (min-width: 993px) {
    .navbar-custom .navbar-collapse,
    .navbar-custom .navbar-collapse.collapse,
    .navbar-custom .navbar-collapse.collapsing {
        display: flex !important;
        height: auto !important;
        overflow: visible !important;
    }
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navbar-auth-desktop {
    grid-column: 3;
    justify-self: end;
}

.navbar-auth-mobile {
    display: none;
}

.navbar-nav-custom {
    float: none !important;
    margin: 0 auto !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.navbar-nav-custom > li {
    float: none !important;
    display: inline-block;
}

.navbar-nav-custom li a {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 500;
    padding: 10px 18px !important;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.navbar-nav-custom li a:not(.btn-login):not(.btn-register):hover,
.navbar-nav-custom li.active a:not(.btn-login):not(.btn-register) {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px;
}

.navbar-nav-custom li.active a {
    color: #FFD700 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.35);
}

.btn-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff !important;
    padding: 10px 26px !important;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
    text-align: center;
}

.btn-login:hover,
.btn-login:focus {
    background: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
    color: #FFD700 !important;
    text-decoration: none !important;
}

.btn-register {
    background: #2563eb;
    border: none;
    color: #fff !important;
    padding: 10px 26px !important;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 4px;
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-register:hover,
.btn-register:focus {
    background: #1d4ed8;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.navbar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 9px 10px;
    margin-top: 8px;
    margin-right: 0;
    float: right;
    display: none;
    border-radius: 10px;
}

.navbar-toggle .icon-bar { background-color: #fff; }
.navbar-toggle:hover,
.navbar-toggle:focus { background: rgba(255, 255, 255, 0.15); }

/* Drawer hidden on desktop */
.landing-drawer,
.landing-drawer-overlay {
    display: none;
}

@media (max-width: 1200px) {
    .navbar-custom { padding: 16px 32px; }
    .navbar-custom.scrolled { padding: 12px 32px; }
}

/* ===== Android mobile shell ===== */
@media (max-width: 992px) {
    :root {
        --ln-top: 56px;
        --ln-safe-bottom: env(safe-area-inset-bottom, 0px);
        --ln-safe-top: env(safe-area-inset-top, 0px);
    }

    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    body.landing-drawer-open {
        overflow: hidden !important;
    }

    .navbar-custom {
        padding: 0 12px !important;
        height: calc(var(--ln-top) + var(--ln-safe-top));
        padding-top: var(--ln-safe-top) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
        background: #1e3a8a !important;
        backdrop-filter: none;
    }

    .navbar-custom.scrolled {
        padding: 0 12px !important;
        padding-top: var(--ln-safe-top) !important;
    }

    .navbar-custom > .container {
        display: block;
        padding: 0;
        min-height: var(--ln-top);
        max-width: none;
    }

    .navbar-custom .navbar-header {
        width: 100%;
        min-height: var(--ln-top);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .navbar-toggle,
    .landing-drawer-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        float: none;
        order: 0;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border-radius: 20px;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        flex-direction: column;
        gap: 4px;
    }

    .landing-drawer-toggle .icon-bar {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 1px;
        background: #fff;
    }

    .navbar-brand-custom {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        font-size: 14px;
        font-weight: 600;
        gap: 8px;
        align-items: center;
        overflow: visible;
    }

    .navbar-brand-logo {
        height: 30px !important;
        width: 30px !important;
        flex-shrink: 0;
    }

    .navbar-brand-text {
        display: block;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.15;
        word-break: keep-all;
        hyphens: none;
    }

    .landing-top-login {
        display: none !important;
    }

    /* Hide Bootstrap collapse menu on mobile — use drawer + bottom nav instead */
    .navbar-custom .navbar-collapse,
    .navbar-custom .navbar-collapse.collapse,
    .navbar-custom .navbar-collapse.collapsing,
    .navbar-custom .navbar-collapse.in,
    .navbar-custom #navbar-collapse,
    .navbar-auth-desktop,
    .navbar-auth-mobile,
    .navbar-nav-custom {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        pointer-events: none !important;
    }

    /* Drawer overlay */
    .landing-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(2, 6, 23, 0.55);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    body.landing-drawer-open .landing-drawer-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .landing-drawer-overlay[hidden] {
        display: none !important;
    }

    body.landing-drawer-open .landing-drawer-overlay {
        display: block !important;
    }

    /* Side drawer */
    .landing-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 86vw);
        z-index: 1200;
        background: #172554;
        color: #fff;
        transform: translateX(-105%);
        transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding: calc(12px + var(--ln-safe-top)) 0 calc(16px + var(--ln-safe-bottom));
    }

    body.landing-drawer-open .landing-drawer {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    }

    .landing-drawer-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .landing-drawer-logo {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        object-fit: contain;
        background: rgba(255, 255, 255, 0.08);
        padding: 4px;
    }

    .landing-drawer-title {
        font-size: 16px;
        font-weight: 700;
        line-height: 1.2;
    }

    .landing-drawer-sub {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.65);
        margin-top: 2px;
    }

    .landing-drawer-close {
        margin-left: auto;
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 16px;
    }

    .landing-drawer-nav {
        flex: 1;
        overflow-y: auto;
        padding: 12px 0;
        -webkit-overflow-scrolling: touch;
    }

    .landing-drawer-link {
        display: flex;
        align-items: center;
        gap: 16px;
        min-height: 48px;
        padding: 12px 20px;
        margin: 2px 8px 2px 0;
        border-radius: 0 24px 24px 0;
        color: rgba(255, 255, 255, 0.88) !important;
        text-decoration: none !important;
        font-size: 15px;
        font-weight: 500;
    }

    .landing-drawer-link i {
        width: 24px;
        text-align: center;
        font-size: 18px;
        color: rgba(255, 255, 255, 0.7);
    }

    .landing-drawer-link.active,
    .landing-drawer-link:active {
        background: rgba(255, 215, 0, 0.14);
        color: #FFD700 !important;
    }

    .landing-drawer-link.active i,
    .landing-drawer-link:active i {
        color: #FFD700;
    }

    .landing-drawer-actions {
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .landing-drawer-actions .btn-login,
    .landing-drawer-actions .btn-register {
        width: 100%;
        margin: 0;
        min-height: 44px;
        line-height: 24px;
        border-radius: 10px;
    }
}

@media (max-width: 768px) {
    .navbar-brand-custom {
        font-size: 13px;
    }

    .navbar-brand-text {
        letter-spacing: -0.01em;
    }
}

@media (max-width: 360px) {
    .navbar-brand-custom {
        font-size: 12px;
        gap: 6px;
    }

    .navbar-brand-logo {
        height: 28px !important;
        width: 28px !important;
    }
}
