/* ============================================================
   MCPE Addons — Dashboard Design System
   ============================================================ */

/* ---- Color Tokens ---- */
:root {
  /* Backgrounds */
  --bg-base:            #0f0f1a;
  --bg-surface:         #1a1a2e;
  --bg-surface-elevated:#16213e;
  --bg-surface-overlay: #1f2b47;
  --bg-input:           #12122a;

  /* Accents */
  --accent:             #00e5ff;
  --accent-dim:         rgba(0, 229, 255, 0.4);
  --accent-glow:        rgba(0, 229, 255, 0.15);
  --accent-secondary:   #7c4dff;

  /* Semantic */
  --success:            #00e676;
  --warning:            #ffab00;
  --error:              #ff1744;
  --coin:               #FFD700;

  /* Text */
  --text-primary:       #ffffff;
  --text-secondary:     #8892b0;
  --text-tertiary:      #5a6178;
  --text-on-accent:     #0f0f1a;

  /* Borders */
  --border:             #2a2f4a;
  --border-active:      #00e5ff;
  --border-subtle:      rgba(255, 255, 255, 0.06);

  /* ---- Spacing ---- */
  --space-xxs:  4px;
  --space-xs:   8px;
  --space-sm:   12px;
  --space-md:   16px;
  --space-lg:   20px;
  --space-xl:   24px;
  --space-xxl:  32px;
  --space-xxxl: 48px;

  /* ---- Radius ---- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* ---- Typography ---- */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', monospace;

  --text-display:  1.75rem;   /* 28px */
  --text-heading:  1.25rem;   /* 20px */
  --text-subhead:  1.0625rem; /* 17px */
  --text-body:     0.875rem;  /* 14px */
  --text-label:    0.75rem;   /* 12px */
  --text-caption:  0.6875rem; /* 11px */

  /* ---- Shadows ---- */
  --shadow-card:     0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-glow:     0 0 12px rgba(0, 229, 255, 0.3);
  --shadow-coin:     0 0 8px rgba(255, 215, 0, 0.4);

  /* ---- Transitions ---- */
  --transition-quick:    0.15s ease-in-out;
  --transition-standard: 0.25s ease-in-out;
  --transition-smooth:   0.35s ease-in-out;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--text-body);
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition-quick);
}
a:hover { opacity: 0.8; }

/* ---- Utility Classes ---- */

/* Text */
.text-display   { font-size: var(--text-display); font-weight: 800; }
.text-heading   { font-size: var(--text-heading); font-weight: 700; }
.text-subhead   { font-size: var(--text-subhead); font-weight: 600; }
.text-body      { font-size: var(--text-body); }
.text-label     { font-size: var(--text-label); font-weight: 600; }
.text-caption   { font-size: var(--text-caption); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-accent    { color: var(--accent); }
.text-coin      { color: var(--coin); }
.text-success   { color: var(--success); }
.text-error     { color: var(--error); }

/* Layout */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-xs        { gap: var(--space-xs); }
.gap-sm        { gap: var(--space-sm); }
.gap-md        { gap: var(--space-md); }
.gap-lg        { gap: var(--space-lg); }
.gap-xl        { gap: var(--space-xl); }

/* ---- Component Styles ---- */

/* Card */
.ds-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--transition-standard),
              box-shadow var(--transition-standard);
}
.ds-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
}

/* Surface */
.ds-surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* Input */
.ds-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--text-body);
  padding: var(--space-xs) var(--space-sm);
  outline: none;
  transition: border-color var(--transition-quick);
  width: 100%;
}
.ds-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.ds-input::placeholder {
  color: var(--text-tertiary);
}

/* Button — Primary */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 40px;
  padding: 0 var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-quick);
}
.ds-btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}
.ds-btn-primary:hover {
  box-shadow: var(--shadow-glow);
  filter: brightness(1.1);
}
.ds-btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.ds-btn-outline:hover {
  background: var(--accent-glow);
}
.ds-btn-danger {
  background: var(--error);
  color: white;
}
.ds-btn-danger:hover {
  filter: brightness(1.15);
}
.ds-btn-sm {
  height: 32px;
  padding: 0 var(--space-sm);
  font-size: var(--text-caption);
}

/* Badge */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
}
.ds-badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}
.ds-badge-coin {
  background: rgba(255, 215, 0, 0.15);
  color: var(--coin);
  border: 1px solid rgba(255, 215, 0, 0.3);
}
.ds-badge-locked {
  background: rgba(255, 215, 0, 0.1);
  color: var(--coin);
}
.ds-badge-success {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

/* Table */
.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.ds-table th {
  text-align: left;
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ds-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.ds-table tr:hover td {
  background: var(--bg-surface-overlay);
}

/* Sidebar Navigation */
.ds-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-body);
  font-weight: 500;
  transition: all var(--transition-quick);
  cursor: pointer;
}
.ds-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface-overlay);
}
.ds-nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Stat Card */
.ds-stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.ds-stat-card .stat-value {
  font-size: var(--text-display);
  font-weight: 800;
  color: var(--accent);
}
.ds-stat-card .stat-label {
  font-size: var(--text-label);
  color: var(--text-secondary);
  margin-top: var(--space-xxs);
}

/* Thumbnail */
.ds-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}
.ds-thumb-lg {
  width: 80px;
  height: 48px;
}

/* Modal */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.ds-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-elevated);
}

/* Toast / Alert */
.ds-alert {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-body);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.ds-alert-success {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--success);
}
.ds-alert-error {
  background: rgba(255, 23, 68, 0.1);
  border: 1px solid rgba(255, 23, 68, 0.3);
  color: var(--error);
}

/* ---- Dashboard Layout ---- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.dashboard-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) var(--space-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.dashboard-main {
  padding: var(--space-xl) var(--space-xxl);
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xxl);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    display: none;
  }
  .dashboard-main {
    padding: var(--space-md);
  }
}
