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

/* CSS Variables - Matching Extension Design */
:root,
:root[data-theme="light"] {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--background);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
  background: var(--surface-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.theme-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.theme-toggle svg {
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  margin-bottom: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-content {
  text-align: center;
  margin-bottom: 16px;
}

.logo {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

.last-updated {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Navigation */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.nav-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-list a:hover {
  color: var(--primary-color);
  background: var(--surface-light);
}

@media (max-width: 768px) {
  .nav-list {
    gap: 16px;
  }
  
  .nav-list a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* Main Content */
.main {
  padding: 48px 0 80px;
}

.section {
  margin-bottom: 64px;
}

.section:last-child {
  margin-bottom: 0;
}

.section h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-color);
}

.section h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  margin-top: 32px;
}

.section h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  margin-top: 20px;
}

/* Intro Text */
.intro-text {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

/* Highlight Box */
.highlight-box {
  background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
  color: white;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.highlight-box h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 24px;
}

.highlight-box p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 17px;
  margin: 0;
}

/* Content Block */
.content-block {
  background: var(--surface);
  padding: 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.content-block:hover {
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--primary-color);
}

.content-block p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.content-block p:last-child {
  margin-bottom: 0;
}

/* Lists */
.feature-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.feature-list li {
  padding: 10px 0 10px 32px;
  position: relative;
  line-height: 1.6;
}

.feature-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
  font-size: 18px;
}

.link-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

.link-list li {
  padding: 8px 0;
}

/* Permission Items */
.permission-item {
  background: var(--surface-light);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 3px solid var(--primary-color);
}

.permission-item h4 {
  margin-top: 0;
  color: var(--primary-color);
}

.permission-item ul {
  margin-left: 20px;
  margin-top: 12px;
}

.permission-item li {
  margin-bottom: 8px;
}

/* Note Box */
.note {
  background: var(--surface-light);
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 3px solid var(--warning);
  margin: 16px 0;
  font-size: 15px;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Contact Section */
.contact-info {
  background: var(--surface-light);
  padding: 24px;
  border-radius: 8px;
  margin-top: 20px;
}

.contact-info p {
  margin-bottom: 12px;
  font-size: 16px;
}

.contact-info p:last-child {
  margin-bottom: 0;
}

/* Attribution */
.attribution {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 40px;
}

.small-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  transition: all 0.3s ease;
}

.footer p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
}

.footer-links span {
  color: var(--text-secondary);
}

/* Responsive Typography */
@media (max-width: 768px) {
  .logo {
    font-size: 28px;
  }
  
  .tagline {
    font-size: 16px;
  }
  
  .section h2 {
    font-size: 26px;
  }
  
  .section h3 {
    font-size: 20px;
  }
  
  .section h4 {
    font-size: 17px;
  }
  
  .intro-text {
    font-size: 16px;
  }
  
  .highlight-box {
    padding: 24px;
  }
  
  .highlight-box h3 {
    font-size: 20px;
  }
  
  .content-block {
    padding: 20px;
  }
  
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

/* Print Styles */
@media print {
  .theme-toggle,
  .nav {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--primary-color);
  color: white;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeIn 0.6s ease-out;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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