/* ============================================================
   Guild.css — Guild config pages (login selector + config)
   ============================================================ */

/* --- Guild login/selector page (index.html) --- */
.guild-login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(123,48,240,.4);
}

.card h1 { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.subtitle { font-size: 0.88rem; color: var(--muted); margin-bottom: 36px; }

.btn-discord {
  display: inline-flex; align-items: center; gap: 12px;
  background: #5865F2; color: #fff; font-size: 0.95rem; font-weight: 600;
  padding: 13px 28px; border-radius: 10px; text-decoration: none;
  border: none; cursor: pointer; transition: background .18s, transform .1s;
  width: 100%; justify-content: center;
}
.btn-discord:hover  { background: #4752c4; }
.btn-discord:active { transform: scale(.98); }
.btn-discord svg    { flex-shrink: 0; }

.error {
  margin-top: 20px;
  background: rgba(231,76,60,.12); border: 1px solid rgba(231,76,60,.3);
  color: var(--red); border-radius: 8px; padding: 10px 14px; font-size: 0.85rem;
}
.footer-note { margin-top: 32px; font-size: 0.75rem; color: var(--muted); }

/* Guild list (post-login) */
.guild-list { list-style: none; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.guild-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; cursor: pointer;
  text-decoration: none; color: var(--text);
  transition: border-color .18s, background .18s;
}
.guild-item:hover { border-color: var(--accent); background: rgba(61,127,212,.08); }
.guild-icon {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; overflow: hidden;
}
.guild-icon img { width: 100%; height: 100%; }
.guild-name { font-weight: 600; font-size: 0.95rem; }
.no-guilds  { color: var(--muted); font-size: 0.88rem; margin-top: 20px; }

.user-bar {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.user-avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-name   { font-weight: 600; font-size: 0.9rem; }
.btn-logout {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-size: 0.8rem; transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }
/* Match admin pill shape */
.badge { border-radius: 20px; }

.btn-history {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-size: 0.8rem; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.btn-history:hover { border-color: var(--accent); color: var(--accent); }

/* --- Guild config page (config.html) --- */
header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 56px; display: flex; align-items: center; gap: 16px;
}
.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--text); }
header h1 { font-size: 1.05rem; font-weight: 700; }
.header-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-user img { width: 28px; height: 28px; border-radius: 50%; }
.header-user span { font-size: 0.88rem; color: var(--muted); }

main { max-width: 1080px; margin: 36px auto; padding: 0 20px 60px; }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.cols2 section { margin-bottom: 0; }
@media (max-width: 720px) { .cols2 { grid-template-columns: 1fr; } }

.disabled-banner {
  background: rgba(231,76,60,.12); border: 1px solid rgba(231,76,60,.35);
  color: #f4a0a0; border-radius: 10px; padding: 12px 18px;
  margin-bottom: 28px; font-size: 0.9rem; display: none;
}

section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 28px; margin-bottom: 24px;
}
section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.field input[type="number"],
.field input[type="text"],
.field select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 14px; width: 160px; font-size: 0.95rem;
  transition: border-color .15s; outline: none;
}
.field input[type="text"],
.field select { width: 320px; }
.field select option, .field select optgroup { background: var(--surface); color: var(--text); }
.stats-row-field select option, .stats-row-field select optgroup { background: var(--surface); color: var(--text); }
.field input:focus,
.field select:focus { border-color: var(--accent); }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.9rem; }
.toggle-desc  { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* CSS toggle switch for guild config */
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background .2s;
}
.slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Theme grid (disabled themes section) */
.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
  margin-top: 12px;
}
.theme-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: border-color .15s;
}
.theme-card.disabled-theme { border-color: var(--red); background: rgba(231,76,60,.06); }
.theme-card input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; flex-shrink: 0; }
.theme-name  { font-size: 0.88rem; font-weight: 600; }
.theme-count { font-size: 0.75rem; color: var(--muted); }

.btn-save {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px 24px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background .18s, transform .1s; margin-top: 8px;
}
.btn-save:hover  { background: #3270be; }
.btn-save:active { transform: scale(.98); }
.btn-save:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* Toast for guild config (opacity transition) */
#toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px;
  font-size: 0.88rem; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 999;
}
#toast.show { opacity: 1; pointer-events: auto; }
#toast.ok  { border-color: var(--green); color: var(--green); }
#toast.err { border-color: var(--red);   color: var(--red); }

.loading { color: var(--muted); font-size: 0.9rem; padding: 40px 0; text-align: center; }

/* Stats row — compact horizontal */
.stats-row { margin-bottom: 24px; }
.stats-row-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.stats-row-inner h2 { margin-bottom: 0; }
.stats-row-field { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.stats-row-field select { width: 280px; margin-bottom: 0; }
.stats-row-field .btn-save { margin-top: 0; }
