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

/* =============================================================================
   CSS VARIABLES - LIGHT THEME (default)
   ============================================================================= */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #eef0f4;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f5;
  --bg-sidebar: #f8f9fb;
  --bg-code: #f0f2f5;
  --bg-code-block: #f6f8fa;

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #7a7a8a;
  --text-inverse: #ffffff;

  --border-color: #e2e4e9;
  --border-light: #eef0f4;

  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #dbeafe;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --header-height: 64px;
  --sidebar-width: 280px;
}

/* =============================================================================
   DARK THEME
   ============================================================================= */
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #050505;
  --bg-tertiary: #0a0a0a;
  --bg-card: #080808;
  --bg-hover: #111111;
  --bg-sidebar: #000000;
  --bg-code: #000000;
  --bg-code-block: #050505;

  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --text-inverse: #000000;

  --border-color: #1a1a1a;
  --border-light: #111111;

  --accent-blue: #2563eb;
  --accent-blue-hover: #3b82f6;
  --accent-blue-light: rgba(37, 99, 235, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 1);
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
}

#bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

body>*:not(#bg-particles) {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-blue-hover);
}

/* =============================================================================
   THEME TOGGLE
   ============================================================================= */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1001;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* =============================================================================
   CARDS
   ============================================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* =============================================================================
   CODE BLOCKS (highlight.js)
   ============================================================================= */
pre {
  background: var(--bg-code-block) !important;
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}

:not(pre)>code {
  background: var(--bg-tertiary);
  color: var(--accent-blue);
  padding: 2px 8px;
  border-radius: 4px;
}

.hljs {
  background: transparent !important;
}

/* =============================================================================
   SCROLLBAR
   ============================================================================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =============================================================================
   MOBILE RESPONSIVE (max-width: 768px)
   ============================================================================= */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100vw;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .card {
    padding: 16px;
  }
}