/* ============================================================
   DCBot Panel - Premium Dark Theme Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Discord-inspired color palette */
  --bg-primary:    #0d0f17;
  --bg-secondary:  #13151f;
  --bg-card:       #1a1d2e;
  --bg-hover:      #1e2133;
  --bg-input:      #0f111a;
  --border:        #2a2d3e;
  --border-light:  #353851;

  --text-primary:  #e8eaf6;
  --text-secondary:#8b90b0;
  --text-muted:    #5c6080;

  --accent:        #5865f2;
  --accent-hover:  #4752c4;
  --accent-glow:   rgba(88,101,242,0.3);

  --success:       #23d160;
  --success-bg:    rgba(35,209,96,0.12);
  --warning:       #f39c12;
  --warning-bg:    rgba(243,156,18,0.12);
  --danger:        #e74c3c;
  --danger-bg:     rgba(231,76,60,0.12);
  --info:          #3498db;
  --info-bg:       rgba(52,152,219,0.12);

  --gold:          #f1c40f;
  --purple:        #9b59b6;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow:    0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --sidebar-w: 240px;
  --topbar-h:  64px;

  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-brand .logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand span {
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section-label {
  padding: 12px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(88,101,242,0.2), rgba(155,89,182,0.15));
  color: var(--accent);
  border: 1px solid rgba(88,101,242,0.25);
}

.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg-hover);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  color: var(--text-muted);
  font-size: 16px;
  text-decoration: none;
  transition: var(--transition);
}
.logout-btn:hover { color: var(--danger); }

/* ---- Main ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 28px; flex: 1; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.accent::before { background: linear-gradient(90deg, var(--accent), var(--purple)); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }

.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.accent { background: linear-gradient(135deg, rgba(88,101,242,0.2), rgba(155,89,182,0.2)); }
.stat-icon.success { background: var(--success-bg); }
.stat-icon.warning { background: var(--warning-bg); }
.stat-icon.danger  { background: var(--danger-bg); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(88,101,242,0.35);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(88,101,242,0.45); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--border); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 10px; }

.btn-gradient {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  box-shadow: 0 4px 20px rgba(88,101,242,0.4);
}
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(88,101,242,0.5); }

/* Forms */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-card); }

textarea.form-control { resize: vertical; min-height: 100px; }

/* Alerts/Flash */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid;
}

.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 13px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-primary  { background: linear-gradient(135deg, rgba(88,101,242,0.2), rgba(155,89,182,0.2)); color: var(--accent); }
.badge-gold     { background: rgba(241,196,15,0.15); color: var(--gold); }
.badge-muted    { background: var(--bg-hover); color: var(--text-muted); }

/* PRO / LITE badges */
.tier-badge {
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.tier-free  { background: var(--bg-hover); color: var(--text-muted); }
.tier-lite  { background: var(--info-bg);  color: var(--info); }
.tier-pro   { background: linear-gradient(135deg,#f1c40f20,#f39c1220); color: var(--gold); border: 1px solid rgba(241,196,15,0.3); }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.text-center { text-align: center; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(88,101,242,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(155,89,182,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(88,101,242,0.4);
}

.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.auth-logo p  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   BOT CARDS
   ============================================================ */

.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.bot-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}

.bot-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(88,101,242,0.2);
}

.bot-avatar {
  width: 60px; height: 60px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(88,101,242,0.3);
}

.bot-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.bot-desc { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.bot-actions { display: flex; gap: 8px; margin-top: 16px; }

/* Feature list */
.feature-list { list-style: none; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li.available { color: var(--text-primary); }
.feature-list .check { color: var(--success); }
.feature-list .lock  { color: var(--text-muted); }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
}

.pricing-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 40px rgba(88,101,242,0.2);
}

.pricing-card.popular::before {
  content: 'POPÜLER';
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.1em;
}

.pricing-tier { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.pricing-price { font-size: 48px; font-weight: 800; color: var(--text-primary); line-height: 1; margin: 12px 0 4px; }
.pricing-price sup { font-size: 20px; vertical-align: top; margin-top: 10px; }
.pricing-period { font-size: 13px; color: var(--text-muted); }
.pricing-features { list-style: none; margin: 20px 0; text-align: left; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-secondary); display: flex; gap: 8px; }
.pricing-features li:last-child { border-bottom: none; }

/* Tickets */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }

.ticket-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: var(--transition);
}

.ticket-item:hover { border-color: var(--accent); background: var(--bg-hover); }

.ticket-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Chat bubbles */
.message-thread { display: flex; flex-direction: column; gap: 12px; }

.message-bubble {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  max-width: 80%;
}

.message-bubble.staff {
  background: linear-gradient(135deg, rgba(88,101,242,0.15), rgba(155,89,182,0.1));
  border-color: rgba(88,101,242,0.25);
  margin-left: auto;
}

.message-sender { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.message-sender.staff { color: var(--accent); }
.message-text { font-size: 14px; color: var(--text-primary); line-height: 1.6; }
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-align: right; }

/* Log table colors */
.log-info    { color: var(--info); }
.log-warning { color: var(--warning); }
.log-error   { color: var(--danger); }
.log-action  { color: var(--success); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .pricing-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.4s ease both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.10s; }
.fade-in-3 { animation-delay: 0.15s; }
.fade-in-4 { animation-delay: 0.20s; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(88,101,242,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(88,101,242,0); }
}

.pulse { animation: pulse 2s infinite; }

/* Online dot */
.dot-online {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 6px var(--success);
}
