/**
 * DJC-Hub Top Navigation Bar - Mobile First
 */

.djc-hub-topbar {
    position: fixed;
    top: var(--djc-admin-bar-offset, 0px);
    left: 0;
    right: 0;
    height: var(--djc-topbar-height);
    background: rgba(11, 15, 26, 0.92); /* --djc-bg-primary with opacity */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(124, 92, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(124, 92, 255, 0.1);
}

/* Left section */
.djc-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Center section */
.djc-topbar-center {
    flex: 1;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0 12px;
}

.djc-topbar-ticker {
    width: 100%;
    max-width: 560px;
    overflow: hidden;
}

body.djc-gaming-page .djc-topbar-ticker,
body.djc-game-active .djc-topbar-ticker {
    max-width: 2240px;
}

/* Hamburger button */
.djc-hamburger {
    width: 44px;
    height: 44px;
    background: rgba(124, 92, 255, 0.12);
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: var(--djc-radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.djc-hamburger:hover,
.djc-hamburger:active {
    background: rgba(124, 92, 255, 0.25);
    border-color: rgba(124, 92, 255, 0.5);
    color: #fff;
    transform: scale(0.97);
}

/* Logo */
.djc-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.djc-logo img {
    height: 28px;
}

.djc-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search bar */
.djc-search-bar {
    display: none;
}

.djc-search-bar input {
    width: 220px;
    padding: 8px 16px 8px 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--djc-radius-pill, 999px);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.djc-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.djc-search-bar input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(124, 92, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
    width: 260px;
}

/* Right section */
.djc-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Wallet pill */
.djc-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.2);
    border-radius: var(--djc-radius-pill, 999px);
    font-size: 12px;
    font-weight: 700;
}

.djc-wallet-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
}

.djc-wallet-item i {
    font-size: 12px;
}

.djc-xp-indicator {
    display: none;
    color: rgba(255, 255, 255, 0.75);
}

/* Notification bell */
.djc-topbar-notifications {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--djc-radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.djc-topbar-notifications:hover,
.djc-topbar-notifications:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(124, 92, 255, 0.4);
    color: #fff;
}

.djc-topbar-notifications .djc-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--djc-bg-base, #0b0f1a);
    animation: djc-pulse-ring 2s ease-in-out infinite;
}

/* Avatar + level badge */
.djc-topbar-avatar-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.djc-topbar-avatar-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.djc-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(124, 92, 255, 0.5);
    transition: border-color 0.2s ease;
    display: block;
}

.djc-topbar-avatar-menu:hover .djc-topbar-avatar {
    border-color: var(--djc-primary, #7c5cff);
    box-shadow: 0 0 12px rgba(124, 92, 255, 0.4);
}

.djc-topbar-level-badge {
    position: absolute;
    bottom: -4px;
    right: -6px;
    background: linear-gradient(135deg, #7c5cff, #b45bff);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1.5px solid var(--djc-bg-base, #0b0f1a);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Avatar dropdown */
.djc-avatar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    background: #1a1f2e;
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: var(--djc-radius-md, 12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 92, 255, 0.05);
    overflow: hidden;
    z-index: 1001;
    animation: djc-fade-in-up 0.15s ease forwards;
}

.djc-avatar-dropdown.active {
    display: block;
}

.djc-avatar-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.djc-avatar-dropdown a i {
    width: 16px;
    text-align: center;
    color: rgba(124, 92, 255, 0.8);
    font-size: 13px;
}

.djc-avatar-dropdown a:hover {
    background: rgba(124, 92, 255, 0.12);
    color: #fff;
}

.djc-avatar-dropdown a:hover i {
    color: var(--djc-primary, #7c5cff);
}

.djc-avatar-dropdown hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 480px) {
    .djc-xp-indicator { display: flex; }
    .djc-wallet { padding: 5px 12px; gap: 10px; font-size: 13px; }
    .djc-topbar-right { gap: 8px; }
}

@media (min-width: 768px) {
    .djc-hub-topbar  { padding: 0 20px; }
    .djc-topbar-left { gap: 14px; }
    .djc-logo img    { height: 34px; }
    .djc-logo-text   { font-size: 20px; }
    .djc-search-bar  { display: block; }
    .djc-topbar-right { gap: 10px; }
    .djc-topbar-avatar { width: 38px; height: 38px; }
    .djc-topbar-avatar-wrap { width: 38px; height: 38px; }
}

@media (min-width: 1024px) {
    .djc-hamburger { display: none; }
    .djc-search-bar input { width: 240px; }
    .djc-search-bar input:focus { width: 300px; }
}

/* Score ticker: only gaming pages */
body:not(.djc-gaming-page):not(.djc-game-active) .djc-topbar-center {
    display: none !important;
}
body.djc-gaming-page .djc-topbar-center,
body.djc-game-active .djc-topbar-center {
    display: flex;
}
