/**
 * GiftSparky Help Center Styles
 * Inspired by Telegram Wallet Knowledge Base (Dark & Light Theme)
 */

:root {
  --bg-main: #0c0f17;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass-modal: #131722;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #007aff;
  --accent-blue-hover: #0062cc;
  --accent-cyan: #38bdf8;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.25);
  --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

[data-theme="light"] {
  --bg-main: #f3f5f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass-modal: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(0, 122, 255, 0.3);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  line-height: 1.5;
}

.help-page-container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 24px 0;
}

.help-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.help-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #007aff, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.help-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.help-brand-sub {
  font-weight: 500;
  color: var(--accent-blue);
  font-size: 15px;
  margin-left: 4px;
}

.help-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-theme-btn,
.help-store-btn,
.help-lang-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.help-theme-btn:hover,
.help-store-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

[data-theme="dark"] .icon-sun {
  display: inline-block;
}
[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="light"] .icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: inline-block;
}

/* Hero Section */
.help-hero {
  text-align: center;
  padding: 30px 10px 36px 10px;
}

.help-hero-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}

.help-search-box {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.help-search-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.help-search-input {
  width: 100%;
  height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0 46px 0 48px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.help-search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
  background: var(--bg-glass-modal);
}

.help-search-clear {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}

/* Popular Articles Card */
.help-popular-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.help-card-heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 24px;
}

.help-articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
}

.help-article-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.help-article-link:hover {
  color: var(--accent-cyan);
  transform: translateX(3px);
}

.help-article-icon {
  color: var(--accent-blue);
  flex-shrink: 0;
  opacity: 0.9;
}

/* Category Cards (4-column grid) */
.help-categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.help-cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.help-cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.help-cat-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #fff;
}

.icon--blue {
  background: linear-gradient(135deg, #0088cc, #007aff);
  box-shadow: 0 6px 18px rgba(0, 122, 255, 0.35);
}

.icon--purple {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.icon--dark {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .icon--dark {
  background: linear-gradient(135deg, #334155, #1e293b);
}

.icon--green {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.help-cat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.help-cat-count {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Support Hero Banner */
.help-support-banner {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.help-sb-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.help-sb-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.help-sb-btn {
  background: linear-gradient(135deg, #0088cc, #007aff);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
  transition: transform 0.15s;
}

.help-sb-btn:hover {
  transform: scale(1.02);
}

.help-sb-btn:active {
  transform: scale(0.97);
}

/* Search Results Section */
.help-search-results {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.help-sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.help-sr-title {
  font-size: 17px;
  font-weight: 800;
}

.help-sr-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.help-sr-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-sr-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="light"] .help-sr-item {
  background: #f8fafc;
}

.help-sr-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.help-sr-item-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.help-sr-item-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Footer */
.help-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Article Modal */
.help-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.help-modal-card {
  background: var(--bg-glass-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px 24px;
  border-bottom: 1px solid var(--border-color);
}

.help-modal-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(0, 122, 255, 0.12);
  padding: 3px 10px;
  border-radius: 50px;
}

.help-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.help-modal-close:hover {
  color: var(--text-primary);
}

.help-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.help-modal-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.help-modal-content {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.help-modal-content h3 {
  color: var(--text-primary);
  font-size: 16px;
  margin: 18px 0 8px 0;
}

.help-modal-content ol,
.help-modal-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.help-modal-content li {
  margin-bottom: 6px;
}

.help-modal-content blockquote {
  background: rgba(0, 122, 255, 0.08);
  border-left: 3px solid var(--accent-blue);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  color: var(--text-primary);
}

.help-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.02);
}

.help-modal-helpful {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.help-rate-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.help-rate-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.help-modal-ask-btn {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.help-modal-ask-btn:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
  .help-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .help-articles-grid {
    grid-template-columns: 1fr;
  }
  .help-hero-title {
    font-size: 26px;
  }
  .help-popular-card {
    padding: 24px 20px;
  }
  .help-support-banner {
    flex-direction: column;
    text-align: center;
  }
}
