:root {
  /* Color Scheme */
  --primary-bg: #0f172a;
  --secondary-bg: #1e293b;
  --accent-color: #3b82f6;
  --highlight-color: #60a5fa;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --font-size-base: 16px;
  --line-height: 1.6;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Borders */
  --border-radius: 0.5rem;
  --border-width: 1px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-color);
  background-color: var(--primary-bg);
  min-height: 100vh;
  display: flex;
  padding: 5px;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: var(--space-md);
  color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--highlight-color);
  text-decoration: underline;
}

code {
 /* font-family: var(--font-mono);*/
  background-color: rgba(59, 130, 246, 0.15);
  padding: 0.2em 0.4em;
  border-radius: var(--border-radius);
  font-size: 0.9em;
}

pre {
  background-color: #1e1e1e;
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
  box-shadow: var(--shadow-md);
}

pre code {
  background-color: transparent;
  padding: 0;
  text-wrap: wrap;
}

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

#header {
  width: 280px;
  background-color: var(--secondary-bg);
  padding: var(--space-lg);
  position: fixed;
  overflow-y: auto;
  border-right: var(--border-width) solid var(--border-color);
  transition: transform var(--transition-normal);
  z-index: 100;
}

#contents {
  flex: 1;
  margin-left: 280px;
  padding: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Navigation */
#drop {
  margin-bottom: var(--space-xl);
}

.menu {
  display: none;
  cursor: pointer;
  margin-bottom: var(--space-md);
}

.bar1, .bar2, .bar3 {
  width: 25px;
  height: 2px;
  background-color: var(--text-color);
  margin: 6px 0;
  transition: var(--transition-normal);
}

#down {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

#down p {
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--accent-color);
}

#down a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  color: var(--text-muted);
}

#down a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  text-decoration: none;
}

#down a i {
  width: 20px;
  text-align: center;
}

.logo {
  width: 100%;
  max-width: 150px;
  margin-bottom: var(--space-lg);
  display: block;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 0.5rem;
  background-color: var(--accent-color);
  color: white;
  vertical-align: middle;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--primary-bg);
  border: none;
  color: var(--text-color);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  opacity: 0;
}

pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background-color: var(--accent-color);
  color: white;
}

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

.btn.primary:hover {
  background-color: var(--highlight-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn.next {
  background-color: var(--secondary-bg);
  color: var(--text-color);
  padding: 0.75rem 1.5rem;
}

.btn.next:hover {
  background-color: #334155;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  color: var(--text-color);
  transition: all var(--transition-fast);
}

article {
  width: 100%;
  overflow: hidden;
  margin-bottom: 2rem;
  background-color: var(--primary-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.button:hover {
  background-color: #334155;
  text-decoration: none;
  transform: translateY(-2px);
}

/* Feature Cards */
.feature-card {
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: var(--border-width) solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.feature-card h3 {
  color: var(--accent-color);
  margin-bottom: var(--space-sm);
}

.feature-card i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: var(--space-sm);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* Tables */
table {
  width: 100vw;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  padding: 0;
  white-space: pre-wrap;
  border-bottom: var(--border-width) solid var(--border-color);
}

th {
  background-color: rgba(59, 130, 246, 0.2);
  font-weight: 600;
  padding: 10px;
  color: var(--accent-color);
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--secondary-bg);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-family: var(--font-main);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: var(--border-width) solid var(--border-color);
  margin-bottom: var(--space-md);
}

.tab {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.tab:hover {
  color: var(--accent-color);
}

.tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Footer */
#footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: var(--border-width) solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--secondary-bg);
  color: var(--text-color);
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* Syntax Highlighting Overrides */
.hljs {
  background: #1e1e1e;
  color: #d4d4d4;
}

.hljs-keyword,
.hljs-literal,
.hljs-name,
.hljs-selector-tag,
.hljs-strong {
  color: #569cd6;
}

.hljs-code {
  color: #66d9ef;
}

.hljs-attribute,
.hljs-link,
.hljs-regexp,
.hljs-symbol {
  color: #bf79db;
}

.hljs-addition,
.hljs-built_in,
.hljs-bullet,
.hljs-emphasis,
.hljs-section,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-string,
.hljs-template-tag,
.hljs-template-variable,
.hljs-title,
.hljs-type,
.hljs-variable {
  color: #ce9178;
}

.hljs-comment,
.hljs-deletion,
.hljs-meta,
.hljs-quote {
  color: #6a9955;
}

.hljs-doctag,
.hljs-keyword,
.hljs-literal,
.hljs-section,
.hljs-selector-id,
.hljs-title,
.hljs-type {
  font-weight: normal;
}

.hljs-number {
  color: #b5cea8;
}

.hljs-tag {
  color: #808080;
}

.logo{
  width: 50px;
  height: 50px;
  aspect-ratio: 1;
  border-radius: 4px;
}

/* scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--highlight-color);
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Mobile First Approach */

/* Base mobile styles */
@media (max-width: 768px) {
  /* Layout adjustments */
  #app {
    flex-direction: column;
    min-height: 100vh;
  }

  #header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 1rem;
    height: auto;
    align-items: center;
    display: flex;
    border-right: none;
    border-bottom: var(--border-width) solid var(--border-color);
  }

  #contents {
    margin-left: 0;
    margin-top: 80px; /* Account for fixed header */
    padding: 1rem;
    width: 100%;
  }

  /* Navigation */
  .menu {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
  }

  #down {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    padding: 2rem;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }

  #down.change {
    display: flex;
    flex-direction: column;
  }

  #down a {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .logo {
    width: 40px;
    height: 40px;
    margin: 0;
  }

  /* Hero section */
  .hero {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
  }

  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Features grid */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .feature-card i {
    font-size: 2rem;
  }

  /* Code blocks */
  pre {
    margin: 1rem 0;
    padding: 1rem;
    overflow-x: auto;
  }

  pre code {
    font-size: 0.9em;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Tabs */
  .tabs {
    flex-wrap: wrap;
  }

  .tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 0.75rem;
  }

  /* Typography */
  h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  /* Navigation buttons */
  .nav-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Copy button */
  .copy-btn {
    opacity: 1;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Forms */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.75rem;
  }

  /* Social links */
  .social-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .social-links a {
    width: 35px;
    height: 35px;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  #header {
    width: 250px;
  }

  #contents {
    margin-left: 250px;
    padding: 1.5rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-buttons {
    flex-wrap: wrap;
  }

  .hero-buttons .btn {
    flex: 1;
    min-width: 200px;
  }
}

/* Large desktop styles */
@media (min-width: 1025px) {
  #header {
    width: 280px;
  }

  #contents {
    margin-left: 280px;
    padding: 2rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
  }
}

/* Extra large screens */
@media (min-width: 1440px) {
  #contents {
    max-width: 1200px;
    margin: 0 auto 0 280px;
  }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE DESIGN ===== */
.hidden-mobile {
  display: none;
}

.visible-mobile {
  display: block;
}

@media (min-width: 769px) {
  .hidden-mobile {
    display: block;
  }
  
  .visible-mobile {
    display: none;
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  .copy-btn {
    opacity: 1;
  }

  .feature-card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  /* Increase touch target sizes */
  a, button, .btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== DARK/LIGHT MODE SUPPORT ===== */
@media (prefers-color-scheme: light) {
  :root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #2563eb;
    --highlight-color: #3b82f6;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  #header {
    display: none;
  }

  #contents {
    margin-left: 0;
    padding: 0;
  }

  .hero-buttons,
  .copy-btn,
  .social-links,
  .menu {
    display: none;
  }

  body {
    background: white !important;
    color: black !important;
  }

  pre {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
  }

  code {
    background: #f5f5f5 !important;
    color: #333 !important;
  }

  a {
    color: #0000ee !important;
    text-decoration: underline !important;
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== ORIENTATION SPECIFIC ===== */
@media (orientation: landscape) and (max-width: 768px) {
  #header {
    height: 60px;
  }

  #down {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .hero {
    padding: 1rem;
  }
}

/* ===== SAFARI SPECIFIC FIXES ===== */
@supports (-webkit-touch-callout: none) {
  /* Safari specific CSS */
  .hero {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

/* ===== FIREFOX SCROLLBAR ===== */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) rgba(0, 0, 0, 0.1);
}

/* ===== SMOOTH SCROLLING FOR MOBILE ===== */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 80px; /* Account for fixed header */
  }
}

/* ===== IMPROVED FOCUS STATES FOR ACCESSIBILITY ===== */
@media (max-width: 768px) {
  a:focus,
  button:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
  }
}

/* ===== LOADING OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .lazy-load.loaded {
    opacity: 1;
  }
}