/* ============================================================
   UB Navigation / Header — Custom CSS (no Tailwind utilities)
   Import on every page that uses the shared header.
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --ub-primary:       #eb4921;
    --ub-primary-dark:  #d4360e;
    --ub-header-bg:     #0f0f14;
    --ub-header-border: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   Header Shell
   ============================================================ */

.ub-header {
    position: relative;
    width: 100%;
    z-index: 50;
    background-color: var(--ub-header-bg);
}

.ub-header__glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.10), transparent);
    pointer-events: none;
}

/* ============================================================
   Inner Container
   ============================================================ */

.ub-header__inner {
    max-width: 80rem; /* 1280px */
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 640px) {
    .ub-header__inner { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
    .ub-header__inner { padding: 0 2rem; }
}

/* ============================================================
   Top Bar
   ============================================================ */

.ub-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem; /* 80px */
}

/* ============================================================
   Logo
   ============================================================ */

.ub-header__logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.ub-header__logo img {
    height: 2.25rem; /* 36px */
    width: auto;
    transition: transform 0.3s ease;
}

.ub-header__logo:hover img {
    transform: scale(1.05);
}

/* ============================================================
   Desktop Navigation
   ============================================================ */

.ub-header__nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .ub-header__nav { display: flex; }
}

/* Nav link base */
.ub-nav-link {
    position: relative;
    padding-bottom: 4px;
    font-size: 0.9375rem; /* 15px */
    font-weight: 600;
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.ub-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: var(--ub-primary);
    border-radius: 99px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.ub-nav-link:hover {
    color: #ffffff;
}

.ub-nav-link:hover::after {
    transform: scaleX(1);
}

/* Dropdown chevron */
.ub-nav-link .ub-nav-chevron {
    width: 1rem;
    height: 1rem;
    color: #6b7280;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* ============================================================
   Features Dropdown
   ============================================================ */

.ub-header__dropdown {
    position: relative;
}

.ub-dropdown-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    top: calc(100% + 1.5rem); /* gap below the trigger */
    width: 20rem; /* 320px */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 50;
}

.ub-header__dropdown:hover .ub-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.ub-header__dropdown:hover .ub-nav-chevron {
    color: var(--ub-primary);
    transform: rotate(-180deg);
}

.ub-dropdown-panel {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    background: rgba(20, 20, 28, 0.97);
    backdrop-filter: blur(20px);
}

.ub-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.ub-dropdown-item:last-child {
    border-bottom: none;
}

.ub-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ub-dropdown-item__icon {
    flex-shrink: 0;
    padding: 0.625rem;
    border-radius: 0.625rem;
    background: rgba(231, 111, 81, 0.12);
    color: var(--ub-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ub-dropdown-item__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ub-dropdown-item__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.125rem;
    transition: color 0.2s ease;
}

.ub-dropdown-item:hover .ub-dropdown-item__title {
    color: var(--ub-primary);
}

.ub-dropdown-item__desc {
    font-size: 0.8125rem; /* 13px */
    color: #6b7280;
    margin: 0;
}

/* ============================================================
   Right Actions (Desktop)
   ============================================================ */

.ub-header__actions {
    display: none;
    align-items: center;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .ub-header__actions { display: flex; }
}

.ub-btn-ghost {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    margin-right: 10px;
    transition: color 0.2s ease;
}

.ub-btn-ghost:hover {
    color: #ffffff;
}

.ub-btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    border-radius: 9999px;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, var(--ub-primary) 0%, var(--ub-primary-dark) 100%);
    border: none;
    cursor: pointer;
}

.ub-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 111, 81, 0.40);
}

.ub-btn-primary__hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff8a6e 0%, var(--ub-primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ub-btn-primary:hover .ub-btn-primary__hover-overlay {
    opacity: 1;
}

.ub-btn-primary__text {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ub-btn-primary__text svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.ub-btn-primary:hover .ub-btn-primary__text svg {
    transform: translateX(2px);
}

/* ============================================================
   User Avatar Button (logged-in state)
   ============================================================ */

.ub-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.10);
    text-decoration: none;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.ub-user-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.ub-user-btn__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--ub-primary);
    color: #ffffff;
    flex-shrink: 0;
}

.ub-user-btn__name {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ub-user-btn__chevron {
    color: #9ca3af;
    flex-shrink: 0;
}

.is-hidden {
    display: none !important;
}

/* ============================================================
   Mobile Toggle Button
   ============================================================ */

.ub-header__mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ub-header__mobile-toggle:hover {
    color: #ffffff;
}

.ub-header__mobile-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

@media (min-width: 1024px) {
    .ub-header__mobile-toggle { display: none; }
}

/* ============================================================
   Mobile Menu Backdrop
   ============================================================ */

.ub-header__mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ub-header__mobile-backdrop.is-open {
    display: block;
    opacity: 1;
}

/* ============================================================
   Mobile Menu (Slide-in Sidebar)
   ============================================================ */

.ub-header__mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: rgba(15, 15, 20, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateX(-100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 40;
    overflow-y: auto;
}

.ub-header__mobile-menu.is-open {
    transform: translateX(0);
    box-shadow: 25px 0 60px rgba(0, 0, 0, 0.5);
}

.ub-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ub-mobile-menu__title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.ub-mobile-menu__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.ub-mobile-menu__close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.ub-mobile-menu__close svg {
    width: 1.25rem;
    height: 1.25rem;
}

.ub-mobile-nav {
    padding: 1rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ub-mobile-nav__link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.ub-mobile-nav__link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.ub-mobile-nav__actions {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ub-mobile-nav__signin {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.10);
    text-decoration: none;
    transition: background 0.2s ease;
}

.ub-mobile-nav__signin:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ub-mobile-nav__cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--ub-primary) 0%, var(--ub-primary-dark) 100%);
    transition: opacity 0.2s ease;
}

.ub-mobile-nav__cta:hover {
    opacity: 0.90;
}
