/* =========================================================
   DevUtils Pro — Main CSS v3
   Clean Light Theme: white, black, standard grays
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:     #ffffff;
  --bg-surface:  #f6f8fa;
  --bg-elevated: #ffffff;
  --bg-hover:    #f3f4f6;
  --bg-active:   #eaeef2;

  /* Borders */
  --border:        #d0d7de;
  --border-subtle: #e8ecf0;
  --border-focus:  #0969da;

  /* Accent — standard blue */
  --accent:       #0969da;
  --accent-hover: #0550ae;
  --accent-dim:   rgba(9,105,218,0.08);

  /* Semantic */
  --green:      #1a7f37;
  --green-bg:   #dafbe1;
  --green-border: #82e9a1;
  --red:        #cf222e;
  --red-bg:     #ffebe9;
  --red-border: #ffcecb;
  --yellow:     #9a6700;
  --yellow-bg:  #fff8c5;
  --purple:     #8250df;
  --purple-bg:  #fbefff;
  --orange:     #bc4c00;

  /* Text */
  --text-1:    #1f2328;
  --text-2:    #656d76;
  --text-3:    #9ea7b3;
  --text-link: #0969da;
  --text-white: #ffffff;

  /* Sidebar */
  --sidebar-w:  248px;
  --sidebar-bg: #f6f8fa;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* Shadows */
  --shadow-xs: 0 1px 0 rgba(31,35,40,0.04);
  --shadow-sm: 0 1px 3px rgba(31,35,40,0.12), 0 1px 2px rgba(31,35,40,0.08);
  --shadow-md: 0 4px 12px rgba(31,35,40,0.12);
  --shadow-xl: 0 8px 32px rgba(31,35,40,0.15);

  /* Motion */
  --ease:    0.12s ease;
  --ease-md: 0.22s ease;

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

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Logo */
.sidebar-logo {
  padding: 0 12px;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: #1f2328;
  color: #fff;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: -1px;
  font-family: var(--font);
}

.logo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.2px;
}

.logo-text { line-height: 1.2; }

/* Navigation */
.sidebar-nav { padding: 10px 8px 20px; flex: 1; }

.nav-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 16px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  border: none;
  user-select: none;
  margin-bottom: 1px;
  background: transparent;
}

.nav-item:hover {
  color: var(--text-1);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--text-1);
  background: var(--bg-active);
  font-weight: 500;
}

.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.footer-badge {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-badge .dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  border-radius: 50%;
}

/* Mobile */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.hamburger:hover { background: var(--bg-hover); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-base);
}

/* Header */
.page-header {
  height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-base);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-icon { font-size: 18px; line-height: 1; }

.page-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-2);
  padding-left: 8px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text-2); font-weight: 500; }

/* Tool content */
.tool-content { padding: 24px 28px 64px; max-width: 960px; }

/* Tool sections */
.tool-section {
  display: none;
  animation: fadeIn 0.18s ease;
}

.tool-section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Welcome Screen ─────────────────────────────────────── */
.welcome-section { display: block; }

.welcome-hero { padding: 40px 0 32px; }

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 18px;
  background: var(--bg-surface);
}

.welcome-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
  color: var(--text-1);
  margin-bottom: 10px;
}

.welcome-title span { color: var(--accent); }

.welcome-desc {
  font-size: 14px;
  color: var(--text-2);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Stats bar */
.welcome-stats {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
  margin-bottom: 36px;
}

.stat-item {
  text-align: center;
  padding: 12px 24px;
  background: var(--bg-surface);
}

.stat-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.quick-card {
  background: var(--bg-base);
  padding: 16px;
  cursor: pointer;
  transition: background var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-card:hover { background: var(--bg-hover); }

.quick-card-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--bg-active);
  flex-shrink: 0;
}

.quick-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.quick-card-desc {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ─── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  max-width: 300px;
  background: var(--bg-base);
}

.toast.success { border-color: var(--green-border); color: var(--green); background: var(--green-bg); }
.toast.error   { border-color: var(--red-border); color: var(--red); background: var(--red-bg); }
.toast.info    { border-color: var(--border); color: var(--text-2); }
.toast.fade-out { animation: toastOut 0.18s ease forwards; }

@keyframes toastIn  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(4px); } }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--ease-md); }
  .sidebar.open { transform: none; }
  .sidebar-overlay.visible { display: block; }
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }
  .page-header { padding: 0 16px 0 56px; }
  .tool-content { padding: 16px 16px 48px; }
  .welcome-title { font-size: 22px; }
  .welcome-stats { width: 100%; }
  .stat-item { flex: 1; padding: 10px 12px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .quick-grid { grid-template-columns: 1fr; }
  .page-subtitle { display: none; }
}
