/* ================================================
   XAPP HELP SYSTEM STYLES
   ================================================ */

/* Help Modal Overlay */
#help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#help-modal.hidden {
  display: none;
}

.help-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Help Container */
.help-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Help Header */
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
}

.help-header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

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

#help-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.help-back-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.help-back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

#help-search {
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  width: 250px;
  transition: all 0.2s;
}

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

#help-search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.help-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Help Body */
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  background: #f8f9fa;
}

#help-content {
  max-width: 100%;
}

/* Help Footer */
.help-footer {
  padding: 15px 30px;
  border-top: 1px solid #e0e0e0;
  background: white;
  text-align: center;
}

.help-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.help-footer a:hover {
  text-decoration: underline;
}

/* ================================================
   HOME PAGE
   ================================================ */

.help-home {
  animation: fadeIn 0.3s;
}

.help-intro {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.help-category-card {
  background: white;
  padding: 25px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  text-align: center;
}

.help-category-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.help-category-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.help-category-card h3 {
  margin: 10px 0;
  color: var(--text-color);
  font-size: 18px;
}

.help-category-card p {
  color: var(--text-light);
  font-size: 14px;
  margin: 0;
}

.help-quick-links {
  background: white;
  padding: 25px;
  border-radius: 8px;
}

.help-quick-links h3 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 20px;
  margin-bottom: 15px;
}

.help-quick-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-quick-links li {
  margin: 8px 0;
}

.help-quick-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 15px;
  display: flex;
  align-items: center;
  padding: 8px 0;
  transition: all 0.2s;
}

.help-quick-links a:hover {
  padding-left: 10px;
  font-weight: 500;
}

.help-quick-links a::before {
  content: '→';
  margin-right: 10px;
  transition: all 0.2s;
}

.help-quick-links a:hover::before {
  margin-right: 15px;
}

/* ================================================
   CATEGORY PAGE
   ================================================ */

.help-category {
  animation: fadeIn 0.3s;
}

.help-category h2 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 28px;
  margin-bottom: 25px;
  padding: 20px;
  background: white;
  border-radius: 8px;
}

.help-articles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-article-item {
  background: white;
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid transparent;
}

.help-article-item:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.help-article-item h4 {
  margin: 0;
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
}

.help-article-category {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 5px;
}

.help-arrow {
  color: var(--primary-color);
  font-size: 20px;
  transition: all 0.2s;
}

.help-article-item:hover .help-arrow {
  transform: translateX(5px);
}

/* ================================================
   ARTICLE PAGE
   ================================================ */

.help-article {
  animation: fadeIn 0.3s;
}

.help-breadcrumb {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  padding: 15px 20px;
  background: white;
  border-radius: 8px;
}

.help-breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.help-breadcrumb a:hover {
  text-decoration: underline;
}

.help-breadcrumb span {
  color: var(--text-color);
  font-weight: 500;
}

.help-article-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.help-article-content h3 {
  color: var(--text-color);
  font-size: 24px;
  margin-top: 30px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.help-article-content h3:first-child {
  margin-top: 0;
}

.help-article-content h4 {
  color: var(--text-color);
  font-size: 18px;
  margin-top: 25px;
  margin-bottom: 12px;
}

.help-article-content h5 {
  color: var(--text-color);
  font-size: 16px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.help-article-content p {
  color: var(--text-color);
  margin: 12px 0;
}

.help-article-content ul,
.help-article-content ol {
  margin: 12px 0;
  padding-left: 30px;
}

.help-article-content li {
  margin: 8px 0;
  color: var(--text-color);
}

.help-article-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.help-article-content a:hover {
  text-decoration: underline;
}

.help-article-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: #c7254e;
}

.help-article-content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}

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

/* Special Content Boxes */
.help-tip {
  background: #e3f2fd;
  border-left: 4px solid #2196F3;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.help-warning {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.help-example {
  background: #f5f5f5;
  border-left: 4px solid #4caf50;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.help-status {
  background: #fafafa;
  border: 2px solid #e0e0e0;
  padding: 15px;
  margin: 20px 0;
  border-radius: 8px;
}

/* Tables */
.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.help-table th,
.help-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.help-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.help-table tr:hover {
  background: #f5f5f5;
}

/* Article Footer */
.help-article-footer {
  background: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.help-article-footer p {
  margin: 0 0 15px 0;
  font-weight: 500;
  color: var(--text-color);
}

.help-feedback-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.help-feedback-buttons button {
  background: white;
  border: 2px solid #e0e0e0;
  padding: 10px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

.help-feedback-buttons button:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* ================================================
   SEARCH RESULTS
   ================================================ */

.help-search-results {
  animation: fadeIn 0.3s;
}

.help-results-count {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  padding: 15px 20px;
  background: white;
  border-radius: 8px;
}

.help-no-results {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: 8px;
  color: var(--text-color);
  font-size: 18px;
}

/* ================================================
   CONTACT FORM
   ================================================ */

.help-contact-form {
  background: white;
  padding: 30px;
  border-radius: 8px;
  animation: fadeIn 0.3s;
}

.help-contact-form h2 {
  margin-top: 0;
  color: var(--text-color);
}

.help-contact-form p {
  color: var(--text-light);
  margin-bottom: 25px;
}

.help-contact-form .form-group {
  margin-bottom: 20px;
}

.help-contact-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 500;
}

.help-contact-form input,
.help-contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.help-contact-form input:focus,
.help-contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

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

.help-contact-form button[type="submit"] {
  width: 100%;
  margin-top: 10px;
}

/* ================================================
   ANIMATIONS
   ================================================ */

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

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
  .help-container {
    width: 95%;
    max-height: 95vh;
  }

  .help-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
  }

  .help-header-left {
    width: 100%;
  }

  .help-header-right {
    width: 100%;
  }

  #help-search {
    width: 100%;
  }

  #help-title {
    font-size: 20px;
  }

  .help-body {
    padding: 20px;
  }

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

  .help-article-content {
    padding: 20px;
  }

  .help-feedback-buttons {
    flex-direction: column;
  }

  .help-feedback-buttons button {
    width: 100%;
  }
}

/* ================================================
   HELP BUTTON IN NAV
   ================================================ */

.help-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.help-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.help-icon-btn::after {
  content: '?';
  font-weight: bold;
}

/* Tooltip */
.help-icon-btn[title]:hover::before {
  content: attr(title);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
}
