@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Noto+Sans:ital,wght@0,300;0,400;0,600;1,400&display=swap');

:root {
  --bg-base:        #0b0e12;
  --bg-surface:     #131820;
  --bg-card:        #1a2030;
  --bg-hover:       #222b3a;
  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(52, 211, 120, 0.35);
  --green:          #34d378;
  --green-dim:      #1a7a45;
  --green-glow:     rgba(52, 211, 120, 0.15);
  --amber:          #f59e0b;
  --amber-glow:     rgba(245, 158, 11, 0.15);
  --text-primary:   #e8edf5;
  --text-secondary: #8994a8;
  --text-muted:     #4d5868;
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display:   'Rajdhani', sans-serif;
  --font-body:      'Noto Sans', sans-serif;
  --shadow-card:    0 4px 24px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.04);
  --shadow-glow:    0 0 40px rgba(52, 211, 120, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Subtle grid texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(52,211,120,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52,211,120,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ── Edit Button ── */
.edit_sv_button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.edit_sv_button:hover {
  color: var(--green);
  border-color: var(--border-accent);
  background: var(--bg-hover);
}

/* ══════════════════════════════════════
   BANNER
   Without video:  [ logo ] [ text ]
   With video:     [ logo ] [ text ] [ video ]
══════════════════════════════════════ */
.banner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 48px;
  margin: 0 32px;
  padding: 48px 56px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 340px;
}

/* Atmospheric corner glows */
.banner::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(52,211,120,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.banner::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 30%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.wave_svg, .bottom_waves { display: none; }

/* Logo */
.server-image-banner {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.server-image-banner img {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.server-image-banner img:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 56px rgba(0,0,0,0.7), var(--shadow-glow);
}

/* Text */
.banner-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 600px;
  position: relative;
  z-index: 1;
}

.banner-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* Green accent line under title */
.banner-text h1::after {
  content: '';
  display: block;
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), transparent);
  margin-top: 10px;
  border-radius: 2px;
}

.banner p,
.banner h2 {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Video (only rendered when server.background_video exists) ── */
.banner-video {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  max-width: 560px;
  margin-left: auto;
}

.banner-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.banner-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* With a video, shrink the logo so all three blocks fit */
.banner--video {
  gap: 36px;
}
.banner--video .server-image-banner img {
  width: 180px;
  height: 180px;
}
.banner--video .banner-text {
  flex: 1 1 0;
  max-width: 420px;
}

/* ── Server Links / Actions Bar ── */
.server_links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  margin: 12px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.server_links a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  white-space: nowrap;
}

.server_links a:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.server_links a img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.server_links a p { margin: 0; }

/* ── Subscribe / Follow Button ── */
.subscribe_button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-base);
  background: linear-gradient(135deg, var(--green), #22c55e);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(52,211,120,0.3);
  flex-shrink: 0;
  outline: none;
}

.subscribe_button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(52,211,120,0.45);
}

.subscribe_button:hover > svg {
  animation: ring 1s infinite;
}

.subscribe_button svg {
  stroke: var(--bg-base);
  fill: none;
}

@keyframes ring {
  0%, 99% { transform: rotate(0deg); }
  33% { transform: rotate(-20deg); }
  66% { transform: rotate(20deg); }
}

/* ── Upload CTA (sidebar) ── */
.server-upload-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  margin: 16px 0;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: linear-gradient(135deg, rgba(52,211,120,0.12), rgba(52,211,120,0.05));
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.server-upload-cta:hover {
  background: linear-gradient(135deg, rgba(52,211,120,0.2), rgba(52,211,120,0.08));
  border-color: var(--green);
  transform: translateY(-2px);
}

.server-upload-cta svg { stroke: var(--green); }

/* ── Members box ── */
.categories {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 460px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* header stays fixed, inner list scrolls */
}

.categories h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Wrapper that actually scrolls */
.categories .members-list {
  flex: 1 1 auto;
  min-height: 0; /* lets a flex child scroll instead of stretching */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.categories .members-list a {
  display: block;
  flex-shrink: 0;
}

/* Member rows */
.cat-tag {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-tag:last-child { border-bottom: none; }

.cat-tag:hover {
  background: var(--bg-hover);
  margin: 0;
}

.cat-tag img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cat-tag > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.cat-tag p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-tag label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  cursor: inherit;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

/* Medium screens: video drops below logo + text, full width of the banner */
@media (max-width: 1200px) {
  .banner--video {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo text"
      "video video";
    align-items: center;
    gap: 28px 32px;
  }
  .banner--video .server-image-banner { grid-area: logo; }
  .banner--video .banner-text         { grid-area: text; max-width: none; }
  .banner--video .banner-video {
    grid-area: video;
    max-width: none;
    margin-left: 0;
  }
}

/* Small screens: everything stacked and centered */
@media (max-width: 800px) {
  .banner,
  .banner--video {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: auto;
    padding: 32px 22px;
    gap: 24px;
    margin: 0 16px;
    border-radius: var(--radius-lg);
  }

  .banner-text,
  .banner--video .banner-text { max-width: none; width: 100%; }

  .banner-text h1::after { margin: 10px auto 0; }

  .server-image-banner img,
  .banner--video .server-image-banner img {
    width: 160px;
    height: 160px;
  }

  .banner--video .banner-video {
    width: 100%;
    margin: 0;
  }

  .server_links {
    margin: 12px 16px;
  }
  .server_links a {
    padding: 8px 12px;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .banner,
  .banner--video {
    margin: 0;
    border-radius: 0;
    padding: 24px 16px;
  }
  .server_links {
    margin: 8px 0;
    border-radius: 0;
    padding: 12px 16px;
  }
  .server-image-banner img,
  .banner--video .server-image-banner img {
    width: 130px;
    height: 130px;
  }
}