/* CSS Variables for Theme System */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0f1115;
  --bg-secondary: #161a21;
  --bg-tertiary: #1e2329;
  --text-primary: #e8ecf3;
  --text-secondary: #8b93a7;
  --text-muted: #5a697f;
  --accent: #c8ff2e;
  --accent-hover: #b8e62a;
  --link: #8fd3ff;
  --link-hover: #6bb8ff;
  --border: #242b37;
  --border-light: #2a3441;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --success: #9cff57;
  --warning: #ffd166;
  --error: #ff6b6b;
  --info: #74c0fc;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* Transitions */
  --transition: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0a0e13;
  --text-secondary: #4a5b6e;
  --text-muted: #64748b;
  --accent: #5a7d00;
  --accent-hover: #4a6b00;
  --link: #0ea5e9;
  --link-hover: #0284c7;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

/* System Theme Detection */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0a0e13;
    --text-secondary: #4a5b6e;
    --text-muted: #64748b;
    --accent: #5a7d00;
    --accent-hover: #4a6b00;
    --link: #0ea5e9;
    --link-hover: #0284c7;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
  }
}

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

html {
  scroll-behavior: smooth;
}

/* Prevent flash of unstyled content - default to light theme */
html:not([data-theme]) {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0a0e13;
  --text-secondary: #4a5b6e;
  --text-muted: #64748b;
  --accent: #5a7d00;
  --accent-hover: #4a6b00;
  --link: #0ea5e9;
  --link-hover: #0284c7;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition);
  overflow-x: hidden;
}

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

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

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

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

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

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

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
  justify-content: flex-end;
}

.logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-size-xl);
  color: var(--bg-primary);
  box-shadow: var(--shadow);
}

.brand-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
}


/* iOS 26 Style Controls */
.ios-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.ios-switch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ios-switch {
  position: relative;
  display: inline-block;
  margin: 0 5px;
}

.ios-switch > .ios-switch-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
  line-height: 1;
  color: var(--text-primary);
}

/* Language Button */
.language-button {
  width: 51px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.language-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.language-button:hover::before {
  left: 100%;
}

.language-button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-button:active {
  transform: scale(0.95);
}

.ios-toggle {
  position: absolute;
  margin-left: -9999px;
  visibility: hidden;
}

.ios-toggle + label {
  display: block;
  position: relative;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-toggle + label {
  padding: 2px;
  width: 51px;
  height: 32px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--border));
  border-radius: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
}

.ios-toggle + label:before {
  content: "";
  display: block;
  position: absolute;
  top: 2px;
  left: 2px;
  bottom: 2px;
  right: 2px;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-toggle + label:after {
  content: "";
  display: block;
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: 26px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-radius: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3;
}

.ios-toggle:checked + label {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ios-toggle:checked + label:before {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.ios-toggle:checked + label:after {
  margin-left: 18px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.ios-toggle:checked + label .ios-switch-label {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hover effects */
.ios-switch:hover .ios-toggle + label {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ios-switch:hover .ios-toggle:checked + label {
  box-shadow: 0 4px 12px rgba(var(--accent-rgb, 90, 125, 0), 0.3);
}

/* Focus states for accessibility */
.ios-toggle:focus + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Search Results Styles */
.search-results {
  padding: var(--space-lg);
  max-width: 800px;
  margin: 0 auto;
}

.search-results-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.search-query {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}

.no-results {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  text-align: center;
  padding: var(--space-xl);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.search-result-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.search-result-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.search-result-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.search-result-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.search-result-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.search-result-content {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.search-container {
  position: relative;
  min-width: 400px;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.1);
}

.search-clear {
  display: none;
}

.search-clear:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.control-label {
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-select {
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: var(--transition);
}

.control-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

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

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

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

.btn-secondary {
  background-color: transparent;
  border-color: var(--border);
}

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

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-2xl);
  min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(80px + var(--space-xl));
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all 0.3s ease;
}


.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.sidebar-header h2 {
  font-size: var(--font-size-lg);
  margin: 0;
  color: var(--text-primary);
}

.sidebar-toggle {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  background-color: var(--text-secondary);
  transition: var(--transition);
}

.toc-filter {
  margin-bottom: var(--space-md);
}

.toc-filter input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: var(--transition);
}

.toc-filter input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.1);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin-bottom: var(--space-xs);
}

.toc-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-size: var(--font-size-sm);
}

.toc-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.toc-link.active {
  background-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 500;
}

.toc-sublist {
  margin-left: var(--space-md);
  margin-top: var(--space-xs);
}

/* Main Content */
.main {
  min-width: 0;
}

.content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* Sections */
.section {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  transition: var(--transition);
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.section-summary {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Cards */
.card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.card-content {
  color: var(--text-secondary);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Steps */
.steps {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 0;
}

.step {
  counter-increment: step-counter;
  position: relative;
  margin-bottom: var(--space-lg);
  padding-left: 3rem;
}

.step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background-color: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.step-title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.step-content {
  color: var(--text-secondary);
}

/* Lists */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.checklist-item::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 600;
}

/* Notes */
.note {
  border-left: 4px solid var(--accent);
  background-color: var(--bg-tertiary);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.note--success {
  border-left-color: var(--success);
  background-color: rgba(156, 255, 87, 0.1);
}

.note--warning {
  border-left-color: var(--warning);
  background-color: rgba(255, 209, 102, 0.1);
}

.note--error {
  border-left-color: var(--error);
  background-color: rgba(255, 107, 107, 0.1);
}

.note--info {
  border-left-color: var(--info);
  background-color: rgba(116, 192, 252, 0.1);
}

.note-title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.note-content {
  color: var(--text-secondary);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th,
.table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.table td {
  color: var(--text-secondary);
}

.table tr:last-child td {
  border-bottom: none;
}

/* Screenshots Gallery */
.screenshots {
  margin: var(--space-lg) 0;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.screenshot-item {
  position: relative;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.screenshot-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.screenshot-image {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

.screenshot-caption {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  background-color: var(--bg-secondary);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  margin-top: var(--space-md);
  color: white;
  text-align: center;
  font-size: var(--font-size-sm);
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.lightbox-prev {
  left: -4rem;
}

.lightbox-next {
  right: -4rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Back to Top Button */
/* .back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  background-color: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 50%;
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  box-shadow: var(--shadow);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
} */

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: var(--transition-slow);
}

.loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: var(--text-secondary);
  margin: 0;
}

/* Search Results */
.search-results {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.search-results h2 {
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.search-result-item {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  transition: var(--transition);
  cursor: pointer;
}

.search-result-item:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent);
}

.search-result-title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.search-result-snippet {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.search-highlight {
  background-color: var(--accent);
  color: var(--bg-primary);
  padding: 0 var(--space-xs);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* Role Badges */
.role {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 500;
  margin-right: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.role--owner {
  background-color: rgba(156, 255, 87, 0.2);
  color: var(--success);
  border: 1px solid rgba(156, 255, 87, 0.3);
}

.role--staff {
  background-color: rgba(116, 192, 252, 0.2);
  color: var(--info);
  border: 1px solid rgba(116, 192, 252, 0.3);
}

.role--client {
  background-color: rgba(255, 209, 102, 0.2);
  color: var(--warning);
  border: 1px solid rgba(255, 209, 102, 0.3);
}

/* Keyboard Shortcuts */
.kbd {
  font-family: ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Mobile Navigation Modal */
.mobile-nav-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.mobile-nav-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-nav-content {
  position: relative;
  width: 320px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.mobile-nav-modal.active .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.mobile-nav-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.mobile-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
}

.mobile-nav-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
}

.mobile-nav-close:active {
  transform: scale(0.95);
}

.mobile-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.mobile-nav-body .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-body .toc-item {
  margin-bottom: var(--space-xs);
}

.mobile-nav-body .toc-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: var(--font-size-sm);
  transform: translateX(0);
  position: relative;
  overflow: hidden;
}

.mobile-nav-body .toc-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.mobile-nav-body .toc-link:hover::before {
  left: 100%;
}

.mobile-nav-body .toc-link:hover,
.mobile-nav-body .toc-link.active {
  background: var(--accent);
  color: white;
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-body .toc-subitem {
  margin-left: var(--space-lg);
  margin-top: var(--space-xs);
}

.mobile-nav-body .toc-subitem .toc-link {
  font-size: var(--font-size-xs);
  padding: var(--space-xs) var(--space-md);
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.mobile-nav-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.mobile-nav-toggle:hover::before {
  left: 100%;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 1;
}

.mobile-nav-toggle:hover {
  background: var(--bg-secondary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-toggle:hover span {
  background: var(--text-primary);
}

.mobile-nav-toggle:active {
  transform: scale(0.95);
}

/* AI Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(200, 255, 46, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.chat-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.chat-toggle:hover::before {
  left: 100%;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(200, 255, 46, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(200, 255, 46, 0.4);
  }
  70% {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(200, 255, 46, 0);
  }
  100% {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(200, 255, 46, 0);
  }
}

.chat-toggle:active {
  transform: scale(0.95);
}

.chat-toggle svg {
  transition: transform 0.2s ease;
}

.chat-toggle:hover svg {
  transform: scale(1.1);
}

/* Chat badge removed */

/* Support Button Styling */
[data-support-button] {
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

[data-support-button]:hover {
  transform: scale(1.02) !important;
  box-shadow: 0 2px 8px rgba(200, 255, 46, 0.3) !important;
}

.chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 500px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chat-widget.active .chat-panel {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 16px;
}

.chat-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.bot-message .message-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .message-avatar {
  background: var(--bg-tertiary);
}

.message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.bot-message .message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.user-message .message-content {
  background: #e6e6e6;
  color: white;
  border-bottom-right-radius: 4px;
}

.quick-questions {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.quick-questions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px 16px;
}

.quick-questions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  opacity: 0.8;
}

.quick-questions-toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.quick-questions-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  opacity: 1;
}

.quick-questions-toggle.collapsed svg {
  transform: rotate(180deg);
}

.quick-questions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 16px 16px;
  max-height: 200px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.quick-questions-list.collapsed {
  max-height: 0;
  padding: 0 16px;
  opacity: 0;
}

.quick-question-btn {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  line-height: 1.4;
}

.quick-question-btn:hover {
  background: var(--accent);
  color: white;
  transform: translateX(4px);
  border-color: var(--accent);
}

.chat-input-container {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.chat-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.1);
}

.chat-send {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.chat-send:active {
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-lg) var(--space-md);
  }
  
  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: var(--space-lg);
  }
  
  .header-content {
    flex-direction: row;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
  }
  
  .header-controls {
    width: auto;
    justify-content: flex-end;
    gap: var(--space-md);
  }
  
  .search-container {
    min-width: 250px;
    flex: 1;
    max-width: 400px;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .container {
    margin-top: 70px; /* Space for fixed header on tablets */
  }
  
  .header-content {
    padding: var(--space-sm) var(--space-md);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    min-height: 60px;
  }
  
  .brand {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
  }
  
  .logo {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-lg);
  }
  
  .brand-title {
    font-size: var(--font-size-xl);
  }
  
  .brand-subtitle {
    font-size: var(--font-size-sm);
  }
  
  .header-controls {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    width: auto;
    flex-shrink: 0;
  }
  
  .search-container {
    min-width: 250px;
  }
  
  .ios-controls {
    flex-direction: row;
    gap: var(--space-md);
    align-items: center;
  }
  
  .ios-switch-container {
    flex-direction: column;
    gap: 4px;
  }
  
  .ios-switch {
    transform: scale(0.9);
  }
  
  .ios-switch + label {
    width: 50px;
    height: 30px;
  }
  
  .ios-switch + label:after {
    width: 26px;
  }
  
  .ios-toggle:checked + label:after {
    margin-left: 26px;
  }
  
  
  .ios-switch > .ios-switch-label {
    font-size: 11px;
  }
}

@media (max-width: 900px) {
  .container {
    margin-top: 65px;
  }
  
  .header-content {
    min-height: 55px;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .logo {
    width: 32px;
    height: 32px;
  }
  
  .brand-title {
    font-size: var(--font-size-lg);
  }
  
  .brand-subtitle {
    font-size: var(--font-size-xs);
  }
  
  .search-container {
    min-width: 200px;
  }
  
  .ios-switch + label {
    width: 45px;
    height: 28px;
  }
  
  .ios-switch + label:after {
    width: 24px;
  }
  
  .ios-toggle:checked + label:after {
    margin-left: 23px;
  }
  
  
  .ios-switch > .ios-switch-label {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
  }
  
  .header-content {
    padding: var(--space-xs) var(--space-sm);
    min-height: 50px;
  }
  
  .brand-text {
    display: none;
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  .sidebar {
    display: none;
  }
  
  .sidebar-toggle {
    display: flex; /* Show on mobile */
  }
  
  .search-container {
    min-width: 200px;
    max-width: 300px;
  }
  
  .sidebar.collapsed {
    width: 60px;
    padding: var(--space-sm);
    overflow: hidden;
  }

  .sidebar.collapsed .sidebar-header h2 {
    display: none;
  }

  .sidebar.collapsed .sidebar-toggle {
    margin: 0;
  }

  .sidebar.collapsed .toc-filter {
    display: none;
  }

  .sidebar.collapsed .toc-list {
    display: none;
  }

  .sidebar.collapsed .sidebar-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .sidebar.collapsed .sidebar-toggle span:nth-child(2) {
    opacity: 0;
  }

  .sidebar.collapsed .sidebar-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .container {
    padding: var(--space-lg) var(--space-md);
    margin-top: 60px; /* Space for fixed header */
  }
  
  .header-content {
    padding: var(--space-xs) var(--space-sm);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    min-height: 50px;
  }
  
  .brand {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
  }
  
  .logo {
    width: 28px;
    height: 28px;
    font-size: var(--font-size-base);
  }
  
  .brand-text {
    display: none; /* Hide brand text on mobile */
  }
  
  .header-controls {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    width: auto;
    flex-shrink: 0;
  }
  
  .search-container {
    position: relative;
    min-width: auto;
    width: auto;
  }
  
  .search-input {
    display: none; /* Hidden by default */
  }
  
  .search-input.mobile-visible {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: var(--space-xs);
    box-shadow: var(--shadow-lg);
  }
  
  .search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    height: 32px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
  }
  
  .search-toggle-text {
    font-size: var(--font-size-xs);
    font-weight: 500;
  }
  
  .search-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
  }
  
  .search-toggle.active {
    background-color: var(--accent);
    color: var(--bg-primary);
  }
  
  .ios-controls {
    flex-direction: row;
    gap: var(--space-sm);
    align-items: center;
  }
  
  .ios-switch-container {
    flex-direction: column;
    gap: 2px;
  }
  
  .ios-switch {
    transform: scale(0.8);
  }
  
  .ios-switch + label {
    width: 40px;
    height: 24px;
  }
  
  .ios-switch + label:after {
    width: 20px;
  }
  
  .ios-toggle:checked + label:after {
    margin-left: 22px;
  }
  
  
  .ios-switch > .ios-switch-label {
    font-size: 9px;
  }
  
  .controls {
    justify-content: center;
    width: 100%;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .sidebar-content {
    display: none;
  }
  
  .sidebar-content.active {
    display: block;
  }
  
  .section {
    padding: var(--space-lg);
  }
  
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .lightbox-prev {
    left: var(--space-md);
  }
  
  .lightbox-next {
    right: var(--space-md);
  }
  
  .lightbox-close {
    top: var(--space-md);
    right: var(--space-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--space-md) var(--space-sm);
    margin-top: 50px; /* Smaller space for very small screens */
  }
  
  .header-content {
    padding: 4px var(--space-xs);
    min-height: 42px;
    gap: var(--space-xs);
  }
  
  .search-container {
    min-width: 150px;
    max-width: 200px;
  }
  
  .ios-controls {
    gap: var(--space-xs);
  }
  
  .language-button {
    width: 45px;
    height: 28px;
    font-size: 12px;
  }
  
  /* Chat widget on mobile */
  .chat-widget {
    bottom: 15px;
    right: 15px;
  }
  
  .chat-toggle {
    width: 50px;
    height: 50px;
  }
  
  .chat-panel {
    width: calc(100vw - 30px);
    height: 600px;
    bottom: 70px;
    left: 15px;
    right: 15px;
  }
  
  .section {
    padding: var(--space-md);
  }
  
  .screenshots-grid {
    grid-template-columns: 1fr;
  }
  
  /* iOS switches on very small screens */
  .ios-switch {
    transform: scale(0.7);
  }
  
  .ios-switch + label {
    width: 35px;
    height: 22px;
  }
  
  .ios-switch + label:after {
    width: 18px;
  }
  
  .ios-toggle:checked + label:after {
    margin-left: 17px;
  }
  
  .ios-switch > .ios-switch-label {
    font-size: 8px;
  }
  
  
  .search-toggle {
    height: 28px;
    padding: 2px var(--space-xs);
  }
  
  .search-toggle svg {
    width: 14px;
    height: 14px;
  }
  
  .search-toggle-text {
    font-size: 10px;
  }
  
  .logo {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-sm);
  }
  
  .back-to-top {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    font-size: var(--font-size-base);
  }
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 30px);
    height: 600px;
    bottom: 70px;
    left: -350px;
    right: 15px;
  }
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .back-to-top,
  .lightbox,
  .loading {
    display: none !important;
  }
  
  .container {
    grid-template-columns: 1fr;
    max-width: none;
    padding: 0;
  }
  
  .main {
    width: 100%;
  }
  
  .section {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #000;
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .screenshots-grid {
    display: none;
  }
  
  .lightbox {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
  
  .note {
    border: 1px solid #000;
    background: #f5f5f5 !important;
  }
  
  .table {
    border: 1px solid #000;
  }
  
  .table th,
  .table td {
    border: 1px solid #000;
  }
}

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

/* Focus Styles */
*:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus,
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --text-secondary: #000;
  }
  
  [data-theme="light"] {
    --border: #000;
    --text-secondary: #000;
  }
}
