/**
 * FORRE_DARK - Navbar Component - FORGE Style
 * Clean & Minimal: tunn separator + subtle underline indicator
 * Admin-edit funkar oforand - bara styling som andras
 */

/* ===== Navband - clean bottom border ===== */
.tw-navband {
  background: var(--body-bg);
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ===== Nav - no border, clean ===== */
.tw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  min-height: var(--navbar-height);
  border: none !important;
  background: transparent !important;
  box-shadow: var(--shadow-navbar);
  padding: 0 32px;
  margin: 0 auto;
  max-width: var(--max-width);
}

.tw-nav-left,
.tw-nav-right {
  display: flex;
  align-items: center;
}

/* Clean left - no wrap, no gap */
.tw-nav-left {
  gap: 0 !important;
  min-width: 0;
  flex-wrap: nowrap !important;
  height: 100%;
}

/* Right - admin buttons etc */
.tw-nav-right {
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  z-index: 40;
  margin-left: 16px;
}

/* Nav Separator - thin muted line */
.tw-nav-sep {
  margin: 0 2px;
  color: rgba(255,255,255,0.1) !important;
  font-size: 11px;
  font-weight: 500;
  user-select: none;
  pointer-events: none;
}

/* ======= Nav items ======= */
.tw-nav-item {
  position: relative;
}

/* ======= Nav Links - FORGE clean style ======= */
.tw-nav-link {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 18px !important;
  text-decoration: none !important;
  color: #8b949e !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  overflow: visible;
  transition: color 0.2s ease;
}

/* ======= Nav Icons - no box, inline ======= */
.tw-nav-ico {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  border: none !important;
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
  font-size: 12px;
  opacity: 0.6;
  box-shadow: none !important;
  flex: 0 0 auto;
  transition: opacity 0.2s, color 0.2s;
}

/* ======= Underline indicator ======= */
.tw-nav-line {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  transform: scaleX(0.3);
  background: var(--primary) !important;
  opacity: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
  animation: none !important;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

/* ===== Hover ===== */
.tw-nav-link:hover {
  color: #e6edf3 !important;
}

.tw-nav-link:hover .tw-nav-ico {
  color: var(--primary) !important;
  opacity: 1;
}

.tw-nav-link:hover .tw-nav-line {
  transform: scaleX(1);
  opacity: 1;
}

/* ===== Active ===== */
.tw-nav-link.active {
  color: #e6edf3 !important;
}

.tw-nav-link.active .tw-nav-ico {
  opacity: 1;
  color: var(--primary) !important;
}

.tw-nav-link.active .tw-nav-line {
  transform: scaleX(1);
  opacity: 1;
  animation: twActiveLinePulse 2.4s ease-in-out infinite;
}

/* Subtle sweep on hover */
.tw-nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 33%,
    rgba(255,255,255,0.04) 50%,
    transparent 67%,
    transparent 100%
  );
  transform: translateX(-155%) skewX(-18deg);
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.tw-nav-link:hover::before {
  transform: translateX(180%) skewX(-18deg);
}

/* ======= Admin buttons - clean ======= */
.tw-nav-action {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 6px 14px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap;
  transition: all 0.2s;
  border-radius: 0 !important;
  transform: none !important;
}

.tw-nav-action:hover {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.12) !important;
  transform: none !important;
}

.tw-nav-action i {
  color: var(--text-muted);
  font-size: 11px;
  transition: color 0.2s;
}

.tw-nav-action:hover i {
  color: var(--primary);
}

/* ======= Nav split - clean 1px line ======= */
.tw-nav-split {
  position: relative;
  width: 1px !important;
  height: 24px;
  flex: 0 0 1px !important;
  margin: 0 4px !important;
  padding: 0 !important;
  pointer-events: none;
}

.tw-nav-split::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  clip-path: none !important;
  box-shadow: none !important;
  border: none !important;
}

.tw-nav-split::after {
  display: none !important;
}

/* ======= Dropdowns ======= */
.tw-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 232px;
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px) scale(0.985);
  transition: all 0.18s ease;
  z-index: 60;
}

.tw-nav-item:hover .tw-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tw-dropdown-panel {
  border: 1px solid rgba(67,67,67,0.9);
  background: rgba(22,22,22,0.86);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-dropdown);
  padding: 8px;
}

.tw-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.11s ease;
}

.tw-dropdown-link:hover {
  background: rgba(39,150,242,0.06);
  color: var(--primary);
}

.tw-dropdown-link i {
  width: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  transition: color 0.11s ease;
}

.tw-dropdown-link:hover i {
  color: var(--primary);
}

/* ======= Animation ======= */
@keyframes twActiveLinePulse {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.85); }
}

/* ======= Badge ======= */
.tw-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  background: #ef4444;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  line-height: 1;
}

/* ======= Responsive ======= */
@media (max-width: 900px) {
  .tw-nav {
    padding: 0 12px;
  }
  .tw-nav-link {
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 640px) {
  .tw-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }
}

/* ===== Profile Dropdown (React) ===== */
/* ============================================================
   PROFILE PILL + DROPDOWN — "Smart Stat Reveal" (Förslag E)
   Pillen är en riktig länk till profilen. Hover/fokus öppnar
   menyn och avslöjar rank/streak-chips. Klick = profil.
   ============================================================ */
#profile-dropdown-root {
  position: relative;
}

.tw-prof-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.tw-prof-pill:hover {
  background: var(--surface-3);
  border-color: var(--primary);
}

.tw-prof-pill-av {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #242527;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tw-prof-pill-av img { width: 100%; height: 100%; object-fit: cover; }
.tw-prof-pill-initial { font-size: 11px; font-weight: 800; color: var(--text-tertiary); }
.tw-prof-pill-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  background: var(--success);
  animation: twProfPulse 2s infinite;
}
@keyframes twProfPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(34,197,94,0.5); }
  50% { box-shadow: 0 0 10px rgba(34,197,94,0.9); }
}

.tw-prof-pill-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.tw-prof-pill-extra {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}
#profile-dropdown-root:hover .tw-prof-pill-extra,
.tw-prof-pill:focus-visible .tw-prof-pill-extra {
  max-width: 190px;
  opacity: 1;
}
.tw-prof-pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tw-prof-pill-chip--streak,
.tw-prof-chip--streak {
  color: #ffce85;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
}

.tw-prof-pill-caret {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease, color 0.14s ease;
}
#profile-dropdown-root:hover .tw-prof-pill-caret {
  color: var(--primary);
  transform: rotate(180deg);
}

/* ---- Dropdown panel ---- */
.tw-prof-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 268px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  box-shadow: var(--shadow-dropdown);
  z-index: 9000;
  padding: 0;
  display: none;
  animation: profDdIn 0.18s ease-out;
}
.tw-prof-dropdown-open { display: block; }
@keyframes profDdIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Hero: circular FORRE-level ring ---- */
.tw-prof-hero {
  padding: 16px 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.tw-prof-ring {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 12px;
}
.tw-prof-ring-inner {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  overflow: hidden;
  background: #242527;
  border: 2px solid var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tw-prof-ring-inner .tw-prof-avatar { width: 100%; height: 100%; object-fit: cover; }
.tw-prof-ring-inner .tw-prof-avatar-placeholder {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-tertiary);
}
.tw-prof-ring-lvl {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 8px;
  border: 2px solid var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.tw-prof-hero-name { font-size: 15px; font-weight: 900; color: var(--text-primary); }
.tw-prof-hero-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.tw-prof-hero-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.tw-prof-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 8px;
  text-transform: uppercase;
}

/* ---- Rank chip colors (UI-facit rank-färger) ---- */
.tw-prof-rank--bronze   { background: #CD7F32; color: #1a1a1a; }
.tw-prof-rank--silver   { background: #C0C0C0; color: #1a1a1a; }
.tw-prof-rank--gold     { background: #FFD700; color: #1a1a1a; }
.tw-prof-rank--platinum { background: #00CCCC; color: #06201f; }
.tw-prof-rank--diamond  { background: #88DDFF; color: #0a1f2c; }
.tw-prof-rank--elite    { background: #00D4AA; color: #06241d; }
.tw-prof-rank--champion { background: #FF6B6B; color: #ffffff; }
.tw-prof-rank--unreal   { background: #A855F7; color: #ffffff; }
.tw-prof-rank--unranked { background: #2a2a2a; color: #bbbbbb; }

/* ---- FORRE-level XP progress ---- */
.tw-prof-xp { padding: 11px 14px 4px; }
.tw-prof-xp-track { height: 5px; background: var(--surface-4); overflow: hidden; }
.tw-prof-xp-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }
.tw-prof-xp-fill.is-near { box-shadow: 0 0 9px var(--primary-glow); }
.tw-prof-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ---- Fortnite in-game block (account level = siffra, ingen bar) ---- */
.tw-prof-fn {
  margin: 11px 14px 0;
  border: 1px solid var(--border-light);
  background: var(--surface-3);
}
.tw-prof-fn-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-light);
}
.tw-prof-fn-head i { color: var(--primary); font-size: 10px; }
.tw-prof-fn-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.tw-prof-fn-grid:has(.tw-prof-fn-cell:only-child) { grid-template-columns: 1fr; }
.tw-prof-fn-cell { padding: 8px 6px; text-align: center; border-right: 1px solid var(--border-light); }
.tw-prof-fn-cell:last-child { border-right: none; }
.tw-prof-fn-val {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.tw-prof-fn-key {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ---- Platform badges + menu ---- */
.tw-prof-platforms {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 11px 14px 0;
}
.tw-prof-platform-badge {
  font-size: 9px;
  padding: 2px 6px;
  background: var(--surface-4);
  border: 1px solid var(--border-light);
  color: #bbb;
}

.tw-prof-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
  padding: 8px;
}

.tw-prof-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 3px;
  color: #cccccc;
  text-decoration: none;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

.tw-prof-menu-item:hover {
  background: #1f1f1f;
  color: #fff;
}

.tw-prof-menu--primary {
  color: var(--primary);
  font-weight: 700;
}

.tw-prof-menu--primary:hover {
  background: rgba(39,150,242,0.1);
  color: var(--primary-hover);
}

.tw-prof-menu--danger {
  color: #e74c3c;
}

.tw-prof-menu--danger:hover {
  background: rgba(231,76,60,0.1);
  color: #ff6b57;
}

.tw-prof-menu--admin {
  color: #9b59b6;
}

.tw-prof-menu--admin:hover {
  background: rgba(155,89,182,0.1);
  color: #af7ac5;
}

.tw-prof-menu-item i {
  font-size: 12px;
  width: 14px;
  text-align: center;
}
