/* ==========================================================================
   IBplay — Live Server Directory Stylesheet
   ========================================================================== */

/* Page Hero Section */
.ib-page-hero {
  padding: 48px 0 32px 0;
  text-align: center;
}

.ib-page-hero h1 {
  font-family: var(--ib-display, 'Chakra Petch', sans-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  margin: 12px 0 16px;
}

.ib-page-hero p {
  color: #94a3b8;
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Page Hero Directory Stats Bar */
.ib-dir-stats {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  padding: 12px 24px;
  background: rgba(18, 26, 43, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.ib-dir-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ib-dir-stat strong {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-family: var(--font-mono, monospace);
}

.ib-dir-stat strong small {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.ib-dir-stat span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-top: 2px;
  font-weight: 600;
}

.ib-dir-stat-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

/* Controls Bar (Search & Mode Filters) */
body.ib-site .ib-dir-control-bar {
  position: sticky !important;
  top: 70px !important;
  z-index: 100 !important;
  padding: 18px 0;
  background: #0b0f19;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.ib-dir-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ib-dir-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.ib-dir-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s ease;
}

.ib-dir-search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  background: rgba(18, 26, 43, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ib-dir-search-wrap input:focus {
  outline: none;
  border-color: rgba(0, 242, 254, 0.5);
  background: rgba(18, 26, 43, 0.95);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.ib-dir-search-wrap input:focus + svg {
  color: #00f2fe;
}

.ib-dir-mode-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.ib-dir-mode-filters::-webkit-scrollbar {
  display: none;
}

.ib-dir-pill {
  height: 38px;
  padding: 0 14px;
  border-radius: 20px;
  background: rgba(18, 26, 43, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ib-dir-pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(24, 34, 56, 0.8);
}

.ib-dir-pill.is-active {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.15);
}

/* Main Server List Section */
.ib-dir-list-wrap {
  padding: 36px 0 48px 0;
}

.ib-srv-group {
  margin-bottom: 44px;
}

.ib-srv-group:last-child {
  margin-bottom: 0;
}

.ib-srv-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 5;
}

.ib-srv-group-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.ib-srv-group-header h2 svg {
  width: 20px;
  height: 20px;
  color: #00f2fe;
}

.ib-srv-group-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 12px;
}

.ib-srv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Compact Server Row Card — Uniform sizing */
.ib-srv-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  min-height: 98px;
  height: 98px;
  width: 100%;
  border-radius: 14px;
  background: rgba(18, 26, 43, 0.82);   /* was 0.5 + backdrop-filter: blur(8px): the blur made scrolling lag */
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  content-visibility: auto;             /* rows outside the screen are not laid out or painted */
  contain-intrinsic-size: auto 98px;
  overflow: hidden; /* clips the thumb's bleed below to the row's own rounded corners */
}

.ib-srv-row:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(24, 34, 56, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Official Server Accent Styling (Cyan) */
.ib-srv-row.is-official {
  border: 1px solid rgba(0, 242, 254, 0.28);
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.05) 0%, rgba(18, 26, 43, 0.65) 100%);
}

.ib-srv-row.is-official:hover {
  border-color: rgba(0, 242, 254, 0.48);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.12);
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.08) 0%, rgba(24, 34, 56, 0.85) 100%);
}

/* Community Server Styling & Vibrant Orange Theme */
#groupCommunity .ib-srv-group-header h2 svg {
  color: #ff781f;
}

.ib-srv-row.is-community {
  border: 1px solid rgba(255, 120, 31, 0.25);
  background: linear-gradient(90deg, rgba(255, 120, 31, 0.05) 0%, rgba(18, 26, 43, 0.65) 100%);
}

.ib-srv-row.is-community:hover {
  border-color: rgba(255, 120, 31, 0.5);
  box-shadow: 0 8px 24px rgba(255, 120, 31, 0.14);
  background: linear-gradient(90deg, rgba(255, 120, 31, 0.08) 0%, rgba(24, 34, 56, 0.85) 100%);
}

.ib-srv-badge.is-community-badge {
  background: rgba(255, 120, 31, 0.12);
  color: #ff8c38;
  border: 1px solid rgba(255, 120, 31, 0.3);
}

.ib-srv-row.is-community .ib-srv-mode-tag {
  color: #ff8c38;
  background: rgba(255, 120, 31, 0.1);
}

.ib-srv-row.is-community .ib-srv-progress-bar span {
  background: linear-gradient(90deg, #ff781f, #ffab40);
}

/* Locked / Match In Progress Server State */
.ib-srv-row.is-locked {
  border-color: rgba(245, 158, 11, 0.38);
}

.ib-srv-badge.is-locked-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ib-srv-badge.is-locked-badge svg {
  width: 12px;
  height: 12px;
}

/* Hidden / Private Servers Group Header Styling */
#groupHidden .ib-srv-group-header h2 svg {
  color: #a855f7;
}

/* Hidden Server State */
.ib-srv-row.is-hidden {
  opacity: 0.92;
  border: 1px dashed rgba(168, 85, 247, 0.3);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.05) 0%, rgba(18, 26, 43, 0.65) 100%);
}

.ib-srv-row.is-hidden:hover {
  opacity: 1;
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.08) 0%, rgba(24, 34, 56, 0.85) 100%);
}

.ib-srv-badge.is-hidden-badge {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.32);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ib-srv-badge.is-hidden-badge svg {
  width: 12px;
  height: 12px;
}

.ib-btn--warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.ib-btn--warning:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fff;
}

.ib-btn.disabled, .ib-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Thumbnail — bleeds into the row's own padding (top/bottom/left) so
   the map screenshot fills the full 98px row height edge-to-edge
   instead of floating in a smaller inset box. The row is a fixed
   height with overflow:hidden, so this reaches exactly to the row's
   edges without ever changing the row's own size. */
.ib-srv-thumb {
  width: 130px;
  height: 98px;
  margin: -14px 0 -14px -20px;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #101013;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.ib-srv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.ib-srv-row:hover .ib-srv-thumb img {
  transform: scale(1.06);
}

.ib-srv-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  color: #64748b;
}

.ib-srv-thumb-placeholder svg {
  width: 28px;
  height: 28px;
}

.ib-srv-map-badge {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-size: 0.65rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: -0.02em;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Main Row Info */
.ib-srv-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  height: 100%;
}

.ib-srv-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.ib-srv-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
  margin: 0;
}

.ib-srv-tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 1px 0;
}

.ib-srv-state-icon {
  font-size: 0.88rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  cursor: help;
}

.ib-srv-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  white-space: nowrap;
}

.ib-srv-badge.is-official-badge {
  background: rgba(0, 242, 254, 0.12);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ib-srv-badge.is-official-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f2fe;
  box-shadow: 0 0 6px #00f2fe;
}

.ib-srv-mode-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.ib-srv-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #8a96a3;
  font-family: var(--font-mono, monospace);
  flex-wrap: wrap;
}

.ib-srv-ip {
  color: #e2e8f0;
  font-weight: 600;
}

.ib-srv-dot {
  color: #475569;
}

.ib-srv-meta-item {
  color: #94a3b8;
}

/* Players Column */
.ib-srv-players-col {
  width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ib-srv-players-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono, monospace);
}

.ib-srv-players-val small {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.ib-srv-progress-bar {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ib-srv-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #4facfe);
  border-radius: 3px;
}

/* Action Buttons */
.ib-srv-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ib-srv-conn-btn {
  padding: 0 14px;
  height: 36px;
  font-size: 0.82rem;
  gap: 6px;
}

.ib-srv-copy-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
  gap: 5px;
}

.ib-srv-copy-btn.is-copied {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Empty State */
.ib-dir-empty {
  text-align: center;
  padding: 60px 20px;
  background: rgba(18, 26, 43, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-top: 20px;
}

.ib-dir-empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.ib-dir-empty-icon svg {
  width: 24px;
  height: 24px;
}

.ib-dir-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.ib-dir-empty p {
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* CTA Banner Section Gap Fix */
.ib-cta-section {
  padding: 30px 0 60px 0;
  margin-bottom: 0;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .ib-srv-row {
    flex-wrap: wrap;
    padding: 14px;
    gap: 12px;
    height: auto;
    min-height: initial;
  }

  .ib-srv-thumb {
    width: 100px;
    height: 70px;
    margin: -14px 0 -14px -14px;
  }

  .ib-srv-main {
    flex: 1 1 calc(100% - 90px);
  }

  .ib-srv-players-col {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }

  .ib-srv-progress-bar {
    width: 60px;
  }

  .ib-srv-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .ib-srv-conn-btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .ib-dir-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    border-radius: 16px;
    padding: 12px 16px;
  }

  .ib-dir-stat-divider {
    display: none;
  }

  .ib-srv-name {
    max-width: 100%;
  }

  .ib-srv-sub-row {
    font-size: 0.72rem;
  }
}