/* ============================================================
   ALGO BLESS - APPLICATION HEADER
   ============================================================ */

:root {
    --header-bg: #0b1120;
    --header-text: #ffffff;
    --header-muted: #cbd5e1;
    --header-accent: #38bdf8;
    --header-border: rgba(255, 255, 255, 0.08);
}


/* ============================================================
   HEADER
   ============================================================ */

.app-header {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--header-border);
    z-index: 1050;
}


/* ============================================================
   HEADER CONTAINER
   ============================================================ */

.header-container {
    width: 100%;
    height: 64px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    margin: 0;
}


/* ============================================================
   LEFT - LOGO
   ============================================================ */

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

    .header-left .navbar-brand-link {
        display: flex;
        align-items: center;
        height: 100%;
    }

        .header-left .navbar-brand-link img {
            height: 48px;
            width: auto;
            max-width: 215px;
            object-fit: contain;
        }
.navbar-brand-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    line-height: 0;
}


    .navbar-brand-link img {
        display: block;
        width: auto;
        height: 32px;
        max-width: 150px;
        object-fit: contain;
    }


/* ============================================================
   CENTER - DESKTOP NAVIGATION
   ============================================================ */

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}
    .desktop-nav a {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        min-height: 42px;
        padding: 8px 15px;
        border-radius: 8px;
        color: var(--header-muted);
        text-decoration: none !important;
        white-space: nowrap;
        font-size: 14px;
        font-weight: 500;
        transition: color 0.15s ease, background 0.15s ease;
    }


        .desktop-nav a:hover:not(.nav-disabled),

        .desktop-nav a.active {
            color: #ffffff !important;
            background: rgba(56, 189, 248, 0.14);
            font-weight: 600;
        }


        .desktop-nav a i {
            font-size: 14px;
            flex-shrink: 0;
        }
        .desktop-nav a.active::after {
            content: "";
            position: absolute;
            left: 14px;
            right: 14px;
            bottom: 2px;
            height: 2px;
            border-radius: 2px;
            background: var(--header-accent);
        }

        /* ============================================================
   DISABLED / COMING SOON
   ============================================================ */

        .desktop-nav a.nav-disabled {
            color: #64748b !important;
            opacity: 1;
            cursor: default;
        }

            .desktop-nav a.nav-disabled i {
                color: #64748b;
            }

            .desktop-nav a.nav-disabled .coming-soon-tag {
                display: inline-flex;
                align-items: center;
                margin-left: 2px;
                padding: 1px 5px;
                border: 1px solid #475569;
                border-radius: 4px;
                color: #94a3b8;
                background: rgba(71, 85, 105, 0.18);
                font-size: 8px;
                font-weight: 600;
                line-height: 1.2;
                text-transform: uppercase;
            }

            .desktop-nav a.nav-disabled:hover {
                color: #64748b !important;
                background: transparent;
            }


/* ============================================================
   RIGHT - USER AREA
   ============================================================ */

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    gap: 14px;
}


.user-meta {
    display: flex;
    align-items: center;
    min-width: 0;
}


.user-account {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    white-space: nowrap;
    font-size: 13px;
}


.user-welcome {
    color: #e2e8f0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}


.user-separator {
    color: #475569;
    user-select: none;
}


.logout-link {
    color: #f87171 !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.15s ease;
}


    .logout-link:hover {
        color: #fca5a5 !important;
    }


.login-link {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}


    .login-link:hover {
        color: var(--header-accent) !important;
    }


/* ============================================================
   MOBILE MENU BUTTON
   ============================================================ */

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}


    .menu-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.18);
    }


    .menu-toggle:focus-visible {
        outline: 2px solid var(--header-accent);
        outline-offset: 2px;
    }


/* ============================================================
   MOBILE NAVIGATION
   ============================================================ */

#mobileNav {
    width: 100%;
    background: #0f172a;
    border-top: 1px solid var(--header-border);
}


.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px 14px;
}


    .mobile-nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 9px 12px;
        border-radius: 8px;
        color: #cbd5e1 !important;
        text-decoration: none !important;
        font-size: 14px;
        font-weight: 500;
        transition: color 0.15s ease, background 0.15s ease;
    }


        .mobile-nav-links a:hover:not(.nav-disabled) {
            color: #ffffff !important;
            background: rgba(255, 255, 255, 0.06);
        }


        .mobile-nav-links a i {
            width: 20px;
            margin-right: 8px;
            text-align: center;
        }


        .mobile-nav-links a.nav-disabled {
            color: #64748b !important;
            cursor: not-allowed;
        }


    .mobile-nav-links .coming-soon-tag {
        margin-left: auto;
    }


/* ============================================================
   LARGE DESKTOP
   ============================================================ */

@media (min-width: 1400px) {

    .header-container {
        padding-left: 32px;
        padding-right: 32px;
        gap: 32px;
    }


    .desktop-nav {
        gap: 8px;
    }


        .desktop-nav a {
            padding-left: 14px;
            padding-right: 14px;
        }
}


/* ============================================================
   LAPTOP
   ============================================================ */

@media (min-width: 992px) and (max-width: 1199px) {

    .header-container {
        padding-left: 18px;
        padding-right: 18px;
        gap: 12px;
    }


    .desktop-nav {
        gap: 2px;
    }


        .desktop-nav a {
            gap: 6px;
            padding-left: 8px;
            padding-right: 8px;
            font-size: 12px;
        }


    .user-account {
        font-size: 12px;
        gap: 6px;
    }


    .user-welcome {
        max-width: 170px;
    }
}


/* ============================================================
   TABLET / SMALL DESKTOP
   ============================================================ */

@media (max-width: 991px) {

    .header-container {
        height: 60px;
        grid-template-columns: auto 1fr auto;
        padding: 0 16px;
    }


    .navbar-brand-link img {
        height: 30px;
        max-width: 140px;
    }


    .header-right {
        gap: 8px;
    }


    .user-account {
        font-size: 12px;
    }


    .user-welcome {
        max-width: 180px;
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 575px) {

    .header-container {
        height: 58px;
        padding: 0 12px;
    }


    .navbar-brand-link img {
        height: 28px;
        max-width: 125px;
    }


    .user-meta {
        display: none;
    }


    .header-right {
        gap: 0;
    }


    .menu-toggle {
        width: 36px;
        height: 36px;
    }
}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 360px) {

    .navbar-brand-link img {
        height: 26px;
        max-width: 112px;
    }


    .header-container {
        padding-left: 10px;
        padding-right: 10px;
    }
}
/* ============================================================
   LOGO
   ============================================================ */

.navbar-brand-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
}

    .navbar-brand-link img {
        display: block;
        width: auto;
        height: 38px;
        max-width: 155px;
        object-fit: contain;
    }


/* ============================================================
   USER MENU
   ============================================================ */

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}


/* ------------------------------------------------------------
   Trigger
   ------------------------------------------------------------ */

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 3px;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.15s ease;
}

    .user-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .user-menu-trigger:focus-visible {
        outline: 2px solid #38bdf8;
        outline-offset: 2px;
    }


/* ------------------------------------------------------------
   Avatar
   ------------------------------------------------------------ */

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient( 135deg, #2563eb, #0ea5e9 );
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}


/* ------------------------------------------------------------
   Chevron
   ------------------------------------------------------------ */

.user-menu-chevron {
    margin-right: 4px;
    color: #64748b;
    font-size: 9px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.user-menu-trigger:hover .user-menu-chevron {
    color: #cbd5e1;
}

.user-menu.open .user-menu-chevron {
    transform: rotate(180deg);
    color: #cbd5e1;
}


/* ============================================================
   DROPDOWN
   ============================================================ */

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 2000;
}


.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* ============================================================
   DROPDOWN HEADER
   ============================================================ */

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
}


/* Larger avatar */

.user-dropdown-avatar {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient( 135deg, #2563eb, #0ea5e9 );
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}


/* Identity */

.user-dropdown-identity {
    min-width: 0;
}

.user-dropdown-name {
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-dropdown-label {
    margin-top: 2px;
    color: #6b7280;
    font-size: 11px;
}


/* ============================================================
   DIVIDER
   ============================================================ */

.user-dropdown-divider {
    height: 1px;
    margin: 4px 6px;
    background: #e5e7eb;
}


/* ============================================================
   DROPDOWN ITEMS
   ============================================================ */

.user-dropdown-actions {
    padding: 2px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #374151 !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

    .user-dropdown-item:hover {
        background: #f3f4f6;
        color: #111827 !important;
    }

    .user-dropdown-item i {
        width: 18px;
        text-align: center;
        font-size: 13px;
    }

.user-dropdown-logout:hover {
    background: #fef2f2;
    color: #dc2626 !important;
}

    .user-dropdown-logout:hover i {
        color: #dc2626;
    }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {

    .navbar-brand-link img {
        height: 34px;
        max-width: 145px;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }
}


@media (max-width: 575px) {

    .navbar-brand-link img {
        height: 32px;
        max-width: 135px;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }

    .user-menu-chevron {
        display: none;
    }

    .user-dropdown {
        position: fixed;
        top: 58px;
        right: 10px;
        width: min(260px, calc(100vw - 20px));
    }
}