/* =============================================================================
   Header CSS — WeAreInvictus210
   ============================================================================= */

/* ── Desktop nav buttons ────────────────────────────────────────────────────── */
.inv-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c8cce8;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}

.inv-nav-btn:hover,
.inv-nav-btn[aria-expanded="true"] { color: #ffffff; }

/* Members variant — amber-flame color */
.inv-nav-btn--members              { color: #f59e0b; }
.inv-nav-btn--members:hover,
.inv-nav-btn--members[aria-expanded="true"] { color: #fbbf24; }

/* Sword icon — sized to match text line-height */
.inv-sword-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ── Chevron ────────────────────────────────────────────────────────────────── */
.inv-chevron {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.inv-nav-btn[aria-expanded="true"]    .inv-chevron { transform: rotate(180deg); }
.inv-mob-toggle[aria-expanded="true"] .inv-chevron { transform: rotate(180deg); }

/* ── Desktop dropdowns ──────────────────────────────────────────────────────── */
.inv-dropdown {
    position: relative;
}

.inv-dropdown__panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 164px;
    background: #0d1529;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 100;
}

.inv-dropdown__panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Triangle connector — prevents hover gap between button and panel */
.inv-dropdown__panel::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

.inv-dropdown__item {
    display: block;
    padding: 8px 14px;
    font-size: 0.73rem;
    font-weight: 500;
    color: #c8cce8;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.inv-dropdown__item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* ── Create Lineup CTA ──────────────────────────────────────────────────────── */
.inv-header-cta {
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 14px;
    background: #f59e0b;
    color: #000;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.inv-header-cta:hover {
    opacity: 0.85;
    color: #000;
}

.inv-header-cta svg {
    flex-shrink: 0;
}

/* ── Hamburger ──────────────────────────────────────────────────────────────── */
.inv-ham-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

#invictus-hamburger[aria-expanded="true"] .inv-ham-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#invictus-hamburger[aria-expanded="true"] .inv-ham-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#invictus-hamburger[aria-expanded="true"] .inv-ham-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav — full-screen overlay ───────────────────────────────────────── */
.inv-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #080d1a;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.inv-mobile-overlay.is-open {
    display: flex;
    animation: invOverlayIn 0.25s ease forwards;
}

@keyframes invOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .inv-mobile-overlay { display: none !important; }
}

/* Overlay header — logo + close button */
.inv-mobile-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    flex-shrink: 0;
}

.inv-mobile-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.6);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.inv-mobile-overlay__close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

/* Overlay body — scrollable content */
.inv-mobile-overlay__body {
    flex: 1;
    padding: 8px 24px 24px;
    overflow-y: auto;
}

/* ── User card ── */
.inv-mobile-user-card {
    background: #111827;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-mobile-user-card__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.inv-mobile-user-card__stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.inv-mobile-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #c8cce8;
}

.inv-mobile-user-card__notif {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: #f59e0b;
}

/* ── Nav sections ── */
.inv-mobile-section {
    margin-bottom: 20px;
}

.inv-mobile-section__header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #6b7494;
    padding: 0 4px 8px;
}

.inv-mobile-section__header--members {
    color: #f59e0b;
}

.inv-mobile-link {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #c8cce8;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}

.inv-mobile-link:hover,
.inv-mobile-link:active {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* ── Bottom CTAs ── */
.inv-mobile-overlay__footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 24px 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.inv-mobile-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.inv-mobile-cta--outline {
    border: 1.5px solid #f59e0b;
    color: #f59e0b;
    background: transparent;
}

.inv-mobile-cta--outline:hover {
    background: rgba(245, 158, 11, 0.1);
}

.inv-mobile-cta--filled {
    border: none;
    background: #f59e0b;
    color: #000000;
}

.inv-mobile-cta--filled:hover {
    opacity: 0.85;
}

.inv-mobile-cta--ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    color: #6b7494;
    background: transparent;
}

.inv-mobile-cta--ghost:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #8890b4;
}

/* ── Modals — visibility ────────────────────────────────────────────────────── */
/* Hidden by default: ID selector (1-0-0) beats Tailwind's .flex (0-1-0).      */
/* Open state: ID + class (1-1-0) beats the default rule (1-0-0).              */
#invictus-login-modal,
#invictus-community-modal { display: none; }

#invictus-login-modal.is-open,
#invictus-community-modal.is-open { display: flex; }

.inv-modal__box {
    animation: invModalIn 0.2s ease;
}

@keyframes invModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Notification bell ──────────────────────────────────────────────────────── */
.inv-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s;
}

.inv-notif-bell:hover {
    color: rgba(255, 255, 255, 0.9);
}

.inv-notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid #080d1a;
}

/* ── Notification panel ────────────────────────────────────────────────────── */
.inv-notif-wrap {
    position: relative;
}

.inv-notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

.inv-notif-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.inv-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-notif-header span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#inv-notif-mark-read {
    font-size: 0.68rem;
    font-weight: 500;
    color: #f59e0b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

#inv-notif-mark-read:hover {
    color: #fbbf24;
}

.inv-notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.inv-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s ease;
}

.inv-notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.inv-notif-item--unread {
    border-left: 3px solid #f59e0b;
    padding-left: 11px;
}

.inv-notif-icon {
    flex-shrink: 0;
    width: 24px;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

.inv-notif-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.inv-notif-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: #c8cce8;
    line-height: 1.35;
}

.inv-notif-time {
    font-size: 0.68rem;
    color: #6b7494;
}

.inv-notif-empty {
    text-align: center;
    padding: 32px 14px;
    font-size: 0.78rem;
    color: #6b7494;
    margin: 0;
}

/* Mobile — full-width slide-down notification panel */
@media (max-width: 767px) {
    .inv-notif-panel {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 0 0 12px 12px;
        border-top: none;
        transform: translateY(-6px);
    }

    .inv-notif-panel.is-open {
        transform: translateY(0);
    }
}

/* =============================================================================
   Contextual Search Bar
   ============================================================================= */

.inv-search-wrap {
    position: relative;
}

.inv-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7494;
    pointer-events: none;
}

.inv-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    background: rgba(13, 21, 41, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.inv-search-input:focus {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(13, 21, 41, 1);
}

.inv-search-input::placeholder {
    color: #4b5563;
}

/* ── Search results dropdown ── */
.inv-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
    padding: 4px;
}

.inv-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: #c8cce8;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

.inv-search-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.inv-search-item__thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1a2235;
}

.inv-search-item__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.inv-search-item__title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.inv-search-group__label {
    display: block;
    padding: 8px 12px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7494;
}

.inv-search-loading,
.inv-search-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 0.78rem;
    color: #6b7494;
}

/* ── Mobile search trigger (icon button) ── */
.inv-search-mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.inv-search-mobile-trigger:hover {
    color: #fff;
}

/* ── Mobile search overlay (full-width bar over header) ── */
.inv-search-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #080d1a;
    flex-direction: column;
}

.inv-search-mobile-overlay.is-open {
    display: flex;
}

.inv-search-mobile-overlay__bar {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 12px;
    gap: 8px;
    position: relative;
}

.inv-search-mobile-overlay__bar .inv-search-icon {
    left: 24px;
}

.inv-search-mobile-overlay__bar .inv-search-input {
    flex: 1;
    height: 40px;
    font-size: 16px;
}

.inv-search-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 6px;
}

.inv-search-mobile-close:hover {
    color: #fff;
}

.inv-search-mobile-overlay .inv-search-results {
    position: static;
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-left: none;
    border-right: none;
    border-bottom: none;
    max-height: calc(100dvh - 64px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* Hide trigger on desktop */
@media (min-width: 768px) {
    .inv-search-mobile-trigger { display: none !important; }
    .inv-search-mobile-overlay { display: none !important; }
}
