/**
 * FORRE_DARK - Topbar Component
 */

.tw-site-header {
  position: relative;
  width: 100%;
  background: var(--topbar-bg);
  box-shadow: var(--shadow-topbar);
}

.tw-topbar {
  margin: 0 auto;
  max-width: var(--max-width);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

/* Logo */
.tw-topbar-logo {
  padding-right: 8px;
}

.tw-topbar-logo a {
  display: block;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

.tw-topbar-logo a span {
  color: var(--primary);
}

.tw-topbar-tagline {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--text-tertiary);
}

/* Topbar Center */
.tw-topbar-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Shoutbox Strip */
.tw-shout-strip {
  position: relative;
  height: 32px;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000000;
  text-align: left;
}

.tw-shout-strip-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  display: flex;
  height: 100%;
  width: 94px;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--border);
  background: #000000;
  padding: 0 16px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-primary);
}

.tw-shout-strip-label i {
  font-size: 11px;
  color: var(--primary);
}

.tw-shout-strip-content {
  display: flex;
  height: 100%;
  align-items: center;
  background: #0d0d0d;
  padding-left: 108px;
  padding-right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Mobile-only shout notification button is hidden by default (desktop/tablet) */
.tw-mob-shout-notif-btn,
.tw-mob-shout-notif-badge {
  display: none !important;
}

/* Topbar Tools */
.tw-topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon Buttons */
.tw-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-speed);
}

.tw-icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(39, 150, 242, 0.35);
  background: var(--surface-3, #212121);
}

.tw-icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus, 0 0 0 2px rgba(39, 150, 242, 0.42));
}

.tw-icon-btn i {
  font-size: 13px;
}

/* Search */
.tw-search-wrap {
  display: none;
}

.tw-search-wrap.active {
  display: block;
}

.tw-search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  padding: 0 12px;
}

.tw-search-input i {
  font-size: 12px;
  color: var(--text-muted);
}

.tw-search-input input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text-primary);
}

.tw-search-input input::placeholder {
  color: var(--text-tertiary);
}

/* Profile Badge */
.tw-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--card-bg-alt);
  padding: 0 12px;
  text-decoration: none;
}

.tw-profile-badge-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #242527;
  overflow: hidden;
}

.tw-profile-badge-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-profile-badge-info {
  line-height: 1.2;
}

.tw-profile-badge-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.tw-profile-badge-meta {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
}

/* Double Divider */
.tw-divider-double {
  width: 100%;
}

.tw-divider-double .tw-divider-top {
  height: 1px;
  background: #3a3a3a;
}

.tw-divider-double .tw-divider-bottom {
  height: 1px;
  background: #1f1f1f;
}

/* Icon Badge (notification count) */
.tw-icon-btn {
  position: relative;
}

.tw-icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
}

.tw-icon-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 4px var(--primary);
}

/* Dropdown Styles */
.tw-dropdown {
  position: fixed;
  z-index: 1000;
}

.tw-dropdown-panel {
  border: 1px solid rgba(67,67,67,0.9);
  background: rgba(22,22,22,0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 38px rgba(0,0,0,0.45);
  border-radius: var(--radius);
  min-width: 260px;
  overflow: hidden;
}

.tw-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.tw-dropdown-badge {
  background: var(--primary);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.tw-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}

.tw-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.tw-dropdown-item:hover {
  background: rgba(39,150,242,0.08);
}

.tw-dropdown-item .tw-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: #242527;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
}

.tw-dropdown-item .tw-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tw-dropdown-item .tw-item-content {
  flex: 1;
  min-width: 0;
}

.tw-dropdown-item .tw-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tw-dropdown-item .tw-item-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.tw-dropdown-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.tw-dropdown-footer a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.tw-dropdown-footer a:hover {
  text-decoration: underline;
}

.tw-dropdown-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-tertiary);
}

.tw-dropdown-empty i {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.tw-dropdown-empty p {
  font-size: 13px;
  margin: 0;
}

/* Loading state */
.tw-loading {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Shout item animation */
.tw-shout-item {
  display: inline-block;
  animation: twShoutFade 0.3s ease;
}

@keyframes twShoutFade {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Hidden class for search toggle */
.tw-shout-strip.hidden {
  display: none;
}

/* Guest State */
.tw-guest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tw-guest-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg-alt);
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
