/* ================================================
   WARZ SERVER — Social Bar (Right Side)
   ================================================ */

:root {
  --sb-red:      #e8001a;
  --sb-red-glow: rgba(232, 0, 26, 0.5);
  --sb-red-dim:  rgba(232, 0, 26, 0.08);
  --sb-bg:       rgba(8, 8, 8, 0.92);
  --sb-border:   rgba(232, 0, 26, 0.3);
  --sb-text:     #a0a0aa;
  --sb-w:        48px;
}

/* ── Container ── */
.socialbar {
  position: fixed;
  right: 0;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  animation: sbSlideIn 0.6s 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sbSlideIn {
  from { transform: translateY(-50%) translateX(100%); opacity: 0; }
  to   { transform: translateY(-50%) translateX(0);    opacity: 1; }
}

/* ── Track ── */
.socialbar__track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--sb-bg);
  border: 1px solid var(--sb-border);
  border-right: none;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding: 10px 0;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: visible;
}

/* Top accent bar */
.socialbar__track::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sb-red), transparent);
}

/* Scanlines */
.socialbar__track::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(255,255,255,0.01) 2px, rgba(255,255,255,0.01) 4px
  );
  pointer-events: none;
}

/* ── Individual item ── */
.socialbar__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sb-w);
  height: var(--sb-w);
  text-decoration: none;
  color: var(--sb-text);
  transition: color 0.2s, background 0.2s;
  overflow: visible;
}

.socialbar__item:hover {
  color: #fff;
  background: var(--sb-red-dim);
}

/* Red edge — ขวา */
.socialbar__item::before {
  content: '';
  position: absolute;
  right: 0;
  left: auto;
  top: 20%; bottom: 20%;
  width: 2px;
  background: var(--sb-red);
  box-shadow: 0 0 8px var(--sb-red-glow);
  transform: scaleY(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.socialbar__item:hover::before { transform: scaleY(1); }

/* ── Icon ── */
.socialbar__icon {
  font-size: 17px;
  line-height: 1;
  transition: transform 0.2s, filter 0.2s;
}
.socialbar__item:hover .socialbar__icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px var(--sb-red-glow));
  color: var(--sb-red);
}

/* ── Tooltip label — ออกทางซ้าย ── */
.socialbar__label {
  position: absolute;
  right: calc(100% + 10px);
  left: auto;
  white-space: nowrap;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--sb-bg);
  border: 1px solid var(--sb-border);
  padding: 5px 12px;
  /* ลูกศรชี้ขวา */
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.25s, transform 0.25s;
}

/* Arrow nub ชี้ขวา */
.socialbar__label::before {
  content: '';
  position: absolute;
  right: -5px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid var(--sb-border);
  border-right: none;
}

.socialbar__item:hover .socialbar__label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Divider ── */
.socialbar__divider {
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sb-border), transparent);
  margin: 6px 0;
}

/* ── Online count ── */
.socialbar__online {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 2px;
}

.socialbar__online-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: dotBlink 2s ease-in-out infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px  rgba(34,197,94,0.7); }
  50%       { opacity: 0.5; box-shadow: 0 0 16px rgba(34,197,94,0.9); }
}

.socialbar__online-count {
  font-family: 'Kanit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #22c55e;
  line-height: 1;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding-bottom: 4px;
}

/* ── Hide on very small screens ── */
@media (max-width: 480px) {
  .socialbar { display: none; }
}