/* ═══════════════════════════════════════════════════════════
   BOTPANEL — Dashboard Stylesheet
   Aesthetic: Dark industrial with electric accent
   Fonts: Syne (headings) + DM Mono (code/labels)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0e11;
  --surface:   #15171c;
  --surface2:  #1e2028;
  --border:    #2a2d38;
  --accent:    #5865f2;
  --accent-h:  #4752c4;
  --success:   #57f287;
  --danger:    #ed4245;
  --warning:   #fee75c;
  --text:      #e3e5e8;
  --muted:     #72767d;
  --radius:    10px;
  --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono {
  font-family: 'DM Mono', monospace;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  color: var(--accent);
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px var(--accent));
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-h);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(88,101,242,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
  text-decoration: none;
}

.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }

/* ── Hero (landing page) ───────────────────────────────────── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(88,101,242,0.15);
  color: var(--accent);
  border: 1px solid rgba(88,101,242,0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #a0a4b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 960px;
  width: 100%;
  margin-top: 4rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(88,101,242,0.4);
  transform: translateY(-3px);
}

.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.feature-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.6; }

/* ── Page Layout ───────────────────────────────────────────── */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  flex: 1;
}

.page-header {
  margin-bottom: 2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Server Cards ──────────────────────────────────────────── */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
}

.server-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.server-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.server-initial {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
}

.server-info { flex: 1; }
.server-info h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.server-id { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--muted); }
.server-arrow { color: var(--muted); font-size: 1.2rem; }

/* ── Config Form ───────────────────────────────────────────── */
.config-form { display: flex; flex-direction: column; gap: 0; }

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1.2rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; flex-direction: column; gap: 1.5rem; }
.tab-content.active { display: flex; }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Form Controls ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

small {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88,101,242,0.15);
}

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control { cursor: pointer; }
select[multiple].form-control { padding: 0.3rem; }
select[multiple] option { padding: 0.3rem 0.5rem; border-radius: 4px; }

.color-input {
  width: 60px;
  height: 38px;
  padding: 2px 4px;
  cursor: pointer;
}

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-slider { background: rgba(88,101,242,0.3); }
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--accent);
}

/* ── Embed Config ──────────────────────────────────────────── */
.embed-config {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.25rem;
}

/* ── Form Actions ──────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  margin-top: 0.5rem;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(87,242,135,0.1);
  border-color: rgba(87,242,135,0.3);
  color: var(--success);
}

.alert-error {
  background: rgba(237,66,69,0.1);
  border-color: rgba(237,66,69,0.3);
  color: var(--danger);
}

/* ── Error / Empty ─────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}

.error-page h1 { font-size: 2rem; margin-bottom: 1rem; }
.error-page p { color: var(--muted); margin-bottom: 2rem; }

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .page { padding: 1rem; }
  .hero { padding: 3rem 1rem; }
  .hero-title { font-size: 2.5rem; }
  .form-actions { flex-direction: column; gap: 1rem; }
  .form-actions .btn { width: 100%; justify-content: center; }
}
