/* Global box-sizing */
*,
*::before,
*::after { box-sizing: border-box; }

/* Wrapper - gunakan full width tapi batasi konten agar centered */
.trucky-members-slider {
  width: 100%;
  padding: 28px 20px;
  background: transparent;
  margin: 0; 
}

/* Grid vertical, no horizontal scroll, centered dengan max-width */
.trucky-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important; /* desktop: 6 kolom */
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;            /* center page */
  align-items: start;
  justify-items: center !important;     /* card di tengah setiap kolom */
  width: 100%;
}

/* Card: full width di dalam kolom, tanpa flex-basis */
.member-card {
  width: 100%;
  max-width: 340px;
  min-width: 0;              /* penting supaya grid tidak overflow */
  border: 1px solid #0c0c0c;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  backdrop-filter: blur(6px);
  overflow: hidden;
}

/* Hover */
.member-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,153,255,0.14);
  border-color: rgba(0,195,255,0.25);
  z-index: 5;
}

/* Avatar responsive: tetap proporsional */
.member-avatar {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 2px solid #0c0c0c;
  display: block;
}

/* Nama + flag sejajar */
.member-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
  align-self: center;
}

/* Role & stats */
.member-role { font-size: 14px; color: #1a1a1a; margin: 2px 0; }
.member-stats { font-size: 14px; color: #1a1a1a; margin-top: 10px; line-height: 1.4; }
.member-stats p { margin: 4px 0; }

/* Last seen divider */
.member-last-seen {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: right;
  font-size: 12px;
  color: #1a1a1a;
  font-style: italic;
}

/* Remove horizontal scrollbar styles (not needed for vertical grid) */
/* keep scrollbar only for whole page if any */

/* Responsive breakpoints */
/* Large desktop -> default 6 columns */
/* Desktop wide to laptop */
@media (max-width: 1400px) {
  .trucky-members-grid {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
    max-width: 1200px;
  }
}

/* Laptop / small desktop */
@media (max-width: 1100px) {
  .trucky-members-grid {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1000px;
  }
  .member-avatar { height: 160px; }
}

/* Tablet */
@media (max-width: 800px) {
  .trucky-members-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 18px;
    width: calc(100% - 32px);
    padding: 0 8px;
  }
  .member-card { padding: 14px; }
  .member-avatar { height: 150px; }
}

/* Small tablet / large phone */
@media (max-width: 600px) {
  .trucky-members-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 14px;
  }
  .member-avatar { height: 140px; }
  .member-card { max-width: 320px; }
}

/* Mobile single column */
@media (max-width: 420px) {
  .trucky-members-slider {
    padding: 0 !important;            /* hilangkan padding parent yang mendorong ke kiri */
    margin: 0 auto !important;
    width: 100% !important;
  }

  .trucky-members-grid {
    width: 100% !important;           /* full width */
    max-width: 100% !important;
    padding: 0 12px !important;       /* small horizontal padding for breathing room */
    margin: 0 auto !important;
    grid-template-columns: 1fr !important;
    justify-items: stretch !important;/* biarkan card pakai lebar kolom */
  }

  .member-card {
    max-width: none !important;       /* card full width */
    width: 100% !important;
    margin: 0 auto !important;        /* center single column */
    box-sizing: border-box !important;
  }

  .member-avatar {
    width: 100% !important;
    height: 150px !important;
  }
}

/* Accessibility: ensure text wraps */
.member-card, .member-card * { word-break: break-word; }