/* ── Shared App Navbar ─────────────────────────────── */
:root {
    --nav-h: 88px;
    --primary: #6366f1;
    --dark: #0f172a;
}

* {
    font-family: 'Inter', sans-serif;
}

.app-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    height: var(--nav-h);
    display: flex;
    align-items: center;
}

@media (max-width: 576px) {
    :root {
        --nav-h: 70px;
    }

    .app-nav-inner {
        padding: 0 12px;
    }

    .app-nav-right {
        gap: 6px;
    }

    .app-nav-right .btn {
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 0.75rem !important;
    }
}

.app-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 24px;
}

.app-nav-logo img {
    height: clamp(40px, 8vw, 70px);
    width: auto;
    display: block;
}

/* Center links */
.app-nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.app-nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.app-nav-links a.active {
    background: #2e3052;
    /* Dark indigo pill to match screenshot */
    color: #fff;
    font-weight: 600;
}

.app-nav-links a i {
    font-size: 0.85rem;
    color: #818cf8;
}

/* Right side */
.app-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User pill */
.nav-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
    text-decoration: none;
}

.nav-user-pill:hover {
    opacity: 0.8;
}

.nav-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.nav-user-name {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Hamburger */
.app-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 9px 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.app-hamburger:hover {
    background: rgba(255, 255, 255, 0.14);
}

.app-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

.app-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.app-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.app-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.app-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
}

.app-mobile-menu.open {
    display: block;
}

.app-mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.app-mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(300px, 85vw);
    height: 100%;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
}

.app-mobile-menu.open .app-mobile-panel {
    transform: translateX(0);
}

.app-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-mobile-close {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    transition: background 0.2s;
}

.app-mobile-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.app-mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.app-mobile-user .mu-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.app-mobile-user .mu-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.app-mobile-links {
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    flex: 1;
}

.app-mobile-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.app-mobile-links li a:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.app-mobile-links li a i {
    width: 16px;
    text-align: center;
    color: #818cf8;
}

.app-mobile-foot {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Page body offset */
body {
    background: #ffffff;
}

main.app-main {
    min-height: calc(100vh - var(--nav-h));
    padding: 36px 0 140px; /* Enhanced bottom padding for mobile safety and fixed navs */
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 20px));
}

@media (max-width: 860px) {
    .app-nav-links {
        display: none;
    }

    .app-hamburger {
        display: flex !important;
    }
}

@media (max-width: 768px) {

    .app-nav-right .nav-user-name,
    .app-nav-right .btn-logout {
        display: none !important;
    }

    .app-nav-right .nav-user-pill {
        padding-right: 4px;
        background: transparent;
        border-color: transparent;
    }
}

/* Horizontal Step Ribbon Enhancements */
#builder-steps-horizontal {
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 5px;
}

#builder-steps-horizontal::-webkit-scrollbar {
    display: none;
}

@media (max-width: 576px) {
    #builder-steps-horizontal .step-ribbon {
        padding: 8px 15px !important;
        font-size: 0.75rem !important;
    }

    #builder-steps-horizontal {
        gap: 10px !important;
    }

    /* ── Colored Inputs & Labels ───────────────────────── */
    .uppercase-label {
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        font-size: 0.72rem !important;
        color: #4338ca !important;
        /* Brand Dark Indigo */
        font-weight: 700 !important;
        display: block;
        margin-bottom: 0.5rem;
    }

    .uppercase-label i {
        color: #6366f1 !important;
        /* Brand Indigo */
        margin-right: 4px;
    }

    /* Global Placeholder Coloring */
    ::placeholder {
        color: #6366f1 !important;
        /* Brand Indigo Muted */
        opacity: 0.45 !important;
    }

    ::-webkit-input-placeholder {
        color: #6366f1 !important;
        opacity: 0.45 !important;
    }

    ::-moz-placeholder {
        color: #6366f1 !important;
        opacity: 0.45 !important;
    }

    :-ms-input-placeholder {
        color: #6366f1 !important;
        opacity: 0.45 !important;
    }

    .form-control:focus::placeholder {
        opacity: 0.2 !important;
    }

    /* Specific colored placeholders per brand theme */
    .form-control-indigo::placeholder {
        color: #818cf8 !important;
        opacity: 0.6 !important;
    }

    .form-control-emerald::placeholder {
        color: #10b981 !important;
        opacity: 0.6 !important;
    }
}

/* Mobile Bottom Nav Fixes */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020; /* Reduced to stay below Bootstrap modals (1050+) */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.mobile-nav-items {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    gap: 5px;
    overflow-x: auto;
    padding: 0 10px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #111827;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 60px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-bottom-color: #800000;
    border-radius: 12px;
    padding: 6px 8px;
}

.mobile-nav-item i {
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.mobile-nav-item.active {
    color: #111827;
    background: #fff;
    border-bottom-color: #800000;
}
