/* --- CORE CSS DESIGN SYSTEM & TOKENS --- */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Color Palette */
  --bg-main: #07090e;
  --bg-card: rgba(15, 20, 30, 0.55);
  --bg-card-hover: rgba(22, 28, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(0, 240, 255, 0.6);
  
  --color-primary: #00f0ff;
  --color-primary-glow: rgba(0, 240, 255, 0.35);
  --color-secondary: #0072ff;
  --color-accent: #8b5cf6;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-success: #10b981;
  --text-warning: #f59e0b;
  
  --shadow-glow: 0 0 25px var(--color-primary-glow);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASIC STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Background Grid Mesh */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 0);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  z-index: -2;
  pointer-events: none;
}

/* Pulsing Glowing Background Orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  animation: orb-float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-primary) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-secondary) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -5s;
}

@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

code, pre {
  font-family: 'Consolas', 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 2px 6px;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 50px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.95rem;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-glowing {
  position: relative;
  overflow: hidden;
}

.btn-glowing::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.btn-glowing:hover::after {
  transform: translate(30%, 30%) rotate(30deg);
}

.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- LANDING PAGE --- */
.landing-body {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.landing-container {
  max-width: 1280px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 90vh;
  justify-content: space-between;
}

.action-buttons {
  margin-top: 28px;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  transition: var(--transition-smooth);
}

.logo:hover .logo-img {
  transform: scale(1.08) rotate(-3deg);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}

.accent-text {
  background: linear-gradient(135deg, #00ffd5 0%, #0072ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 60px;
  padding: 40px 0;
}

.hero-section {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.hero-visual {
  margin-top: 15px;
  margin-bottom: 10px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.65), 
    0 0 30px rgba(0, 240, 255, 0.15);
  transition: var(--transition-smooth);
}

.hero-visual:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.75), 
    0 0 40px rgba(0, 240, 255, 0.25);
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.hero-title {
  font-size: 3rem;
  line-height: 1.15;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 20px rgba(0, 240, 255, 0.3));
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 680px;
}

.discord-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  padding: 30px;
  border-radius: 20px;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
}

.feature-emoji {
  font-size: 2.2rem;
  margin-bottom: 20px;
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.landing-footer {
  text-align: center;
  padding: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-glass);
}
/* Hero Split Layout Container */
.hero-split-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  width: 100%;
}

@media (min-width: 992px) {
  .hero-split-container {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    text-align: left;
    gap: 50px;
  }

  .hero-text-content {
    flex: 1;
    max-width: 43%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .hero-subtitle {
    margin-left: 0 !important;
  }

  .discord-mockup {
    flex: 1;
    max-width: 54%;
    margin-top: 0 !important;
  }
}

.banner-showcase {
  width: 100%;
  max-width: 1100px;
  margin: 30px auto 0 auto;
}

/* Discord Reply Thread Connections */
.discord-msg-with-reply {
  position: relative;
  padding-top: 30px !important; /* Space on top of message to clear reply line */
}

.discord-reply-spine {
  position: absolute;
  top: 14px;
  left: 44px; /* Centered right above the 40px bot avatar (24px left padding + 20px center) */
  width: 31px;
  height: 18px;
  border-left: 2px solid #4e5058; /* Real Discord spine border color */
  border-top: 2px solid #4e5058;
  border-top-left-radius: 6px;
  pointer-events: none;
}

.discord-reply-bar {
  position: absolute;
  top: 4px;
  left: 81px; /* Align precisely after the reply spine curve */
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #b5bac1; /* Real Discord reply color */
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 82%;
  user-select: none;
}

.discord-reply-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.discord-reply-author {
  font-weight: 600;
  color: #f2f3f5;
  opacity: 0.85;
}

.discord-reply-content {
  color: #949ba4;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Discord Channel Terminal Mockup */
.discord-mockup {
  width: 100%;
  background: #313338; /* Real Discord chat background */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(0, 240, 255, 0.03);
  text-align: left;
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.discord-mockup:hover {
  border-color: rgba(0, 240, 255, 0.15);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(0, 240, 255, 0.08);
}

.discord-header {
  background: #2b2d31; /* Real Discord channel sidebar/header color */
  padding: 12px 18px;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.discord-icon-channel {
  font-size: 1.3rem;
  color: #80848e; /* Real Discord icon color */
  font-weight: 400;
}

.discord-channel-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: #f2f3f5; /* Real Discord text color */
}

.discord-channel-desc {
  font-size: 0.8rem;
  color: #949ba4; /* Real Discord description text color */
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 10px;
}

.discord-body {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
}

.discord-msg {
  display: flex;
  gap: 16px;
  padding: 8px 24px;
  transition: background 0.1s ease;
}

.discord-msg:hover {
  background: rgba(255, 255, 255, 0.02); /* Simulated message hover background */
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.discord-avatar-bot {
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.discord-msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.discord-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-author {
  font-weight: 500;
  font-size: 0.95rem;
  color: #f2f3f5; /* Real Discord username color */
  cursor: pointer;
}

.discord-author:hover {
  text-decoration: underline;
}

.discord-bot-badge {
  background: #5865f2; /* Real Discord bot badge background color */
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.discord-timestamp {
  font-size: 0.72rem;
  color: #949ba4; /* Real Discord timestamp color */
}

.discord-text {
  font-size: 0.9375rem; /* Real Discord chat font size */
  color: #dbdee1; /* Real Discord chat text color */
  line-height: 1.375rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.discord-mention {
  color: #e0e1e5;
  background: rgba(88, 101, 242, 0.3); /* Real Discord blue mention highlight */
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease;
}

.discord-mention:hover {
  background: rgba(88, 101, 242, 0.4);
}

.discord-embed {
  margin-top: 8px;
  background: rgba(14, 18, 28, 0.75);
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  padding: 20px;
  max-width: 550px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.discord-embed-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.discord-embed-desc {
  font-size: 0.88rem;
  color: #b9bbbe;
  line-height: 1.4;
}

.discord-embed-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}

.discord-embed-field-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.discord-embed-field-val {
  font-size: 0.88rem;
  color: #b9bbbe;
}

.discord-embed-img {
  margin-top: 8px;
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
  max-width: 500px;
  height: auto;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Warning Card (OAuth issue) */
.warning-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  max-width: 600px;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.warning-card.hidden {
  display: none;
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.warning-icon {
  font-size: 1.6rem;
}

.warning-card h3 {
  color: var(--text-warning);
  font-size: 1.15rem;
}

.warning-card p {
  font-size: 0.9rem;
  color: #d1d5db;
  margin-bottom: 12px;
}

.warning-card pre {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.warning-card pre code {
  color: #f3f4f6;
  font-size: 0.8rem;
  padding: 10px;
  display: block;
}

.warning-footer {
  font-size: 0.85rem;
  color: var(--text-muted) !important;
}

.warning-footer a {
  text-decoration: underline;
}

/* --- APP LAYOUT (DASHBOARD) --- */
.dashboard-body {
  padding: 0;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  box-shadow: var(--shadow-card);
  margin-bottom: 30px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 18px 6px 6px;
  border-radius: 40px;
  border: 1px solid var(--border-glass);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.user-info .username {
  font-weight: 600;
  font-size: 0.9rem;
}

.logout-btn {
  font-size: 0.8rem;
  padding: 6px 14px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  box-shadow: 0 0 15px var(--color-primary-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- SERVERS SECTION --- */
.servers-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 1;
  transition: var(--transition-smooth);
}

.servers-section.hidden {
  display: none;
}

.section-header {
  margin-bottom: 10px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-muted);
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Server Card */
.server-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  gap: 16px;
}

.server-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.6);
}

/* Favorite Star Button */
.favorite-star-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.25);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  outline: none;
}

.favorite-star-btn:hover {
  transform: scale(1.25);
  color: #ffca28;
}

.favorite-star-btn.is-favorite {
  color: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
  animation: star-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.favorite-star-btn:active {
  transform: scale(0.9);
}

@keyframes star-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.server-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  border: 2px solid var(--border-glass);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.server-icon-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.server-name {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge-active::before {
  background-color: var(--text-success);
  box-shadow: 0 0 8px var(--text-success);
  animation: pulse-green 2s infinite;
}

.status-badge-inactive {
  background: rgba(156, 163, 175, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(156, 163, 175, 0.15);
}

.status-badge-inactive::before {
  background-color: var(--text-muted);
}

@keyframes pulse-green {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.server-card .btn {
  width: 100%;
  margin-top: 10px;
}

/* --- SETTINGS SECTION --- */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 30px;
  opacity: 1;
  transition: var(--transition-smooth);
}

.settings-section.hidden {
  display: none;
}

.back-btn {
  align-self: flex-start;
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-btn:hover .btn-arrow {
  transform: translateX(-4px);
}

.server-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
}

.server-icon-large {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.settings-card-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-card);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-bottom: 35px;
}

.col-span-2 {
  grid-column: span 2;
}

/* Forms controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-emoji {
  font-size: 1.1rem;
}

.tooltip {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: help;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: #1e1e24;
  color: #fff;
  border: 1px solid var(--border-glass);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  white-space: normal;
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 50;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Dropdown and inputs styling */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-main);
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
  user-select: none;
}

.custom-select-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

.custom-select-trigger.active {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  background: rgba(0, 0, 0, 0.5);
}

.trigger-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.custom-select-trigger.active .trigger-arrow {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(18, 19, 25, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition-smooth);
  animation: select-fade-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes select-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-select-options.hidden {
  display: none;
}

/* Custom Scrollbar for Options Dropdown */
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.custom-select-option {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #d1d5db;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.custom-select-option.selected {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff !important;
  font-weight: 600;
}

textarea, input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-main);
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  background: rgba(18, 19, 25, 0.95);
}

textarea {
  resize: vertical;
}

/* Custom Channels selector checkboxes */
.channels-grid-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
}

/* Scrollbar styling */
.channels-grid-selector::-webkit-scrollbar {
  width: 6px;
}
.channels-grid-selector::-webkit-scrollbar-track {
  background: transparent;
}
.channels-grid-selector::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.channels-grid-selector::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.channel-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  font-size: 0.9rem;
  color: #d1d5db;
  user-select: none;
}

.channel-checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

.channel-checkbox-wrapper input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-color: transparent;
}

.channel-checkbox-wrapper input[type="checkbox"]:checked::after {
  content: '✓';
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
}

.channel-checkbox-wrapper:hover {
  color: var(--text-main);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-glass);
  padding-top: 25px;
}

#save-btn {
  padding: 14px 40px;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: rgba(20, 20, 27, 0.9);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 24px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  transform: translateY(20px);
  opacity: 0;
  animation: toast-in 0.3s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes toast-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.removing {
  animation: toast-out 0.3s forwards ease-in;
}

@keyframes toast-out {
  to {
    transform: translateY(20px) scale(0.9);
    opacity: 0;
  }
}

.toast-success {
  border-left: 4px solid var(--text-success);
}

.toast-error {
  border-left: 4px solid var(--color-accent);
}

.toast-info {
  border-left: 4px solid var(--color-secondary);
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-message {
  font-weight: 500;
  font-size: 0.9rem;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
  
  .settings-card-wrapper {
    padding: 24px;
  }
  
  .app-header {
    border-radius: 24px;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
}
