/**
 * BooxDay Support Page - Dedicated Styles
 * Comprehensive, conflict-free styling for the support center
 */

/* ============================================================================
   Support Page Variables
   ============================================================================ */
.support-page {
  --support-accent: #2D2D2D;
  --support-accent-light: #4A4A4A;
  --support-success: #2E7D32;
  --support-warning: #E65100;
  --support-info: #1565C0;
  --support-bg: #FAFAFA;
  --support-card-bg: #FFFFFF;
  --support-border: #E0E0E0;
  --support-text: #333333;
  --support-text-muted: #666666;
  --support-radius: 8px;
  --support-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --support-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* ============================================================================
   Tab Navigation - Horizontal Scrollable
   ============================================================================ */
.support-nav {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--support-card-bg);
  border-radius: var(--support-radius);
  box-shadow: var(--support-shadow);
  margin-bottom: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.support-nav::-webkit-scrollbar {
  height: 4px;
}

.support-nav::-webkit-scrollbar-thumb {
  background: var(--support-border);
  border-radius: 2px;
}

.support-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--support-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.support-nav-btn:hover {
  background: var(--support-bg);
  color: var(--support-text);
}

.support-nav-btn.active {
  background: var(--support-accent);
  color: #FFFFFF;
}

.support-nav-btn i {
  font-size: 18px;
}

/* ============================================================================
   Tab Panels
   ============================================================================ */
.support-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.support-panel.active {
  display: block;
}

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

/* ============================================================================
   Getting Started - Step Cards
   ============================================================================ */
.setup-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

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

@media (max-width: 500px) {
  .setup-flow {
    grid-template-columns: 1fr;
  }
}

.setup-step {
  position: relative;
  background: var(--support-card-bg);
  border: 1px solid var(--support-border);
  border-radius: var(--support-radius);
  padding: 24px 20px;
  text-align: center;
}

.setup-step::before {
  content: attr(data-step);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: var(--support-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
}

.setup-step .step-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--support-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-step .step-icon i {
  font-size: 22px;
  color: var(--support-accent);
}

.setup-step h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--support-text);
}

.setup-step p {
  margin: 0;
  font-size: 13px;
  color: var(--support-text-muted);
  line-height: 1.5;
}

/* ============================================================================
   Content Sections
   ============================================================================ */
.support-section {
  background: var(--support-card-bg);
  border: 1px solid var(--support-border);
  border-radius: var(--support-radius);
  padding: 28px;
  margin-bottom: 24px;
}

.support-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--support-text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--support-border);
}

.support-section h2 i {
  color: var(--support-accent);
}

.support-section h3 {
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--support-text);
}

.support-section h3:first-of-type {
  margin-top: 0;
}

.support-section p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--support-text-muted);
}

.support-section ul,
.support-section ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.support-section li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--support-text-muted);
}

.support-section li strong {
  color: var(--support-text);
}

.support-section code {
  background: var(--support-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  color: var(--support-accent);
}

/* ============================================================================
   Info/Tip/Warning Boxes
   ============================================================================ */
.support-callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 6px;
  margin: 16px 0;
}

.support-callout i {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.support-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.support-callout.info {
  background: #E3F2FD;
  border-left: 4px solid var(--support-info);
}

.support-callout.info i {
  color: var(--support-info);
}

.support-callout.tip {
  background: #F1F8E9;
  border-left: 4px solid var(--support-success);
}

.support-callout.tip i {
  color: var(--support-success);
}

.support-callout.warning {
  background: #FFF3E0;
  border-left: 4px solid var(--support-warning);
}

.support-callout.warning i {
  color: var(--support-warning);
}

.support-callout.privacy {
  background: #FAFAFA;
  border-left: 4px solid var(--support-accent);
}

.support-callout.privacy i {
  color: var(--support-accent);
}

/* ============================================================================
   How-To Guide Cards
   ============================================================================ */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .guides-grid {
    grid-template-columns: 1fr;
  }
}

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

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--support-bg);
  border-bottom: 1px solid var(--support-border);
}

.guide-card-header i {
  font-size: 20px;
  color: var(--support-accent);
}

.guide-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--support-text);
}

.guide-card-body {
  padding: 20px;
}

.guide-card-body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--support-text-muted);
}

.guide-screenshot {
  margin: 16px 0;
  text-align: center;
}

.guide-screenshot-img {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--support-border);
  box-shadow: var(--support-shadow);
}

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

.guide-steps li {
  position: relative;
  padding: 12px 0 12px 36px;
  border-bottom: 1px solid var(--support-border);
  font-size: 14px;
  line-height: 1.5;
  color: var(--support-text-muted);
  counter-increment: guide-step;
}

.guide-steps li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.guide-steps li::before {
  content: counter(guide-step);
  position: absolute;
  left: 0;
  top: 12px;
  width: 22px;
  height: 22px;
  background: var(--support-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 22px;
}

.guide-steps li strong {
  color: var(--support-text);
}

/* ============================================================================
   Keyboard/Gesture Reference
   ============================================================================ */
.gesture-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.gesture-table th,
.gesture-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--support-border);
  font-size: 14px;
}

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

.gesture-table td {
  color: var(--support-text-muted);
}

.gesture-table td:first-child {
  font-weight: 500;
  color: var(--support-text);
}

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

.kbd {
  display: inline-block;
  padding: 3px 8px;
  background: var(--support-bg);
  border: 1px solid var(--support-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--support-text);
}

/* ============================================================================
   Pen Type Reference
   ============================================================================ */
.pen-types {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (max-width: 600px) {
  .pen-types {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pen-type {
  text-align: center;
  padding: 16px 8px;
  background: var(--support-bg);
  border-radius: 6px;
}

.pen-type i {
  font-size: 24px;
  color: var(--support-accent);
  margin-bottom: 8px;
  display: block;
}

.pen-type span {
  font-size: 12px;
  font-weight: 500;
  color: var(--support-text);
}

/* ============================================================================
   FAQ Accordion
   ============================================================================ */
.faq-accordion {
  border: 1px solid var(--support-border);
  border-radius: var(--support-radius);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--support-border);
}

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

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  background: var(--support-card-bg);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--support-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.faq-question i {
  font-size: 16px;
  color: var(--support-text-muted);
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question {
  background: var(--support-bg);
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 20px 20px;
  background: var(--support-bg);
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-answer p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--support-text-muted);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.faq-answer li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--support-text-muted);
}

/* ============================================================================
   Troubleshooting Cards
   ============================================================================ */
.troubleshoot-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.troubleshoot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--support-bg);
  cursor: pointer;
}

.troubleshoot-header i {
  font-size: 20px;
  color: var(--support-accent);
}

.troubleshoot-header h4 {
  margin: 0;
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--support-text);
}

.troubleshoot-header .toggle-icon {
  font-size: 14px;
  color: var(--support-text-muted);
  transition: transform 0.2s ease;
}

.troubleshoot-item.open .troubleshoot-header .toggle-icon {
  transform: rotate(180deg);
}

.troubleshoot-body {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--support-border);
}

.troubleshoot-item.open .troubleshoot-body {
  display: block;
}

.troubleshoot-body h5 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--support-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.troubleshoot-body ul {
  margin: 0 0 20px;
  padding-left: 20px;
}

.troubleshoot-body li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--support-text-muted);
}

.troubleshoot-body .solution-steps {
  background: #F1F8E9;
  padding: 16px;
  border-radius: 6px;
  margin-top: 12px;
}

.troubleshoot-body .solution-steps h5 {
  color: var(--support-success);
}

.troubleshoot-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FFF8E1;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--support-text-muted);
  border-left: 3px solid #FFB300;
}

.troubleshoot-note i {
  color: #FFB300;
  margin-right: 6px;
}

.troubleshoot-note strong {
  color: var(--support-text);
}

/* ============================================================================
   Contact Section
   ============================================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  background: var(--support-card-bg);
  border: 1px solid var(--support-border);
  border-radius: var(--support-radius);
  padding: 24px;
  text-align: center;
}

.contact-card i {
  font-size: 28px;
  color: var(--support-accent);
  margin-bottom: 12px;
}

.contact-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--support-text);
}

.contact-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--support-text-muted);
}

.contact-card a {
  display: inline-block;
  padding: 8px 16px;
  background: var(--support-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.contact-card a:hover {
  background: var(--support-accent-light);
}

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

.contact-form-section h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--support-text);
}

.contact-form-section > p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--support-text-muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--support-text);
}

.form-field label .required {
  color: #D32F2F;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--support-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--support-text);
  background: var(--support-card-bg);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--support-accent);
  box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #999;
}

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

.form-submit {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.form-submit button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--support-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.form-submit button:hover {
  background: var(--support-accent-light);
}

/* ============================================================================
   Additional Utility Classes
   ============================================================================ */
.support-divider {
  height: 1px;
  background: var(--support-border);
  margin: 24px 0;
}

.support-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--support-bg);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.support-badge.pro {
  background: #FFF3E0;
  color: var(--support-warning);
}

.support-badge.free {
  background: #E8F5E9;
  color: var(--support-success);
}

/* Data Location Box */
.data-location {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--support-bg);
  border: 1px dashed var(--support-border);
  border-radius: 6px;
  margin: 16px 0;
}

.data-location i {
  font-size: 20px;
  color: var(--support-accent);
}

.data-location code {
  flex: 1;
  background: transparent;
  padding: 0;
  font-size: 13px;
}

/* Feature Comparison Mini-Table */
.feature-compare {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0;
  border: 1px solid var(--support-border);
  border-radius: var(--support-radius);
  overflow: hidden;
  margin: 16px 0;
}

.feature-compare > div {
  padding: 12px 16px;
  border-bottom: 1px solid var(--support-border);
  font-size: 14px;
}

.feature-compare > div:nth-child(3n+1) {
  background: var(--support-card-bg);
  color: var(--support-text);
}

.feature-compare > div:nth-child(3n+2),
.feature-compare > div:nth-child(3n) {
  text-align: center;
  background: var(--support-bg);
}

.feature-compare .header {
  font-weight: 600;
  background: var(--support-accent) !important;
  color: #fff !important;
}

.feature-compare .check {
  color: var(--support-success);
}

.feature-compare .cross {
  color: #999;
}

/* Responsive nav */
@media (max-width: 768px) {
  .support-nav {
    padding: 6px;
    gap: 2px;
  }

  .support-nav-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .support-nav-btn span {
    display: none;
  }

  .support-nav-btn i {
    font-size: 20px;
  }
}
