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

/* Tokyo Night color scheme - Dark theme (default) */
:root {
  /* Dark theme colors with Tokyo Night palette */
  --bg-color: #1a1b26;
  --bg-color-rgb: 26, 27, 38; /* RGB values for opacity */
  --card-bg: #1f2335;
  --text-color: #a9b1d6;
  --text-muted: #787c99;
  --accent-color: #7aa2f7;
  --accent-hover: #bb9af7;
  --border-color: #292e42;
  --code-bg: #24283b;
  --success-color: #9ece6a;
  --error-color: #f7768e;
}

/* Light theme colors with Tokyo Night Light palette */
.light-theme {
  --bg-color: #e1e2e7;
  --bg-color-rgb: 225, 226, 231; /* RGB values for opacity */
  --card-bg: #d5d6db;
  --text-color: #343b58;
  --text-muted: #565a6e;
  --accent-color: #2e7de9;
  --accent-hover: #9854f1;
  --border-color: #cbccd1;
  --code-bg: #d5d6db;
  --success-color: #587539;
  --error-color: #b2555e;
}

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

/* Add scroll padding to account for sticky header */
html {
  scroll-padding-top: 5rem; /* Default for desktop */
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s ease;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  font-family: 'IBM Plex Mono'
}

h1 {
  font-size: 2.75rem;
  background: linear-gradient(90deg, var(--accent-color), var(--success-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 1.8rem;
  color: var(--accent-color);
}

h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

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

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

/* Header */
.sticky-header {
  position: sticky;
  top: 0;
  background-color: rgba(var(--bg-color-rgb), 0.7); /* 0.9 opacity for blur effect */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  padding: 1rem 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

.logo {
  font-family: 'Fira Code', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.5px;
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

nav a {
  font-weight: 500;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.2s ease;
}

nav a:hover::after {
  width: 100%;
}

.github-link svg {
  fill: var(--text-color);
  transition: fill 0.2s ease, transform 0.2s ease;
}

.github-link:hover svg {
  fill: var(--accent-color);
  transform: scale(1.1);
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

#theme-toggle:hover {
  transform: rotate(15deg);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

/* Button */
button.primary {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button.secondary {
  background-color: var(--card-bg);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  margin-left:1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.primary:hover {
  background-color: var(--success-color);
}
.secondary:hover {
  background-color: var(--code-bg);
}

button:active {
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background-color: var(--success-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  font-weight:bold;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Sections */
section {
  margin-bottom: 4rem;
}

/* Feature list */
.why ul {
  list-style: none;
  margin-bottom: 2rem;
}

.why li {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  font-size: 1.05rem;
}

.why li::before {
  content: "→";
  color: var(--accent-color);
  font-weight: bold;
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

/* Code blocks */
pre {
  background-color: var(--code-bg);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  position: relative;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-color);
}

/* Usage section */
.usage ol, .usage ul {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.usage li {
  margin-bottom: 0.75rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

footer a {
  font-weight: 500;
}

/* View page specific */
#container {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
}

#loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50vh;
  font-size: 1.2rem;
}

#error {
  background-color: #cf6679;
  color: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  margin: 2rem auto;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  nav ul {
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav ul {
    justify-content: center;
  }
  
  html {
    scroll-padding-top: 8rem; 
  }
}
