/* =====================================================================
   PROJECT NETWORK — Enhanced Design Patch
   Thêm file này vào <head>:
   <link rel="stylesheet" href="./project-network.css">
   ===================================================================== */

/* ── Grid layout ── */
.pn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

@media (max-width: 768px) {
  .pn-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card base ── */
.pn-card {
  position: relative;
  background: linear-gradient(145deg, rgba(13, 19, 31, 0.85), rgba(8, 12, 22, 0.9));
  border: 1px solid var(--border-dim);
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease;
  cursor: default;
}

/* Staggered fade-up animation using data-delay */
.pn-card.fade-up { opacity: 0; transform: translateY(24px); }
.pn-card.fade-up.visible { opacity: 1; transform: translateY(0); }
.pn-card[data-delay="0"] { transition-delay: 0s; }
.pn-card[data-delay="1"] { transition-delay: 0.08s; }
.pn-card[data-delay="2"] { transition-delay: 0.16s; }
.pn-card[data-delay="3"] { transition-delay: 0.24s; }

.pn-card.hover-glow:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--border-lit);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35),
              0 0 0 1px var(--border-lit),
              0 0 24px var(--primary-glow);
}

/* Subtle background glow on hover */
.pn-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, var(--primary-glow), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: inherit;
}
.pn-card:hover::before { opacity: 1; }

/* ── Accent bar (thin color strip at top) ── */
.pn-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), transparent 80%);
  border-radius: 18px 18px 0 0;
}
.pn-accent-bar.warn {
  background: linear-gradient(90deg, #f59e0b, transparent 80%);
}
.pn-accent-bar.alert {
  background: linear-gradient(90deg, #ef4444, transparent 80%);
}

/* ── Top row: logo + meta ── */
.pn-top {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

/* ── Logo wrapper with online ring ── */
.pn-logo-wrap {
  position: relative;
  flex-shrink: 0;
}

.pn-logo {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--border-dim);
  display: block;
}

/* Online status ring around logo */
.pn-online-ring {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(8, 12, 22, 0.9);
  background: #64748b; /* default: loading */
  transition: background 0.4s ease;
}
.pn-online-ring.online  { background: #22c55e; box-shadow: 0 0 6px #22c55e88; }
.pn-online-ring.offline { background: #ef4444; }
.pn-online-ring.loading {
  background: #64748b;
  animation: pn-ring-pulse 1.4s ease-in-out infinite;
}

@keyframes pn-ring-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Text meta ── */
.pn-meta {
  flex: 1;
  min-width: 0;
}

.pn-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
}

.pn-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.pn-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Online / Offline coloring for status text */
.pn-status.is-online  { color: #4ade80; }
.pn-status.is-offline { color: #94a3b8; }

/* ── IP row ── */
.pn-ip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
  text-decoration: none;
}

.pn-ip:hover {
  background: rgba(16, 185, 129, 0.07);
  border-color: var(--border-lit);
}

.pn-ip-icon {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.pn-ip .ip-text {
  flex: 1;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}

.pn-ip .fa-copy,
.pn-ip .fab.fa-discord:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color 0.2s, transform 0.2s;
}

.pn-ip:hover .fa-copy { color: var(--primary-color); transform: scale(1.15); }

/* ── Player count badge (injected by JS into .pn-status) ── */
.pn-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.pn-player-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
  display: inline-block;
}

/* ── Light theme overrides ── */
body.light-theme .pn-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.55), rgba(240,245,255,0.45));
}
body.light-theme .pn-ip {
  background: rgba(0,0,0,0.04);
}
body.light-theme .pn-ip:hover {
  background: rgba(5, 150, 105, 0.07);
}

/* ── MC ping status dots (thay thế ký tự â— bị lỗi) ── */
.mc-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

.online-dot {
  background: var(--primary-color);
  box-shadow: 0 0 6px var(--primary-color);
  animation: mc-dot-pulse 2s ease-in-out infinite;
}

.offline-dot {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.error-dot {
  background: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

@keyframes mc-dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--primary-color); }
  50% { opacity: 0.7; box-shadow: 0 0 10px var(--primary-color); }
}

.mc-sep {
  color: rgba(148, 163, 184, 0.3);
  margin: 0 4px;
}