@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #FFF5F7;
  --bg-gradient: linear-gradient(135deg, #FFF5F7 0%, #FFE8EE 50%, #FFF0F5 100%);
  --card: #FFFFFF;
  --card-hover: #FFF8FA;
  --text: #4A3F55;
  --text-muted: #B0A3B8;
  --accent: #FF8FAB;
  --accent-hover: #FF6B8A;
  --accent-light: #FFD6E0;
  --accent-gradient: linear-gradient(135deg, #FFB3C6 0%, #FF8FAB 100%);
  --pink: #FF6B8A;
  --pink-light: #FFE0EA;
  --rose: #FF4D6D;
  --lavender: #C8B6FF;
  --border: #F0DDE4;
  --border-light: #F8EDF1;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 50px;
  --shadow: 0 2px 16px rgba(255, 143, 171, 0.08);
  --shadow-hover: 0 8px 32px rgba(255, 143, 171, 0.15);
  --shadow-card: 0 4px 20px rgba(255, 143, 171, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
}

/* ===== SAKURA PETALS ===== */
.sakura-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sakura {
  position: absolute;
  top: -40px;
  opacity: 0.5;
  animation: sakura-fall linear infinite;
}

.sakura::before {
  content: '';
  display: block;
  width: var(--size, 14px);
  height: var(--size, 14px);
  background: radial-gradient(ellipse at center, #FFB7D0 0%, #FF8FAB 40%, transparent 70%);
  border-radius: 50% 0 50% 50%;
  transform: rotate(45deg);
}

@keyframes sakura-fall {
  0% {
    transform: translateY(-10vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% {
    transform: translateY(105vh) translateX(var(--drift, 80px)) rotate(var(--spin, 720deg));
    opacity: 0;
  }
}

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--pink);
  background: var(--pink-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-btn, .back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.2s;
}

.logout-btn:hover, .back-link:hover {
  color: var(--pink);
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

/* ===== HERO / MAIN PAGE ===== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.hero .authed-msg {
  color: var(--accent);
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}

.hero .authed-msg a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== BOT CARDS ===== */
.bot-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

@media (max-width: 800px) {
  .bot-cards { grid-template-columns: 1fr; }
}

.bot-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.bot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.bot-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
}

.bot-card:hover::before { opacity: 1; }

.card-icon {
  width: 56px;
  height: 56px;
  background: var(--pink-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.bot-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.bot-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-top: 8px;
}

.card-login-form {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.card-login-form input[type="password"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}

.card-login-form input[type="password"]:focus {
  border-color: var(--accent);
}

.card-login-form button {
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.card-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 143, 171, 0.3);
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .icon-box {
  width: 40px;
  height: 40px;
  background: var(--pink-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card h3 {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card p {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 4px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== FORMS ===== */
form label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

form input, form select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  max-width: 380px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

form input:focus, form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.12);
}

form input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--pink);
}

form input[type="number"] { max-width: 130px; }

/* ===== BUTTONS ===== */
button, .btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 143, 171, 0.35);
}

button:active { transform: translateY(0); }

button.danger {
  background: linear-gradient(135deg, #FF6B6B, #EE5A24);
}

button.danger:hover {
  box-shadow: 0 4px 16px rgba(238, 90, 36, 0.35);
}

button.small {
  padding: 5px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.83rem;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td { background: var(--pink-light); }

td a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 500;
}

td a:hover { text-decoration: underline; }

/* ===== AUTH BOX (LOGIN) ===== */
.auth-box {
  max-width: 380px;
  margin: 100px auto;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(255, 143, 171, 0.1);
  position: relative;
}

.auth-box .auth-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--pink-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.auth-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 8px;
}

.auth-box .auth-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.auth-box form input {
  width: 100%;
  max-width: none;
  margin-bottom: 14px;
  padding: 12px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.auth-box form button {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

.error {
  color: var(--rose);
  margin-top: 10px;
  font-size: 0.83rem;
  font-weight: 500;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab, .tabs a.tab {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tab.active, .tabs a.tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.tab:hover:not(.active) {
  border-color: var(--accent);
  color: var(--pink);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  font-size: 0.85rem;
  font-weight: 500;
}

.pagination a {
  color: var(--pink);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--pink-light);
  border-color: var(--accent);
}

/* ===== SEARCH FORM ===== */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-form input, .search-form select {
  max-width: 220px;
}

.search-form button {
  padding: 10px 24px;
}

/* ===== LOG CONTAINER (LIVE) ===== */
.log-container {
  max-height: 600px;
  overflow-y: auto;
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  background: #2D2040;
  border-radius: var(--radius);
  padding: 16px;
}

.log-entry {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  gap: 10px;
  color: #E8E0F0;
}

.log-entry:hover { background: rgba(255,255,255,0.03); }

.log-time { color: #8B7DA0; white-space: nowrap; }
.log-type { color: var(--accent); font-weight: 600; white-space: nowrap; }
.log-action { color: #A8E6CF; }
.log-target, .log-executor { color: #C8B6FF; }

.log-message .log-type { color: #82B1FF; }
.log-member .log-type { color: #C8B6FF; }
.log-channel .log-type { color: #FFB74D; }
.log-role .log-type { color: #FF8A65; }
.log-voice .log-type { color: #4DD0E1; }
.log-server .log-type { color: #F48FB1; }

.live-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

#connectBtn {
  border-radius: var(--radius-pill);
  padding: 8px 20px;
}

#connectBtn.connected {
  background: linear-gradient(135deg, #FF6B6B, #EE5A24);
}

/* ===== NAV BOTTOM ===== */
.nav-links-bottom {
  display: flex;
  gap: 10px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.nav-links-bottom a {
  color: var(--pink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.nav-links-bottom a:hover {
  background: var(--pink-light);
  border-color: var(--accent);
}

/* ===== DEV SECTION ===== */
.dev-section {
  margin-top: 40px;
  text-align: center;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 24px;
}

.dev-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.2s;
  list-style: none;
}

.dev-details summary::-webkit-details-marker { display: none; }

.dev-details summary:hover {
  color: var(--pink);
  border-color: var(--accent);
}

.dev-login-form {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.dev-login-form input { max-width: 220px; }

.dev-link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent-gradient);
  color: #fff;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.dev-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 143, 171, 0.3);
}

/* ===== ALERTS ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.85rem;
  font-weight: 500;
}

.alert.success {
  background: rgba(168, 230, 207, 0.15);
  border: 1px solid #A8E6CF;
  color: #2D9F6F;
}

.alert.error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid #FF6B6B;
  color: var(--rose);
}

/* ===== INLINE FORM ===== */
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form input { max-width: 200px; }

/* ===== EXPORT FORM ===== */
.export-form label {
  margin-bottom: 14px;
}

.export-form select, .export-form input {
  max-width: 300px;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px 0 32px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* ===== CARD DESIGN (rank) ===== */
.design-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .design-grid { grid-template-columns: 1fr; }
}

.design-section h4 {
  font-size: 0.9rem;
  color: var(--pink);
  margin-bottom: 14px;
  font-weight: 600;
}

.color-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.83rem;
}

.color-label span:first-child { flex: 1; }

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-wrap input[type="color"] {
  width: 34px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.color-value {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 72px;
}

.range-slider {
  width: 100%;
  max-width: 300px;
  margin-top: 6px;
  accent-color: var(--pink);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
