/* css/manage-server.css */
#server-manage-section {
  margin-top: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(30,32,38,0.95);
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  padding: 2.5em 2em 2em 2em;
}
#server-header {
  display: flex;
  align-items: center;
  gap: 1.5em;
  margin-bottom: 1.5em;
}
#server-icon-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: #181a20;
  box-shadow: 0 0 0 1.5px #43b7ce, 0 2px 8px 0 rgba(67,183,206,0.06);
  margin-bottom: 1em;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}
#server-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  background: transparent;
  box-shadow: none;
  margin-bottom: 1em;
  border: none;
  outline: none;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}
#server-icon-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1em auto;
}
#server-name {
  font-size: 2em;
  font-weight: bold;
  color: #fff;
  margin-bottom: 0.2em;
}
#server-member-count {
  color: #aaa;
  font-size: 1.1em;
}
#server-roles-section {
  margin-top: 2.5em;
}
#server-roles-section h3 {
  color: #43b7ce;
  margin-bottom: 0.7em;
}
#server-roles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1em;
}
#server-roles-list li {
  font-size: 1.08em;
  font-weight: 500;
  background: #23252b;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  margin: 0.2em 0;
  color: #fff;
  transition: background 0.2s;
}
#server-roles-list li:hover {
  background: #43b7ce;
  color: #181a20;
}
#server-switcher {
  font-size: 1.08rem;
  padding: 0.5em 1.2em;
  border-radius: 8px;
  border: 1.5px solid #43b7ce;
  background: #181a20;
  color: #43b7ce;
  margin: 1em 0 1.5em 0;
  box-shadow: 0 2px 12px rgba(67,183,206,0.2);
  transition: border 0.18s, box-shadow 0.18s;
  outline: none;
  appearance: none;
  cursor: pointer;
}
#server-switcher:focus, #server-switcher:hover {
  border: 1.5px solid #fff;
  box-shadow: 0 2px 18px rgba(67,183,206,0.33);
  background: #23252b;
  color: #fff;
}
#server-switcher option {
  background: #23252b;
  color: #43b7ce;
}
#manage-main {
  display: flex;
  flex-direction: row;
  min-height: 80vh;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  background: none;
  padding-top: 10em; /* Push down for navbar */
}
#server-info-box {
  min-width: 270px;
  max-width: 320px;
  max-height: 30em;
  width: 320px;
  background: #23252b;
  border-radius: 18px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  padding: 2em 1.2em 1.2em 1.2em;
  margin: 2.5em 2em 2.5em 2.5em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2em;
  position: sticky;
  top: 110px;
  box-sizing: border-box;
  overflow: visible;
}
#server-info-box #server-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  background: #181a20;
  box-shadow: 0 0 0 1.5px #43b7ce, 0 2px 8px 0 rgba(67,183,206,0.06);
  display: block;
  margin-bottom: 1em;
  border: none;
  outline: none;
}
#server-info-box #server-icon:empty, #server-info-box #server-icon[src=""] {
  background: #181a20;
  box-shadow: 0 0 0 1.5px #43b7ce, 0 2px 8px 0 rgba(67,183,206,0.06);
}
.server-info-meta {
  width: 100%;
  text-align: center;
}
#server-info-box #server-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
  margin-bottom: 0.2em;
}
#server-info-box #server-member-count {
  color: #aaa;
  font-size: 1em;
  margin-bottom: 0.5em;
}
#server-roles-box {
  background: #181a20;
  border-radius: 8px;
  padding: 0.5em 0.7em;
  margin-top: 0.5em;
  font-size: 0.98em;
  color: #aaa;
  text-align: left;
}
#server-roles-list {
  list-style: none;
  padding: 0;
  margin: 0.2em 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 0.5em;
}
#server-roles-list li {
  font-size: 0.98em;
  font-weight: 500;
  background: #23252b;
  border-radius: 6px;
  padding: 0.1em 0.5em;
  margin: 0.1em 0;
  color: #fff;
  transition: background 0.2s;
}
#plugins-dashboard {
  flex: 1 1 0;
  margin: 2.5em 2.5em 2.5em 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 0;
}
.plugin-categories {
  display: flex;
  gap: 0.7em;
  margin-bottom: 1.5em;
}
.plugin-category-btn {
  background: #23252b;
  color: #aaa;
  border: none;
  border-radius: 5px;
  padding: 0.4em 1.2em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.plugin-category-btn.active {
  background: #43b7ce;
  color: #181a20!important;
}
.plugin-category-btn:hover {
  color: #fff;
}
.plugin-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2em 2.2em;
  width: 100%;
}
.plugin-card {
  background: #23252b;
  border-radius: 14px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  padding: 1.2em 1.3em 1.1em 1.3em;
  min-width: 260px;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  transition: box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
}
.plugin-card.enabled {
  border: 2px solid #43b7ce;
}
.plugin-card:not(.enabled):hover {
  background: #292b31;
}
.plugin-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 0.7em;
  background: #181a20;
  object-fit: cover;
}
.plugin-info {
  margin-bottom: 1.1em;
}
.plugin-name {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.2em;
  color: #fff;
}
.plugin-desc {
  color: #aaa;
  font-size: 0.98em;
}
.plugin-btn {
  background: #23252b;
  color: #43b7ce;
  border: 1.5px solid #43b7ce;
  border-radius: 7px;
  padding: 0.45em 1.2em;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  margin-top: auto;
}
.plugin-btn.active {
  background: #43b7ce;
  color: #181a20;
  border: none;
  cursor: default;
}
.plugin-btn.hovered:not(.active), .plugin-card:not(.enabled):hover .plugin-btn:not(.active) {
  background: #43b7ce;
  color: #181a20;
  box-shadow: none !important;
}
.plugin-card:not(.enabled):hover {
  box-shadow: 0 2px 12px rgba(67,183,206,0.33), 0 1.5px 6px #0001 !important;
}

/* --- Enable Button Fill Effect on Card Hover --- */
.plugin-card .plugin-enable-btn {
  transition: background 0.25s cubic-bezier(.4,1.6,.4,1), color 0.18s;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.plugin-card:hover .plugin-enable-btn,
.plugin-card:focus-within .plugin-enable-btn {
  background: var(--accent);
  color: #181c23;
  border-color: var(--accent);
}

/* Loader styles */
#server-info-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-top: 1.5em;
}
.server-loader-spinner {
  border: 4px solid #23252b;
  border-top: 4px solid #43b7ce;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  animation: spin 1s linear infinite;
  margin-bottom: 1em;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#server-info-loader span {
  color: #aaa;
  font-size: 1.1em;
  margin-top: 0.5em;
}

/* Animation for fade-in and slide-up */
.server-fade-in {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1);
}
.server-fade-in.visible {
  opacity: 1;
}
.server-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1), transform 0.5s cubic-bezier(.4,0,.2,1);
}
.server-slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.plugins-header-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7em;
  margin-bottom: 1.2em;
}
.plugins-title {
  font-size: 1.45em;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.1em 0;
  letter-spacing: 0.01em;
}
#plugin-search {
  width: 260px;
  max-width: 100%;
  padding: 0.5em 1em;
  border-radius: 8px;
  border: 1.5px solid #43b7ce;
  background: #181a20;
  color: #fff;
  font-size: 1.08em;
  outline: none;
  margin-bottom: 0.2em;
  transition: border 0.18s, box-shadow 0.18s;
}
#plugin-search:focus {
  border: 1.5px solid #fff;
  box-shadow: 0 2px 12px rgba(67,183,206,0.33);
}
#manage-main, #server-info-box, #server-icon-container, #server-icon-placeholder, #server-icon, .server.info-meta, #server-roles-box, #server-roles-list, .plugin-categories, .plugin-cards, .plugin-card, .plugin-btn, .plugins-header-bar, #plugin-search, .plugins-title {
  user-select: none;
}
#server-name, #server-member-count {
  user-select: text;
}

/* --- Server Switcher Dropdown Styles --- */
#server-switcher-dropdown {
  width: 100%;
  max-width: 320px;
  margin: 1.1em 0 0.5em 0;
  border-radius: 5px;
  position: relative;
  font-size: 0.95rem; /* smaller text for more fit */
  z-index: 20;
}
.server-switcher-selected {
  display: flex;
  align-items: center;
  background: #23252b;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0.5em 1.2em 0.5em 0.7em;
  cursor: pointer;
  transition: border 0.18s, box-shadow 0.18s;
  font-weight: bold;
  color: #fff;
  min-height: 44px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.server-switcher-dropdown:hover .server-switcher-selected {
  border: 2px solid #43b7ce;
  box-shadow: 0 2px 18px rgba(67,183,206,0.18);
}

.server-switcher-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-right: 0.8em;
  object-fit: cover;
  background: #181a20;
  flex-shrink: 0;
}
.server-switcher-name {
  font-weight: bold;
  font-size: 0.98em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 25ch; /* cut off after 20 characters visually */
  display: inline-block;
  vertical-align: middle;
}
.server-switcher-caret {
  margin-left: auto;
  color: #aaa;
  transition: transform 0.18s;
}
.server-switcher-dropdown.open .server-switcher-caret {
  transform: rotate(180deg);
}
.server-switcher-list {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: #23252b;
  border-radius: 10px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  z-index: 30;
  padding: 0.3em 0 0.3em 0;
  margin: 0;
  display: none;
}
.server-switcher-item {
  display: flex;
  align-items: center;
  padding: 0.5em 1.2em 0.5em 0.7em;
  font-weight: bold;
  color: #fff;
  font-size: 0.98em; /* smaller text for more fit */
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0;
  transition: background 0.18s, color 0.18s;
  min-height: 44px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.server-switcher-item.selected {
  background: #292b31;
  color: #43b7ce;
}
.server-switcher-item:hover:not(.selected) {
  background: #292b31;
  color: #fff;
}
.server-switcher-item .server-switcher-icon {
  width: 28px;
  height: 28px;
  margin-right: 0.8em;
  border-radius: 7px;
}
.server-switcher-item .server-switcher-name {
  max-width: 20ch;
}
.server-switcher-item.add-server {
  color: #43b7ce;
  font-weight: 600;
  display: flex;
  align-items: center;
  border-top: 1px solid #23252b;
  margin-top: 0.2em;
  padding-top: 0.6em;
}
.add-server-plus {
  font-size: 1.2em;
  margin-right: 0.7em;
  color: #43b7ce;
  font-weight: bold;
}
@media (max-width: 600px) {
  #server-switcher-dropdown, .server-switcher-list, .server-switcher-selected {
    max-width: 100vw;
    min-width: 0;
  }
  .server-switcher-name {
    max-width: 12ch;
  }
}
