/* css/manage.css */
#manage-servers-section {
  margin-top: 1.5rem;
  min-height: 110vh;
  position: relative;
  overflow: hidden;
}
#manage-servers-bg { display: none !important; }

#manage-servers-section h1 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

#manage-servers-section h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, #43b7ce 0%, #0e7c73 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 16px rgba(23,189,177,0.13));
}

#manage-servers-card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  gap: 2.2rem 4rem;
  padding: 2.5em 0 3em 0;
}

.server-card-outer {
  position: relative;
  display: inline-block;
  margin-bottom: 2.3em;
}
.server-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  min-height: 0;
  width: 410px;
  height: 110px;
  margin: auto;
  border-radius: 10px;
  border: 1px solid #23252b;
  box-shadow: 0 2px 16px 0 #0000002a;
  position: relative;
  background: rgba(35,37,43,0.85);  /* overflow: hidden; removed to allow button to pop out */
  transition: box-shadow 0.18s, border 0.18s, background 0.18s, transform 0.18s;
  overflow: hidden;
  z-index: 11;
  user-select: none;
}
.server-card-blur-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  filter: blur(18px) brightness(1.2) saturate(1.2);
  opacity: 0.45;
  pointer-events: none;
  object-fit: cover;
  border-radius: 18px;
}
.server-card-img-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #181a20;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 1.2em 0 1.2em;
  overflow: hidden;
  box-shadow: 0 0 0 2px #181a20, 0 2px 8px #00000022;
  z-index: 1;
}
.manage-server-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.server-card-info {
  text-align: left;
  margin-bottom: 0;
  width: 60%;
  z-index: 1;
}
.server-name {
  font-size: 1.18em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.18em;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 8px #181a20b0;
  word-break: break-word;
}
.server-role {
  font-size: 1em;
  color: #808080;
  margin-bottom: 0.1em;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}
.role-pill {
  background: #252933;
  font-weight: bold;
  color: #f1f1f1a2;
  font-size: 1em;
  font-weight: 500;
  border-radius: 6px;
  padding: 0.1em 0.7em;
  margin: 0 0 0 0;
  box-shadow: 0 1px 4px #00000018;
  letter-spacing: 0.01em;
}
.server-card-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 0.7em;
  margin-left: auto;
  margin-right: 1.5em;
  z-index: 1;
  height: 100%;
}
.server-manage-btn, .server-invite-btn {
  font-family: inherit;
  font-size: 1em;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.45em 1.2em;
  border: 1px solid #b6b6b6;
  outline: none;
  background: #23252b;
  color: #fff;
  box-shadow: 0 1px 4px #00000018;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, color 0.15s, box-shadow 0.15s;
}
.server-manage-btn:hover, .server-invite-btn:hover {
  background: #181a20;
  border-color: #43b7ce;
  color: #43b7ce;
  box-shadow: 0 2px 8px #43b7ce3a;
}
.server-card-btn-wrap {
  width: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: none;
  pointer-events: auto;
}
.server-card-btn-wrap::before {
  content: '';
  position: absolute;
  top: -1.5px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: #23252b;
  z-index: 2;
  border-radius: 0 0 8px 8px;
}
.server-card-btn-wrap .server-manage-btn,
.server-card-btn-wrap .server-invite-btn {
  pointer-events: auto;
  margin: 0;
  margin-top: -2.5px; /* less overlap, tighter to card */
  box-shadow: 0 4px 18px 0 #0000003a, 0 1.5px 0 #43b7ce3a;
  background: #23252b;
  border: 1.5px solid #fff;
  border-style: solid;
  border-width: 0 1.5px 1.5px 1.5px;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  font-size: 1em;
  font-weight: 700;
  padding: 0.5em 1.5em;
  transition: box-shadow 0.18s, background 0.18s, border 0.18s, color 0.18s, padding 0.18s;
  opacity: 1;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
  width: 120px; /* fixed width to prevent subpixel reflow */
  min-width: 90px;
  letter-spacing: 0.01em;
}
.server-card-btn-wrap .server-manage-btn:hover,
.server-card-btn-wrap .server-invite-btn:hover {
  background: #181a20;
  border-color: #43b7ce;
  border-width: 0 1.5px 1.5px 1.5px;
  border-top: 0;
  color: #43b7ce;
  box-shadow: 0 6px 24px #43b7ce3a, 0 2px 0 #43b7ce;
  /* Elongate button by increasing height by 2px on hover */
  padding-top: 0.7em;
}

.server-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 2.2em;
  gap: 4.2rem 7rem; /* Increase horizontal gap between cards */
}
.server-row:nth-child(odd) {
  flex-direction: row;
}
.server-row:nth-child(even) {
  flex-direction: row;
}
.server-row > .server-card {
  margin-bottom: 0;
}
.server-row > .server-card:only-child {
  margin-left: auto;
  margin-right: auto;
}


@media (max-width: 700px) {
  #manage-servers-card-container {
    max-width: 99vw;
    gap: 1.2rem 0.7rem;
    padding: 1.2em 0 2em 0;
  }
  .server-card {
    width: 98vw;
    min-width: 0;
    padding: 0.7em 0.2em 0.7em 0.2em;
    flex-direction: column;
    height: auto;
    margin-bottom: 3.2em;
  }
  .server-card-img-wrap, .manage-server-img {
    width: 60px;
    height: 60px;
    margin: 0.7em auto 0.7em auto;
  }
  .server-card-info {
    width: 100%;
    text-align: center;
  }
  .server-card-actions {
    margin: 0 auto 1em auto;
    align-items: center;
  }
  .server-card-btn-wrap {
    left: 0.7em;
  }
  .server-row {
    flex-direction: column !important;
    gap: 1.2rem 0.7rem;
    margin-bottom: 1.2em;
  }
}

.loader {
  transform: rotateZ(45deg);
  perspective: 1000px;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: #fff;
}
.loader:before,
.loader:after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: inherit;
  height: inherit;
  border-radius: 50%;
  transform: rotateX(70deg);
  animation: 1s spin linear infinite;
}
.loader:after {
  color: #b42e50;
  transform: rotateY(70deg);
  animation-delay: .4s;
}

@keyframes rotate {
  0% {
    transform: translate(-50%, -50%) rotateZ(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotateZ(360deg);
  }
}

@keyframes rotateccw {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes spin {
  0%,
  100% {
    box-shadow: .2em 0px 0 0px currentcolor;
  }
  12% {
    box-shadow: .2em .2em 0 0 currentcolor;
  }
  25% {
    box-shadow: 0 .2em 0 0px currentcolor;
  }
  37% {
    box-shadow: -.2em .2em 0 0 currentcolor;
  }
  50% {
    box-shadow: -.2em 0 0 0 currentcolor;
  }
  62% {
    box-shadow: -.2em -.2em 0 0 currentcolor;
  }
  75% {
    box-shadow: 0px -.2em 0 0 currentcolor;
  }
  87% {
    box-shadow: .2em -.2em 0 0 currentcolor;
  }
}

/* --- Server Card Raffle Animation --- */
@keyframes server-card-raffle {
  0% {
    opacity: 0;
    transform: scale(0.7) rotateZ(-8deg) translateY(40px);
    filter: blur(8px) brightness(1.2);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) rotateZ(2deg) translateY(-8px);
    filter: blur(1.5px) brightness(1.08);
  }
  80% {
    opacity: 1;
    transform: scale(0.98) rotateZ(-1deg) translateY(2px);
    filter: blur(0.5px) brightness(1.01);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0deg) translateY(0);
    filter: blur(0) brightness(1);
  }
}
.server-card-outer.raffle-animate {
  animation: server-card-raffle 0.68s cubic-bezier(.7,0,.3,1) both;
}

@media (max-width: 1100px) {
  #manage-servers-section h1 {
    font-size: 2.3rem;
    padding: 0 0.8rem;
    box-sizing: border-box;
  }

  #manage-servers-card-container {
    max-width: 94vw;
    gap: 1.4rem;
    padding: 1.6em 0 2em 0;
  }

  .server-row {
    flex-direction: column !important;
    gap: 1.2rem;
    margin-bottom: 1.2em;
  }

  .server-card {
    width: min(92vw, 520px);
    height: auto;
    min-height: 110px;
  }

  .server-card-btn-wrap {
    position: static;
    left: auto;
    transform: none;
    margin-top: 0.5em;
    justify-content: center;
  }

  .server-card-btn-wrap::before {
    display: none;
  }

  .server-card-btn-wrap .server-manage-btn,
  .server-card-btn-wrap .server-invite-btn {
    margin-top: 0;
    border-radius: 8px;
    border-width: 1.5px;
    border-top: 1.5px solid #fff;
    width: auto;
    min-width: 120px;
  }

  .server-card-btn-wrap .server-manage-btn:hover,
  .server-card-btn-wrap .server-invite-btn:hover {
    border-width: 1.5px;
    border-top: 1.5px solid #43b7ce;
    padding-top: 0.5em;
  }
}