/* CodeFrog Help Styles - Based on landing page design */

:root {
  --bg: #0f1221;
  --fg: #e7edf5;
  --muted: #a6b1c2;
  --accent: #7bd88f; /* frog green */
  --accent-2: #60a5fa; /* blue */
  --card: #171a2e;
  --border: #2a2f4a;
  --help-bg: #f8f9fa;
  --help-fg: #333;
  --help-sidebar: #f5f5f7;
  --help-link: #007AFF;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--help-fg);
  background-color: var(--help-bg);
}

.help-header {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: white;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.help-header .app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  margin: 0;
}

.help-header .header-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.help-header .back-link {
  color: white;
  text-decoration: underline;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0.9;
}

.help-header .back-link:hover {
  opacity: 1;
}

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

#search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

#search-input:focus {
  outline: none;
  border-color: white;
  background: rgba(255, 255, 255, 0.15);
}

#results-container {
  position: absolute;
  background: white;
  color: var(--help-fg);
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  list-style: none;
  padding: 0.5rem 0;
  width: 100%;
  left: 0;
  right: 0;
}

#results-container li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e5e7;
}

#results-container li:last-child {
  border-bottom: none;
}

#results-container a {
  color: var(--help-link);
  text-decoration: none;
  display: block;
}

#results-container a:hover {
  background: #f5f5f7;
}

.container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  min-height: calc(100vh - 60px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar {
  width: 260px;
  background: var(--help-sidebar);
  border-right: 1px solid #e5e5e7;
  padding: 1rem 1rem;
  position: sticky;
  top: 60px; /* Account for compact header */
  height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
}

.help-nav h3 {
  color: #1d1d1f;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0;
}

.help-nav ul {
  list-style: none;
}

.help-nav li {
  margin-bottom: 0.25rem;
}

.help-nav a {
  color: #0051a5;
  text-decoration: none;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  display: block;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  line-height: 1.4;
}

.help-nav a:hover {
  background: #0051a5;
  color: white;
  text-decoration: none;
}

.help-nav a.active {
  background: #0051a5;
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.help-nav a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

section {
  margin-bottom: 3rem;
  scroll-margin-top: 2rem;
}

h2 {
  color: #1d1d1f;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--help-link);
  padding-bottom: 0.5rem;
}

h3 {
  color: #1d1d1f;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
}

h4 {
  color: #1d1d1f;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
}

p {
  margin-bottom: 1rem;
  color: #424245;
  font-size: 1rem;
}

ul, ol {
  margin: 1rem 0 1rem 2rem;
  color: #424245;
}

li {
  margin-bottom: 0.5rem;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shortcuts-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e5e7;
}

.shortcuts-table td:first-child {
  background: var(--help-sidebar);
  font-family: 'SF Mono', Monaco, monospace;
  font-weight: 600;
  color: var(--help-link);
  width: 120px;
  text-align: center;
}

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

.feature-box {
  background: #f8f9fa;
  border-left: 4px solid var(--help-link);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.troubleshoot-item {
  background: #f8f9fa;
  border-left: 4px solid #FF9500;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.troubleshoot-item h4 {
  color: #FF9500;
  margin-top: 0;
  margin-bottom: 1rem;
}

code {
  background: var(--help-sidebar);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.9rem;
  color: var(--help-link);
}

pre {
  background: #1d1d1f;
  color: #f5f5f7;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'SF Mono', Monaco, monospace;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

footer {
  background: #1d1d1f;
  color: #86868b;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

footer .build-info {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

footer .build-info a {
  color: #86868b;
  text-decoration: underline;
}

footer .build-info a:hover {
  color: #a6b1c2;
}

a {
  color: #0051a5;
  text-decoration: underline;
}

a:hover {
  color: #003d7a;
  opacity: 1;
}

/* Ensure anchor links in content have good contrast */
.content a {
  color: #0051a5;
}

.content a:hover {
  color: #003d7a;
}

.content a:visited {
  color: #0051a5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  .help-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  
  .help-header h1 {
    font-size: 1.1rem;
  }
  
  .search-container {
    width: 100%;
    max-width: 100%;
  }
  
  .sidebar {
    top: 0;
    height: auto;
    max-height: 300px;
  }
  
  .shortcuts-table {
    font-size: 0.9rem;
  }
  
  .shortcuts-table td:first-child {
    width: 100px;
  }

  #results-container {
    min-width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1d1d1f;
    color: #f5f5f7;
  }
  
  .container {
    background: #2d2d30;
  }
  
  .sidebar {
    background: #1d1d1f;
    border-right-color: #424245;
  }
  
  .help-nav h3 {
    color: #f5f5f7;
  }
  
  h2, h3, h4 {
    color: #f5f5f7;
  }
  
  p, ul, ol {
    color: #d1d1d6;
  }
  
  .shortcuts-table {
    background: #2d2d30;
  }
  
  .shortcuts-table td:first-child {
    background: #1d1d1f;
  }
  
  .feature-box, .troubleshoot-item {
    background: #1d1d1f;
  }
  
  code {
    background: #1d1d1f;
    color: #64d2ff;
  }
  
  a, a:visited {
    color: #5ac8fa;
  }
  
  a:hover {
    color: #7dd3fc;
  }
  
  .content a {
    color: #5ac8fa;
  }
  
  .content a:hover {
    color: #7dd3fc;
  }
  
  .content a:visited {
    color: #5ac8fa;
  }
  
  .help-nav a {
    color: #5ac8fa;
  }

  .help-nav a:hover {
    background: #5ac8fa;
    color: #1d1d1f;
  }

  .help-nav a.active {
    background: #5ac8fa;
    color: #1d1d1f;
  }
  
  footer {
    background: #000;
  }
}

