/* CSS Custom Properties for theming */
:root {
  /* Light theme colors */
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #888888;
  --border-color: #e0e0e0;
  --border-light: #f0f0f0;
  --accent-color: #0066cc;
  --accent-hover: #0052a3;
  --code-bg: #f8f8f8;
  --code-border: #e0e0e0;
  --hero-bg: #fafafa;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-color: #0f1419;
  --text-color: #e6e6e6;
  --text-secondary: #b3b3b3;
  --text-muted: #999999;
  --border-color: #2d3748;
  --border-light: #1a202c;
  --accent-color: #4da6ff;
  --accent-hover: #66b3ff;
  --code-bg: #1a202c;
  --code-border: #2d3748;
  --hero-bg: #1a202c;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.25rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.theme-toggle:hover {
  border-color: var(--accent-color);
  transform: scale(1.05);
}

/* Main content */
.main {
  padding-top: 2rem;
}

.section {
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

/* Hero section */
.hero {
  text-align: center;
  padding: 3rem 0 4rem;
  background-color: var(--hero-bg);
  border-radius: 1rem;
  margin-bottom: 4rem;
  transition: background-color 0.3s ease;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  transition: transform 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
}

.badge img {
  height: 1.25rem;
  border-radius: 0.25rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-description code {
  background-color: #2a2a2a;
  color: #e6e6e6;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  font-family: 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: 0.875em;
  border: 1px solid #404040;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dark theme hero description code */
[data-theme="dark"] .hero-description code {
  background-color: #21262d;
  color: #f0f6fc;
  border: 1px solid #30363d;
}

.hero-description a {
  color: var(--accent-color);
  text-decoration: none;
}

.hero-description a:hover {
  text-decoration: underline;
}

/* Code blocks - MacOS Terminal style */
.code-block {
  background-color: #2a2a2a;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.code-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.code-block::before {
  content: "";
  display: block;
  background: linear-gradient(135deg, #3c3c3c 0%, #333333 100%);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #555;
  position: relative;
  height: 2.5rem;
  box-sizing: border-box;
}

.code-block::after {
  content: "";
  position: absolute;
  top: 0.875rem;
  left: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 
    20px 0 0 #ffbd2e,
    40px 0 0 #28ca42;
  z-index: 1;
}

.code-block pre {
  padding: 1.5rem;
  margin: 0;
  background: #2a2a2a;
  font-family: 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e6e6e6;
  white-space: pre;
  overflow-x: auto;
}

.code-block code {
  color: #e6e6e6 !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: inherit !important;
}

/* Dark theme adjustments for terminal */
[data-theme="dark"] .code-block {
  background-color: #161b22;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .code-block::before {
  background: linear-gradient(135deg, #21262d 0%, #1c2128 100%);
  border-bottom: 1px solid #30363d;
}

[data-theme="dark"] .code-block pre {
  background: #161b22;
  color: #f0f6fc;
}

[data-theme="dark"] .code-block code {
  color: #f0f6fc !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Images */
.image-container {
  margin: 2rem 0;
  text-align: center;
}

.screenshot {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

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

/* Text elements */
p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-color);
}

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

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

/* Inline code - but not in code blocks */
p code,
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code,
li code,
.hero-description code {
  background-color: #2a2a2a;
  color: #e6e6e6;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  font-family: 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: 0.875em;
  border: 1px solid #404040;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dark theme inline code */
[data-theme="dark"] p code,
[data-theme="dark"] h1 code,
[data-theme="dark"] h2 code,
[data-theme="dark"] h3 code,
[data-theme="dark"] h4 code,
[data-theme="dark"] h5 code,
[data-theme="dark"] h6 code,
[data-theme="dark"] li code {
  background-color: #21262d;
  color: #f0f6fc;
  border: 1px solid #30363d;
}

strong {
  font-weight: 600;
  color: var(--text-color);
}

/* Footer */
.footer {
  background-color: var(--hero-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-content {
  text-align: center;
}

.footer-content p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .nav {
    gap: 1rem;
  }

  .hero {
    padding: 2rem 1rem 3rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .badges {
    flex-direction: column;
    align-items: center;
  }

  .code-block pre {
    padding: 0.75rem;
    font-size: 0.75rem;
  }

  .code-block::before {
    padding: 0.5rem 0.75rem;
    height: 2rem;
  }

  .code-block::after {
    width: 8px;
    height: 8px;
    top: 0.625rem;
    left: 0.75rem;
    box-shadow: 
      14px 0 0 #ffbd2e,
      28px 0 0 #28ca42;
  }

  .image-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Focus styles for accessibility */
.theme-toggle:focus,
.nav-link:focus,
a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Improve code readability */
.code-block {
  position: relative;
}

.code-block pre::-webkit-scrollbar {
  height: 8px;
}

.code-block pre::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Tablet-specific responsive design */
@media (max-width: 1024px) {
  .badges {
    flex-direction: column;
    align-items: center;
  }

  .code-block pre {
    padding: 1rem;
    font-size: 0.8rem;
  }

  .code-block::before {
    padding: 0.6rem 1rem;
    height: 2.2rem;
  }

  .code-block::after {
    width: 10px;
    height: 10px;
    top: 0.75rem;
    box-shadow: 
      16px 0 0 #ffbd2e,
      32px 0 0 #28ca42;
  }
}