/* =================================================================== */
/* ==                  Futuristic Dark Theme CSS                    == */
/* =================================================================== */

/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ==                  ⚙️ การตั้งค่าดีไซน์หลัก (Easy Settings) ⚙️                 == */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
:root {
  /* --- 🎨 Colors --- */
  --color-background: #0a0a0a;
  --color-foreground: #f5f5f5;
  --color-primary: #ffffff;
  --color-primary-foreground: #000000;
  --color-secondary: #a3a3a3;
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-subtle: rgba(255, 255, 255, 0.1);
  --color-glow-blue: rgba(0, 198, 255, 0.7);
  --color-glow-yellow: rgba(255, 215, 0, 0.7);

  /* --- 📇 Member Card Settings --- */
  --card-background: rgba(30, 30, 30, 0.4);
  --card-background-hover: rgba(40, 40, 40, 0.5);
  --card-accent-border-color: rgba(0, 198, 255, 0.7);
  --card-leader-accent-border-color: rgba(255, 215, 0, 0.8);
  --card-padding: 0.75rem 1rem;
  --card-radius: 8px;
  --card-gap: 1.5rem;
  --card-min-width: 300px;
  --card-accent-border-width: 4px;

  /* --- 👤 Profile Picture Settings --- */
  --profile-pic-size: 48px;
  --profile-pic-border-color: rgba(255, 255, 255, 0.1);
  --profile-pic-border-width: 2px;

  /* --- ✒️ Fonts --- */
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-size-card-name: 1.1rem;
  --font-size-card-link: 0.8rem;

  /* --- 📐 Layout --- */
  --container-max-width: 1200px;
}
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ======================== (End of Easy Settings) ======================== */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */


/* --- 2. การตั้งค่าพื้นฐาน --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
@keyframes aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
body { font-family: var(--font-body); color: var(--color-foreground); line-height: 1.6; background: linear-gradient(-45deg, #000000, #0a0a0a, #1a1a1a, #2a2a2a); background-size: 400% 400%; animation: aurora 18s ease infinite; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* เพิ่มพื้นหลัง Grid แบบโฮโลแกรม */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(0deg, rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  animation: pan-grid 60s linear infinite;
  opacity: 0.5;
  pointer-events: none;
}
@keyframes pan-grid {
    from { background-position: 0 0; }
    to { background-position: -500px -500px; }
}

/* --- 3. หน้า Landing Page --- */
#landing-page { display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 100vh; padding: 2rem; animation: fadeIn 1.2s ease-out; }
#landing-page .landing-content { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; text-align: center; width: 100%; }
.logo-container { padding: 2rem; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--color-border-subtle); }

/* ★★★★★ ปรับขนาดโลโก้ในหน้า Landing Page (หน้าแรก) ที่นี่ ★★★★★ */
#landing-page .logo {
    max-width: 200px; /* แก้ไขค่านี้เพื่อปรับขนาด เช่น 150px หรือ 250px */
    height: auto;
}
/* ★★★★★ จบส่วนแก้ไข ★★★★★ */

@keyframes shine { to { background-position: -200% center; } }
#landing-page h1 { font-family: var(--font-heading); font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; margin-bottom: 0.5rem; background: linear-gradient(90deg, #d0d0d0, #ffffff, #d0d0d0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; animation: shine 6s linear infinite; }
.subtitle { font-size: 1.125rem; color: var(--color-secondary); max-width: 400px; margin-left: auto; margin-right: auto; }

.button-group {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.enter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: var(--card-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid;
  text-decoration: none;
  transition: all 0.3s ease;
}
.members-button {
  padding: 0.8rem 1.5rem;
  min-width: 180px;
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-foreground);
}
.members-button:hover {
  background: transparent;
  color: var(--color-primary);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}
.instagram-button {
  padding: 0.6rem 1.5rem;
  min-width: 180px;
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  border-color: var(--color-primary);
}
.instagram-button:hover {
  background: transparent;
  color: var(--color-primary);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Loading Screen (ใหม่) */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.loading-content {
    text-align: center;
    width: 80%;
    max-width: 500px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 200, 255, 0.3);
}
.loading-text p {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 1.5rem;
    animation: pulse 1.5s infinite;
}
.loading-bar {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    border-radius: 5px;
    overflow: hidden;
}
.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    width: 0%;
    animation: fill-bar 3s forwards cubic-bezier(0.1, 0.8, 0.6, 1);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes fill-bar {
    to { width: 100%; }
}

/* --- 4. หน้า Members Page --- */
#members-page { display: none; min-height: 100vh; padding: 2rem 0; animation: fadeIn 0.8s ease-out; }
.container { max-width: var(--container-max-width); margin: 0 auto; padding: 0 1.5rem; }
header { margin-bottom: 3rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border-subtle); text-align: center; position: relative; } /* เพิ่ม position: relative; */
.header-content { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

/* เพิ่มปุ่มกลับหน้าหลัก */
.home-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--card-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--color-border);
    color: var(--color-foreground);
    text-decoration: none;
    transition: all 0.3s ease;
}
.home-btn:hover {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ★★★★★ ปรับขนาดโลโก้ในหน้า Members ที่นี่ ★★★★★ */
header .logo {
    max-width: 150px; /* แก้ไขค่านี้เพื่อปรับขนาด เช่น 100px */
}
/* ★★★★★ จบส่วนแก้ไข ★★★★★ */

.search-section { margin-bottom: 3rem; }
.search-container { position: relative; max-width: 500px; margin: 0 auto; }
.search-icon { position: absolute; top: 50%; left: 1.5rem; transform: translateY(-50%); color: #8a8a8a; }
#searchInput { width: 100%; padding: 1rem 1rem 1rem 3.5rem; border-radius: var(--card-radius); color: var(--color-foreground); font-size: 1rem; background-color: rgba(42, 42, 42, 0.8); border: 2px solid var(--color-border); transition: all 0.2s ease; }
#searchInput:focus { outline: none; border-color: #d4d4d4; box-shadow: 0 0 15px rgba(200, 200, 200, 0.3); }

/* เพิ่มส่วนนี้สำหรับปุ่มกรอง */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.filter-btn {
    padding: 0.8rem 2rem;
    border-radius: var(--card-radius);
    background-color: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--color-border);
    color: var(--color-foreground);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter-btn:hover {
    border-color: #d4d4d4;
    box-shadow: 0 0 15px rgba(200, 200, 200, 0.3);
}
.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* --- 5. Member Sections (ปรับปรุงใหม่) --- */
.member-section {
  margin-bottom: 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--card-gap);
}
.member-section h2 {
  width: 100%;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(90deg, #d0d0d0, #ffffff, #d0d0d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shine 6s linear infinite;
}
.member-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  background: var(--card-background);
  border-left: none; /* ลบเส้นกรอบเดิม */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  flex: 0 1 calc((100% / var(--columns-per-row, 3)) - var(--card-gap));
  min-width: var(--card-min-width);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
/* เพิ่มเส้นขอบแบบเรืองแสง */
.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--card-radius);
    padding: var(--card-accent-border-width);
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    transition: all 0.3s ease;
}
.member-card:hover::before {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    box-shadow: 0 0 20px #4facfe;
}
.leader-card::before {
    background: linear-gradient(135deg, #ff9900, #ffc800);
}
.leader-card:hover::before {
    background: linear-gradient(135deg, #ffb300, #ffec00);
    box-shadow: 0 0 20px #ffb300;
}
.member-card .profile-pic {
  width: var(--profile-pic-size);
  height: var(--profile-pic-size);
  border-radius: 50%;
  object-fit: cover;
  margin-right: 1rem;
  border: var(--profile-pic-border-width) solid var(--profile-pic-border-color);
  flex-shrink: 0;
}
.member-card .member-info { 
  flex-grow: 1; 
  min-width: 0;
  text-align: left;
}
.member-card .member-info h3 { 
  font-size: var(--font-size-card-name);
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  margin: 0;
}
.member-card .member-info a {
  display: block;
  font-size: var(--font-size-card-link);
  color: var(--color-secondary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}
.member-card .member-info a:hover { color: var(--color-primary); }
.member-card .profile-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-secondary);
  transition: all 0.2s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.member-card .profile-link:hover {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  transform: scale(1.1);
}

/* --- 6. ส่วนท้าย, Pagination, และ Audio Player --- */
.loading-container { text-align: center; padding: 3rem; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--color-border); border-top: 3px solid var(--color-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border-subtle); }
.pagination-btn { background-color: #2a2a2a; color: var(--color-foreground); border: 1px solid var(--color-border); padding: 0.75rem 1.5rem; border-radius: var(--card-radius); cursor: pointer; transition: all 0.2s ease; }
.pagination-btn:hover:not(:disabled) { background-color: var(--color-primary); color: var(--color-primary-foreground); }
.pagination-btn:disabled { cursor: not-allowed; opacity: 0.4; }
footer { width: 100%; padding: 2rem 0; text-align: center; color: #8a8a8a; font-size: 0.875rem; margin-top: auto; }
#audio-player-container { position: fixed; bottom: 1.5rem; left: 1.5rem; border-radius: 12px; padding: 1rem; z-index: 1000; background-color: rgba(35, 35, 35, 0.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--color-border-subtle); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); }
.audio-controls { display: flex; align-items: center; gap: 1rem; }
.audio-btn { background: none; border: none; color: var(--color-secondary); cursor: pointer; font-size: 1rem; }
.audio-btn.primary { color: var(--color-primary); }
@media (max-width: 1024px) { .member-card { flex-basis: calc((100% / 2) - var(--card-gap)); } }
@media (max-width: 640px) { .member-card { flex-basis: 100%; } .pagination-controls { flex-direction: column; } }