@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;600;700;900&display=swap');

/* 🚀 Performance Optimizations */
* {
  will-change: auto;
}

.member-card, .glass-card, .cta-button {
  will-change: transform, opacity;
}

/* 🎆 Page Loading */
body {
  opacity: 0;
  animation: pageLoad 0.8s ease-out forwards;
}

@keyframes pageLoad {
  to {
    opacity: 1;
  }
}

/* 🌈 Ultra Modern Anime Design System */
:root {
  /* 🎨 Pastel Anime Color Palette */
  --primary: #ff69b4;
  --secondary: #87ceeb;
  --accent: #dda0dd;
  --success: #98fb98;
  --warning: #ffd700;
  --info: #add8e6;
  
  /* 🌸 Background Colors */
  --bg-primary: #fafbff;
  --bg-secondary: #f0f4ff;
  --bg-tertiary: #e8f0ff;
  
  /* 💎 Glass Effects */
  --glass-ultra: rgba(255, 255, 255, 0.95);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-medium: rgba(255, 255, 255, 0.6);
  --glass-light: rgba(255, 255, 255, 0.4);
  
  /* ✨ Shadows & Glows */
  --shadow-xs: 0 2px 8px rgba(255, 105, 180, 0.08);
  --shadow-sm: 0 4px 16px rgba(255, 105, 180, 0.12);
  --shadow-md: 0 8px 32px rgba(255, 105, 180, 0.16);
  --shadow-lg: 0 16px 48px rgba(255, 105, 180, 0.2);
  --shadow-xl: 0 24px 64px rgba(255, 105, 180, 0.24);
  
  --glow-primary: 0 0 20px rgba(255, 105, 180, 0.3);
  --glow-secondary: 0 0 20px rgba(135, 206, 235, 0.3);
  --glow-accent: 0 0 20px rgba(221, 160, 221, 0.3);
  
  /* 📐 Spacing & Borders */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-2xl: 40px;
  --radius-full: 9999px;
  
  --border-width: 1px;
  --border-color: rgba(255, 255, 255, 0.3);
  
  /* 🎭 Typography */
  --font-primary: 'Inter', 'Noto Sans SC', sans-serif;
  --font-heading: 'Inter', 'Noto Sans SC', sans-serif;
  
  /* 🌊 Animations */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 🌟 Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: 
    linear-gradient(135deg, rgba(248, 251, 255, 0.9) 0%, rgba(240, 244, 255, 0.9) 50%, rgba(232, 240, 255, 0.9) 100%),
    url('../img/background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #2d3748;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  margin: 0;
  padding: 0;
}

/* 🌌 Animated Background Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 105, 180, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(135, 206, 235, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(221, 160, 221, 0.08) 0%, transparent 50%);
  animation: float-bg 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes float-bg {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(1deg); }
  66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

/* 🎯 Container & Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.content-wrapper {
  position: relative;
  z-index: 1;
  padding-top: 4rem; /* Add some space after the hero section */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(248, 251, 255, 1) 200px);
}

/* 🎆 Section Spacing */
section {
  margin-bottom: 6rem;
}

section:last-child {
  margin-bottom: 2rem;
}

/* 🌈 Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  background: var(--glass-ultra);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: var(--border-width) solid var(--border-color);
  transition: transform var(--transition-normal);
}

header nav.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

nav ul li a {
  color: #4a5568;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: all var(--transition-normal);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-normal);
}

nav ul li a:hover {
  color: var(--primary);
}

nav ul li a:hover::after {
  width: 100%;
}

/* 🌠 Hero Section */
#hero {
  min-height: 600px;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 0 2rem;
  position: relative;
  box-sizing: border-box;
  z-index: 1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.2rem;
  color: #5a677d;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 🚀 CTA Button */
.cta-button {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: white;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: none;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left var(--transition-slow);
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-lg);
  filter: drop-shadow(var(--glow-primary));
}

/* 💎 Glass Cards */
.glass-card {
  background: var(--glass-strong);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: var(--border-width) solid var(--border-color);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 105, 180, 0.4);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
}

p {
  margin-bottom: 1rem;
  color: #4a5568;
}

/* 👥 Members Section */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.member-card {
  background: var(--glass-ultra);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  border: var(--border-width) solid var(--border-color);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.member-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 105, 180, 0.4);
}

.member-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
}

.member-avatar img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  opacity: 0; /* for lazy load fade-in */
}

.member-avatar img.loaded {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.avatar-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: var(--radius-full);
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.member-card:hover .avatar-glow {
  opacity: 1;
  animation: rotateGlow 4s linear infinite;
}

@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.member-card:hover .member-avatar img {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.member-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

.member-card p {
  font-size: 0.9rem;
  color: #666;
  min-height: 54px; /* Ensure consistent height */
  margin-bottom: 1rem;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tag Color Variants */
.tag.leader { background: linear-gradient(135deg, #f6e05e, #ecc94b); color: #9c4221; }
.tag.admin { background: linear-gradient(135deg, #63b3ed, #4299e1); color: white; }
.tag.veteran { background: linear-gradient(135deg, #9f7aea, #b794f6); color: white; }
.tag.active { background: linear-gradient(135deg, var(--success), #68d391); color: #22543d; }
.tag.special { background: linear-gradient(135deg, #ed8936, #f6ad55); color: white; }
.tag.member { background: linear-gradient(135deg, var(--info), #90cdf4); color: #2a4365; }
.tag.legend { background: linear-gradient(135deg, #a855f7, #d8b4fe); color: white; }
.tag.couple { background: linear-gradient(135deg, #f472b6, #fb7185); color: white; }
.tag.funny { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #78350f; }
.tag.dragon { background: linear-gradient(135deg, #ef4444, #f87171); color: white; }
.tag.mystery { background: linear-gradient(135deg, #64748b, #94a3b8); color: white; }
.tag.fairy { background: linear-gradient(135deg, #ec4899, #f9a8d4); color: #831843; }
.tag.mangod { background: linear-gradient(135deg, #3b82f6, #93c5fd); color: #1e3a8a;}
.tag.gay { background: linear-gradient(135deg, #b667f0, #e0aaff); color: #4a1d96; }

.tag:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

/* 🎬 Video Container */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: var(--border-width) solid var(--border-color);
  background: var(--glass-light);
  backdrop-filter: blur(15px);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 📱 Join Section */
.join-info {
  text-align: center;
  margin-top: 2rem;
}

.join-info p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.join-info strong {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
}

.qr-code {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  margin: 1.5rem auto;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.qr-code:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* 🌸 Footer */
footer {
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  padding: 3rem 0;
  border-top: var(--border-width) solid var(--border-color);
  margin-top: 4rem;
}

.social-links {
  margin-bottom: 1.5rem;
}

.social-links a {
  color: #4a5568;
  font-weight: 600;
  margin: 0 1rem;
  text-decoration: none;
  transition: all var(--transition-normal);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
}

.social-links a:hover {
  color: var(--primary);
  background: var(--glass-light);
  transform: translateY(-2px);
}

footer p {
  color: #718096;
  font-size: 0.9rem;
}

/* 🎭 Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
  transition-delay: calc(0.05s * var(--index, 0));
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 🎆 Additional Animations */
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3) translateY(50px); }
  50% { opacity: 1; transform: scale(1.05) translateY(-10px); }
  70% { transform: scale(0.9) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 🌈 Hover Effects Enhancement */
.cta-button:active {
  transform: translateY(-2px) scale(0.98);
}

.member-card:active {
  transform: translateY(-4px) scale(0.98);
}

/* 📱 Responsive Design - Unified */

/* Tablet and below */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  header nav.container {
    flex-direction: column;
    height: auto;
    padding: 1rem 1.5rem;
  }

  .navbar-nav {
    margin-top: 1rem;
    gap: 0.5rem;
  }

  nav ul li a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .members-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    gap: 1.5rem;
  }

  .glass-card {
    padding: 1.5rem;
  }

  .member-tags {
    gap: 0.3rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  h2::after {
    width: 40px;
    height: 3px;
  }
  
  #hero {
    padding: 100px 1.5rem 2rem 1.5rem;
  }
}

/* Phone and below */
@media (max-width: 480px) {
  .members-grid {
    grid-template-columns: 1fr; /* 1 column on phones */
  }

  #hero {
    padding: 80px 1rem 2rem 1rem;
    min-height: 80vh;
  }

  .hero-content h1 {
    font-size: clamp(2.2rem, 10vw, 2.8rem);
  }

  .hero-content p {
    font-size: 1rem;
  }

  .cta-button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}
