/* ParrotPadMD Help Center Styles */

/* Help-specific CSS variables */
:root {
  --help-sidebar-width: 280px;
  --help-toc-width: 220px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 1001;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Help Page Layout */
.help-page {
  padding-top: 80px;
  min-height: 100vh;
}

.help-layout {
  display: grid;
  grid-template-columns: var(--help-sidebar-width) 1fr var(--help-toc-width);
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Sidebar Navigation */
.help-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
}

.help-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.help-sidebar-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.help-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.help-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-nav-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.help-nav-item:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
}

.help-nav-item.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.help-nav-item svg {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: middle;
}

/* Main Content Area */
.help-content {
  min-width: 0;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2.5rem;
}

.help-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.help-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-primary);
}

.help-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.help-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.help-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.help-content ul,
.help-content ol {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.help-content li {
  margin-bottom: 0.5rem;
}

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

.help-content a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.help-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.help-content code {
  background: var(--bg-primary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.875em;
  color: var(--accent-light);
}

.help-content pre {
  background: var(--bg-primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.help-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.help-content kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.875em;
  color: var(--text-primary);
  box-shadow: 0 1px 0 var(--border);
}

/* Tables */
.help-content .table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.help-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.help-content th,
.help-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.help-content th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

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

.help-content tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Callout Boxes */
.help-callout {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}

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

.help-callout p:last-child {
  margin-bottom: 0;
}

.help-callout strong {
  color: var(--accent);
}

.help-callout.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
}

.help-callout.warning strong {
  color: #f59e0b;
}

.help-callout.info {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
}

.help-callout.info strong {
  color: #3b82f6;
}

/* Breadcrumbs */
.help-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.help-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.help-breadcrumb span {
  color: var(--text-muted);
}

.help-breadcrumb .current {
  color: var(--text-secondary);
}

/* Previous/Next Navigation */
.help-article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.help-article-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1rem 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  max-width: 45%;
}

.help-article-nav a:hover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.help-article-nav .nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.help-article-nav .nav-title {
  font-weight: 500;
  color: var(--accent);
}

.help-article-nav .prev {
  text-align: left;
}

.help-article-nav .next {
  text-align: right;
  margin-left: auto;
}

/* Table of Contents (Right Rail) */
.help-toc {
  position: sticky;
  top: 100px;
  height: fit-content;
  font-size: 0.875rem;
}

.help-toc h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

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

.help-toc-list a {
  display: block;
  padding: 0.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1.4;
}

.help-toc-list a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

.help-toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.help-toc-list .toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.8125rem;
}

/* Help Landing Page */
.help-hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.help-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.help-hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Search Box */
.help-search {
  position: relative;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.help-search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s;
}

.help-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.help-search-input::placeholder {
  color: var(--text-muted);
}

.help-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.help-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.help-search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(16, 185, 129, 0.1);
}

.search-result-item:focus {
  outline: none;
  background: rgba(16, 185, 129, 0.1);
}

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

.search-result-snippet {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.search-result-snippet mark {
  background: rgba(16, 185, 129, 0.3);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.search-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* Inline Search (Header) */
.help-header-search {
  position: relative;
  width: 300px;
}

.help-header-search .help-search-input {
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  font-size: 0.875rem;
  border-radius: 8px;
}

.help-header-search .help-search-icon {
  left: 0.75rem;
  width: 16px;
  height: 16px;
}

/* Quick Links Grid */
.help-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.help-category-card {
  display: block;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.help-category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.1);
}

.help-category-icon {
  width: 48px;
  height: 48px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.help-category-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
}

.help-category-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.help-category-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Popular Articles */
.help-popular {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.help-popular h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.help-popular-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.help-popular-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.help-popular-item:hover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.help-popular-item svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.help-popular-item span {
  color: var(--text-primary);
  font-size: 0.9375rem;
}

/* Mockup Styles */
.mockup-container {
  margin: 2rem 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.mockup-overlay-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mockup-mic-icon {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.mockup-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.mockup-hotkey {
  font-size: 0.625rem;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Consolas', monospace;
}

.mockup-recording-panel {
  width: 220px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mockup-recording-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mockup-recording-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.mockup-recording-text {
  color: #ef4444;
  font-weight: 600;
  font-size: 0.75rem;
}

.mockup-recording-timer {
  margin-left: auto;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.75rem;
}

.mockup-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 24px;
  margin-bottom: 10px;
}

.mockup-wave-bar {
  width: 3px;
  background: linear-gradient(to top, #ef4444, #f87171);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.mockup-wave-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.mockup-wave-bar:nth-child(2) { height: 85%; animation-delay: 0.1s; }
.mockup-wave-bar:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.mockup-wave-bar:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.mockup-wave-bar:nth-child(5) { height: 70%; animation-delay: 0.4s; }

.mockup-transcribing-panel {
  width: 220px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.mockup-transcribing-text {
  color: #3b82f6;
  font-weight: 600;
  font-size: 0.75rem;
}

.mockup-targeting-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mockup-targeting-icon {
  font-size: 1.25rem;
}

.mockup-targeting-text {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.mockup-targeting-escape {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.mockup-notepad {
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mockup-notepad-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.mockup-notepad-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mockup-notepad-body {
  padding: 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-height: 80px;
  line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .help-layout {
    grid-template-columns: var(--help-sidebar-width) 1fr;
  }

  .help-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .help-categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .help-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .help-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: 80px;
  }

  .help-sidebar.open {
    transform: translateX(0);
  }

  .help-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .help-sidebar-overlay.active {
    display: block;
  }

  .help-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 1rem;
  }

  .mobile-menu-btn svg {
    width: 18px;
    height: 18px;
  }

  .help-content {
    padding: 1.5rem;
  }

  .help-content h1 {
    font-size: 1.75rem;
  }

  .help-content h2 {
    font-size: 1.25rem;
  }

  .help-categories {
    grid-template-columns: 1fr;
  }

  .help-hero h1 {
    font-size: 2rem;
  }

  .help-article-nav {
    flex-direction: column;
  }

  .help-article-nav a {
    max-width: 100%;
  }

  .help-article-nav .next {
    text-align: left;
    margin-left: 0;
  }

  .help-header-search {
    width: 100%;
    max-width: 300px;
  }

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

@media (max-width: 480px) {
  .help-hero {
    padding: 2rem 1rem;
  }

  .help-search-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .help-category-card {
    padding: 1.5rem;
  }
}

/* Print Styles */
@media print {
  .help-sidebar,
  .help-toc,
  .help-article-nav,
  .mobile-menu-btn {
    display: none !important;
  }

  .help-layout {
    display: block;
  }

  .help-content {
    padding: 0;
    background: white;
  }

  .help-content h1,
  .help-content h2,
  .help-content h3 {
    color: black;
  }

  .help-content p,
  .help-content li,
  .help-content td {
    color: #333;
  }
}
