/* ===== Design tokens ===== */
:root {
  --sa-surface: #ffffff;
  --sa-surface-alt: #F2E8DA;
  --sa-surface-alt-dark: #dcd4ca;
  --sa-text: #0f172a;
  --sa-text-muted: #475569;
  --sa-brand: #2563eb;
  --sa-brand-strong: #1e40af;
  --sa-accent: #457B9D;
  --sa-warn: #f59e0b;
  --sa-warn-strong: #d97706;
  --sa-border: rgba(15, 23, 42, 0.08);
  --sa-ring: rgba(37, 99, 235, 0.35);
  --sa-radius: 14px;
  --sa-shadow: 0 8px 30px rgba(2, 6, 23, 0.08);
  --sa-font: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--sa-font); color: var(--sa-text); }
/* (Optional) Screen-reader only utility in case universal.css doesn't define it */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Put image + info on the same line with a 10px gap */
.ad-media {
  display: flex;
  align-items: flex-start;   /* top-align the info with the image */
  gap: 10px;                 /* <-- your requested 10px spacing */
  align-content: start;
  flex-wrap: nowrap;
}

/* Keep your existing .ad-logo size rules */
.ad-logo {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  object-fit: cover;
  background: #1111;
}

.guild-info {
    position: static;
    display: flex;
    gap: 8px;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
}

.server-info {
  position: static;        
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.guild-counts-ad {
  position: static;          /* kill absolute positioning */
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: hsl(34deg 100% 88.84% / 60%);
  border-radius: 15px;
  font-weight: bold;
  white-space: nowrap;       /* keep short and tidy */
}


@media (max-width: 860px) {
  .ad-media {
    gap: 10px;
    flex-wrap: wrap;         /* if the screen is small, allow wrap */
    align-items: center;
  }
  .ad-logo {
    width: 120px;
    height: 120px;
  }
  .guild-counts-ad {
    font-size: 12px;
  }
}


.adBackground{
  background: url('/static/images/background_white.png') center center/cover no-repeat fixed !important;
  min-height: 100vh;
}
body.dark.adBackground::before{
  background: url('/static/images/background-2_dark.jpg') center center/cover no-repeat fixed !important;
}

body.dark.adBackground {
  background: url('/static/images/background-2_dark.jpg') center center/cover no-repeat fixed !important;
}

.adBackground{
  position: relative;
  min-height: 100vh;
  overflow: hidden; /* hide blur edges */
}





.sa-brand, .title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin: 0;
  cursor: pointer;
}
.sa-actions, .header-buttons {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* ===== Buttons & Links ===== */
.sa-btn {
  appearance: none;
  border: 1px solid var(--sa-border);
  background: var(--sa-surface);
  color: var(--sa-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .02s ease, background .2s, border-color .2s;
  text-decoration: none;
  height: 40.5px;
}
.sa-btn:hover { box-shadow: var(--sa-shadow); }
.sa-btn:active { transform: translateY(1px); }
.sa-btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--sa-ring); }

.sa-btn-text {
  background: transparent;
  border: 0;
  font-weight: 600;
  padding: 8px 10px;
}

.sa-btn-primary {
  background: var(--sa-brand);
  border-color: var(--sa-brand);
  color: #fff;
}
.sa-btn-primary:hover { background: var(--sa-brand-strong); border-color: var(--sa-brand-strong); }

.sa-btn-warn {
  background: var(--sa-warn);
  border-color: var(--sa-warn);
  color: #111827;
}
.sa-btn-warn:hover { background: var(--sa-warn-strong); border-color: var(--sa-warn-strong); }

.sa-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--sa-text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.sa-link:hover { text-decoration: underline; }

.sa-icon-btn {
  background: transparent;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  border: none;
}
.sa-icon-btn:hover { background: var(--sa-surface-alt);  border: 1px solid var(--sa-border); }

/* ===== Kebab menu ===== */
.sa-menu { position: relative; }

/* Corner placement */
.ad-menu-corner {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
}

/* Align popover to the button when in the corner */
.ad-menu-corner .sa-menu-pop {
  top: 44px;    /* just below the 40px button */
  right: 0;
}

.sa-menu-pop {
  position: absolute;
  top: 46px; right: 0;
  display: none;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  background: var(--sa-surface-alt);
  border: 1px solid var(--sa-border);
  border-radius: 12px;
  box-shadow: var(--sa-shadow);
  z-index: 50;
}
.sa-menu-pop button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}
.sa-menu-pop button:hover { background: hsl(35deg 45% 62% / 60%); }

/* ===== Shell & Card ===== */
.ad-shell {
  display: grid;
  place-items: start center;
  padding: 20px 16px 60px;
}


/* === Frosted glass card (transparent + blurry + gray borders) === */
.ad-card-large {
  position: relative;
  isolation: isolate; /* so ::after can sit behind the card without leaking */
  grid-template-columns: 160px 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1000px;

  /* Almost transparent background */
  background: hsl(35deg 45% 62% / 60%);

  /* Blur what’s behind the card (the “inside” look) */
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);

  /* Outer grayish border */
  border: 1px solid rgba(148, 163, 184, 0.35); /* slate-400ish */
  border-radius: var(--sa-radius);

  /* Softer, floaty shadow */
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.20);

  padding: 22px;
}

/* Inner subtle gray border + gentle inner glow */
.ad-card-large::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  /* Inner grayish ring */
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.28),
    inset 0 10px 24px rgba(2, 6, 23, 0.10);
}

/* Outside haze to emphasize the edge without a thick line */
.ad-card-large::after {
  content: "";
  position: absolute;
  inset: -12px; /* creates an “outside” border area */
  border-radius: calc(var(--sa-radius) + 12px);
  pointer-events: none;
  z-index: -1;           /* sits behind the card thanks to isolation */
  filter: blur(14px);    /* outside blur */
  background: rgba(148, 163, 184, 0.08); /* grayish halo */
}

/* Optional: stronger edge on hover/focus */
.ad-card-large:hover,
.ad-card-large:focus-within {
  border-color: rgba(148, 163, 184, 0.50);
  box-shadow: 0 14px 48px rgba(2, 6, 23, 0.24);
}


.ad-logo {
  width: 160px; height: 160px;
  border-radius: 18px;
  object-fit: cover;
  background: #1111;
}

/* ===== Info ===== */
.ad-info { min-width: 0; }
.ad-header { margin-bottom: 10px; }
.ad-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 28px;
}
.ad-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 12px;
  border: 1px solid var(--sa-border);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--sa-surface-alt);
  color: var(--sa-text);
  text-decoration: none;
}
.chip--primary {
  background: var(--sa-surface-alt);
}

.chip--primary:hover, .chip:hover{
  background: var(--sa-surface-alt-dark);
}
/* ===== Description (readonly) ===== */
#description {
  resize: none;
  height: auto;
  min-height: 250px;
  overflow: auto;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid var(--sa-border);
  border-radius: 12px;
  font-family: var(--sa-font);
  background-color: var(--sa-surface-alt);
  margin: 10px 0 16px;
}

/* ===== CTA row ===== */
.ad-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.vote-form { display: inline-block; }

/* ===== Footer ===== */
.ad-footer { position: relative; padding-top: 6px; }
.userProfile { position: static; }

/* ===== Saved notification ===== */
.notification {
  position: fixed;
  bottom: 20px; left: 20px;
  background: #16a34a;
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--sa-shadow);
  z-index: 60;
}
.notification.hidden { display: none; }
.notification .notif-link { color: #fff; font-weight: 800; margin-left: 8px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .ad-card-large { grid-template-columns: 1fr; padding: 18px; }
  .ad-media { order: 1; }
  .ad-logo { width: 120px; height: 120px; }
  .ad-title { font-size: 24px; }
  .guild-counts-ad { font-size: 12px; }

}

.guild-counts-ad #online {
  color: #2e7d32;  
}

.guild-counts-ad #total {
  color: #d35400;  
}

.guild-counts-ad #createdAt {
  color: #6a1b9a;  
}

body.dark .guild-counts-ad {
  background: #424e5b;
  color: #c6bbb0;
  
}


body.dark .guild-counts-ad #online {
  color: #45bc4b;  
}
body.dark .guild-counts-ad #total {
  color: #e99036;
}

body.dark .guild-counts-ad #createdAt {
  color: #a78bfa;
}

body.dark .sa-menu-pop button:hover { 
  background: hsl(212deg 16% 16% / 60%); 
}
