@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&display=swap");

/* Purple brand bar — load this stylesheet after each portal page’s inline <style> */
.top-nav {
    background: linear-gradient(to right, #6356e5 0%, #7b47e1 100%);
    backdrop-filter: none;
    box-shadow: 0 4px 14px rgba(45, 35, 120, 0.35);
}

.portal-nav-brand {
    display: block;
    flex: 1;
    min-width: 0;
}

/* Logo left, brand title + subtext stacked right (same vertical block as logo) */
.portal-brand-row {
    --portal-logo-size: 3rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.portal-brand-logo {
    flex-shrink: 0;
}

.portal-brand-logo-box {
    width: var(--portal-logo-size);
    height: var(--portal-logo-size);
    border-radius: 22%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.portal-brand-scissor-icon {
    font-size: 1.75rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.88);
    display: block;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    text-align: left;
}

.portal-brand-name {
    margin: 0;
    padding: 0;
    font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(0.95rem, 2.8vw, 1.35rem);
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.portal-brand-desc {
    margin: 0;
    padding: 0;
    font-size: clamp(0.65rem, 2vw, 0.8rem);
    font-weight: 500;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
}

/* Back + dashboard brand (Place Order): same row as Index, back first */
.portal-nav-header-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

@media (max-width: 767px) {
    .portal-nav-header-start .portal-brand-name {
        font-size: clamp(0.78rem, 3.4vw, 1rem);
        letter-spacing: 0.03em;
    }
}

/* Back control: light on purple, not default Bootstrap grey */
.portal-nav-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.38rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #ffffff !important;
    text-decoration: none !important;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 2.25rem;
    min-height: 2.25rem;
}

.portal-nav-back-btn:hover,
.portal-nav-back-btn:focus {
    background: rgba(255, 255, 255, 0.32);
    color: #ffffff !important;
}

@media (max-width: 575px) {
    .portal-nav-back-btn {
        padding: 0.38rem;
        min-width: 2.35rem;
        min-height: 2.35rem;
        border-radius: 10px;
    }

    .portal-nav-back-btn .back-text {
        display: none;
    }
}

@media (min-width: 576px) {
    .portal-nav-back-btn .back-text {
        display: inline;
    }
}

/* Mobile bottom nav — shared (single-line labels, equal flex slots) */
.mobile-bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.45rem 0;
    border-top: 1px solid #e5e7eb;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.35rem 0.08rem;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
}

.mobile-nav-item.active {
    color: #6366f1;
}

.mobile-nav-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mobile-nav-item span {
    display: block;
    white-space: nowrap;
    font-size: clamp(0.52rem, 2.4vw, 0.7rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: center;
    max-width: 100%;
}

.mobile-nav-item:active {
    color: #6366f1;
    background: #f9fafb;
}

@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    .top-nav .nav-links a {
        color: rgba(255, 255, 255, 0.92);
        white-space: nowrap;
    }

    .top-nav .nav-links a:hover {
        background: rgba(255, 255, 255, 0.14);
        color: #ffffff;
    }

    .top-nav .nav-links a.active {
        background: rgba(255, 255, 255, 0.22);
        color: #ffffff;
    }

    .top-nav .logout-btn {
        background: rgba(239, 68, 68, 0.95) !important;
        color: #ffffff !important;
    }

    .top-nav .logout-btn:hover {
        background: #dc2626 !important;
        color: #ffffff !important;
    }

    .top-nav .btn-secondary {
        --bs-btn-color: #ffffff;
        --bs-btn-border-color: rgba(255, 255, 255, 0.55);
        --bs-btn-hover-color: #4c1d95;
        --bs-btn-hover-bg: #ffffff;
        --bs-btn-hover-border-color: #ffffff;
        --bs-btn-active-color: #4c1d95;
        --bs-btn-active-bg: #f3f4f6;
        --bs-btn-active-border-color: #f3f4f6;
    }
}
