/* Help Section Styles */

/* Main Container */
.help-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Section */
.help-hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}

.help-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.help-hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Help Cards Grid */
.help-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.help-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.help-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.help-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.help-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.help-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Quick Tips Section */
.help-quick-tips {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 3rem;
}

.help-quick-tips h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.tip p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Spaced Repetition Section */
.help-spaced-rep {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border-radius: var(--radius);
  padding: 2rem;
}

.help-spaced-rep h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: white;
}

.sr-diagram {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.sr-step {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  min-width: 120px;
}

.sr-step-number {
  width: 32px;
  height: 32px;
  background: white;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 0.5rem;
}

.sr-step-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.sr-step-content p {
  font-size: 0.8rem;
  margin: 0;
  opacity: 0.9;
}

.sr-arrow {
  font-size: 1.5rem;
  opacity: 0.7;
}

/* Guide Pages */
.guide-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Guide Navigation */
.guide-nav {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 1rem;
}

.guide-nav h3 {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.guide-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-nav li {
  margin-bottom: 0.5rem;
}

.guide-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
}

.guide-nav a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* Guide Content */
.guide-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.guide-content h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.guide-intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.guide-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.guide-section:last-of-type {
  border-bottom: none;
  margin-bottom: 2rem;
}

.guide-section h2 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.guide-section h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem;
}

/* Step Lists */
.step-list {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  padding: 0.75rem 0 0.75rem 3rem;
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: 0.75rem;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.step-list li:last-child {
  border-left-color: transparent;
}

/* Method Box */
.method-box {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.method-box h4 {
  margin: 0 0 1rem;
  color: var(--primary);
}

/* Info Box */
.info-box {
  background: rgba(33, 150, 243, 0.1);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}

.info-box strong {
  color: var(--primary);
}

/* Code Example */
.code-example {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.code-example code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Screenshots */
.screenshot {
  margin: 1.5rem 0;
}

.screenshot-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.screenshot-img.loading {
  opacity: 0;
}

.screenshot-img.loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.screenshot-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.placeholder-icon {
  font-size: 2rem;
  opacity: 0.5;
}

.screenshot-placeholder span:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.screenshot figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Guide Navigation Bottom */
.guide-nav-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Demo Container */
.demo-container {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.demo-container h4 {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

/* Card Flip Demo */
.demo-card-flip {
  perspective: 1000px;
  margin: 0 auto;
  max-width: 300px;
}

.demo-card {
  width: 100%;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
}

.demo-card.flipped {
  transform: rotateY(180deg);
}

.demo-card-front,
.demo-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.demo-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #4caf50, #8bc34a);
  color: white;
  border-color: transparent;
}

.demo-word {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.demo-hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Gap Exercise Demo */
.demo-gap {
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.demo-sentence {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.demo-translation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.demo-answer {
  font-size: 0.9rem;
  color: #4caf50;
}

/* Shortcuts Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.shortcut kbd {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-family: monospace;
  font-weight: bold;
  min-width: 2rem;
  text-align: center;
}

.shortcut span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* SR Explanation */
.sr-explanation {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.sr-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.sr-rating {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: bold;
  font-size: 0.85rem;
  min-width: 70px;
  text-align: center;
}

.sr-rating.again { background: #f44336; color: white; }
.sr-rating.hard { background: #ff9800; color: white; }
.sr-rating.good { background: #4caf50; color: white; }
.sr-rating.easy { background: #2196F3; color: white; }

.sr-arrow {
  color: var(--text-secondary);
}

.sr-result {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* FAQ Page */
.faq-container {
  max-width: 900px;
}

.faq-header {
  text-align: center;
  margin-bottom: 2rem;
}

.faq-header h1 {
  margin-bottom: 0.5rem;
}

.faq-header p {
  color: var(--text-secondary);
}

/* FAQ Search */
.faq-search {
  margin-bottom: 1.5rem;
}

.faq-search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.faq-search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* FAQ Categories */
.faq-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.faq-category {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-category:hover {
  border-color: var(--primary);
}

.faq-category.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--bg-secondary);
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem;
}

.faq-answer p,
.faq-answer ul {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-answer ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.faq-answer li {
  margin-bottom: 0.5rem;
}

.faq-answer pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.faq-answer code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* FAQ Not Found */
.faq-not-found {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* FAQ Footer */
.faq-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

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

/* Support Page */
.support-container {
  max-width: 1000px;
}

.support-header {
  text-align: center;
  margin-bottom: 2rem;
}

.support-header h1 {
  margin-bottom: 0.5rem;
}

.support-header p {
  color: var(--text-secondary);
}

.support-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

/* Support Form */
.support-form-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.support-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.support-form label {
  font-weight: 500;
  color: var(--text-primary);
}

.support-form input,
.support-form select,
.support-form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.support-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.form-user-info {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-badge {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Support Sidebar */
.support-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.support-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.support-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.support-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.support-box ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.support-box li {
  margin-bottom: 0.25rem;
}

.support-box .btn {
  margin-top: 1rem;
  width: 100%;
}

/* Support Guides Links */
.support-guides {
  display: flex;
  flex-direction: column;
}

.guide-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.guide-link:hover {
  background: var(--primary);
  color: white;
}

.guide-icon {
  font-size: 1.25rem;
}

/* Alerts */
.alert {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert-icon {
  font-size: 1.5rem;
}

.alert strong {
  display: block;
  margin-bottom: 0.25rem;
}

.alert p {
  margin: 0;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
}

.alert-success strong {
  color: #4caf50;
}

.alert-error {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid #f44336;
}

.alert-error strong {
  color: #f44336;
}

/* Responsive */
@media (max-width: 900px) {
  .guide-container {
    grid-template-columns: 1fr;
  }

  .guide-nav {
    position: static;
    margin-bottom: 1rem;
  }

  .guide-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .guide-nav li {
    margin: 0;
  }

  .support-content {
    grid-template-columns: 1fr;
  }

  .support-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 600px) {
  .help-container {
    padding: 1rem;
  }

  .help-hero {
    padding: 2rem 1rem;
  }

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

  .sr-diagram {
    flex-direction: column;
  }

  .sr-arrow {
    transform: rotate(90deg);
  }

  .guide-nav-bottom {
    flex-direction: column;
  }

  .shortcuts-grid {
    grid-template-columns: 1fr;
  }

  .faq-categories {
    justify-content: center;
  }

  .support-sidebar {
    grid-template-columns: 1fr;
  }
}
