/* ==========================================================================
   CT UNIVERSE brand header (CTUAV)
   Plain CSS (no Tailwind, no SCSS build needed) — light theme only.
   Brand palette: cyan #06b6d4 -> blue #3b82f6 -> violet #8b5cf6
   ========================================================================== */

.ctu-header {
    position: relative;
    width: 100%;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;                         /* py-2 px-4 */
    transition: all 0.3s ease-in-out;
    /* LIGHT theme */
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.95) 100%);
    border-bottom: 1px solid rgba(226,232,240,0.8);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);                  /* frosted-glass effect */
}

@media (min-width: 768px) {
    .ctu-header {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Logo (left) */
.ctu-header__logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Sidebar collapse toggle (hamburger) ===== */
.ctu-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: rgba(241,245,249,0.8);
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease-out;
}
.ctu-sidebar-toggle:hover {
    color: #3b82f6;
    border-color: #bfdbfe;
    background: #fff;
}
.ctu-header__logo img {
    height: 3.5rem;                               /* h-14 = 56px */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* Center block (absolute-centered) */
.ctu-header__center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===== Title "CT UNIVERSE" ===== */
.ctu-header__title {
    font-size: 1.875rem;                          /* text-3xl; md: 2.25rem */
    font-weight: 900;                             /* font-black */
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 0.1em;
    margin: 0 0 0.25rem 0;
    /* Gradient text: cyan -> blue -> violet */
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Glow */
    filter: drop-shadow(0 2px 8px rgba(59,130,246,0.4));
    text-shadow: 0 0 30px rgba(59,130,246,0.3);
    white-space: nowrap;
}

@media (min-width: 768px) {
    .ctu-header__title {
        font-size: 2.25rem;
    }
}

/* ===== Pill nav ===== */
.ctu-nav {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    border-radius: 9999px;
    background: rgba(241,245,249,0.8);            /* slate-100/80 */
    border: 1px solid #e2e8f0;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: scale(0.9);
    transform-origin: top;
}

.ctu-nav__item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;                               /* slate-500 */
    cursor: pointer;
    transition: all 0.3s ease-out;
    text-decoration: none;
    white-space: nowrap;
}
.ctu-nav__item:hover {
    color: #334155;
    background: rgba(226,232,240,0.5);
    text-decoration: none;
}
.ctu-nav__item.is-active {
    color: #fff;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
    box-shadow: 0 0 10px rgba(6,182,212,0.3);
}
.ctu-nav__item.is-active:hover {
    color: #fff;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
}

/* ===== Actions (right) ===== */
.ctu-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ctu-header__action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: rgba(241,245,249,0.8);
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-out;
}
.ctu-header__action-btn:hover {
    color: #3b82f6;
    border-color: #bfdbfe;
    background: #fff;
    text-decoration: none;
}

/* ===== Relocated WebODM user menu inside the header actions ===== */
.ctu-header__actions .navbar-top-links {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
}
.ctu-header__actions .navbar-top-links > li {
    position: relative;
    list-style: none;
    float: none;
}
.ctu-header__actions .navbar-top-links > li > .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0 0.6rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: rgba(241,245,249,0.8);
    color: #64748b;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease-out;
}
.ctu-header__actions .navbar-top-links > li > .dropdown-toggle:hover,
.ctu-header__actions .navbar-top-links > li.open > .dropdown-toggle {
    color: #3b82f6;
    border-color: #bfdbfe;
    background: #fff;
}
.ctu-header__actions .navbar-top-links .dropdown-menu {
    right: 0;
    left: auto;
}

/* ===== Unify into one header: collapse the legacy WebODM top bar, keep the sidebar ===== */
.ctu-legacy-navbar {
    min-height: 0;
    height: 0;
    margin-bottom: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.ctu-legacy-navbar .navbar-header {
    display: none;
}
@media (min-width: 768px) {
    /* Sidebar normally clears the 51px WebODM bar; now it sits right under the CT UNIVERSE header */
    .ctu-legacy-navbar .navbar-default.sidebar {
        top: 0;
        transition: transform 0.2s ease-in-out;
    }
    #page-wrapper {
        transition: margin-left 0.2s ease-in-out;
    }

    /* Collapsed state: slide the sidebar off-screen and reclaim its space */
    body.sidebar-collapsed .ctu-legacy-navbar .navbar-default.sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-collapsed #page-wrapper {
        margin-left: 0;
    }
}

/* On mobile the legacy navbar-toggle already handles the menu, so hide the header hamburger */
@media (max-width: 767px) {
    .ctu-sidebar-toggle {
        display: none;
    }
}
@media (max-width: 767px) {
    /* Keep the sidebar toggle reachable on mobile */
    .ctu-legacy-navbar {
        height: auto;
    }
    .ctu-legacy-navbar .navbar-header {
        display: block;
    }
}

/* ===== Responsive: allow nav to scroll horizontally on small screens ===== */
@media (max-width: 767px) {
    .ctu-header__center {
        position: static;
        transform: none;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0 0.5rem;
    }
    .ctu-header__title {
        font-size: 1.25rem;
        letter-spacing: 0.06em;
    }
    .ctu-nav {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ctu-header__logo img {
        height: 2.5rem;
    }
}
