/**
 * @file
 * Styles for Help button and modal.
 */

/* Wrapper */
.help-wrapper {
  display: inline-block;
  position: relative;
}

/* Trigger Button */
.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #1D398D;
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 32px;
  transition: all 0.15s ease;
}

.help-btn:hover {
  background: #E2F2FF;
}

.help-btn img {
  width: 20px;
  height: 20px;
}

/* Modal Overlay - CRITICAL: Must be hidden by default */
.help-modal-overlay {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Only show when is-open class is added */
.help-modal-overlay.is-open {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}

/* Modal Box */
.help-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: helpModalFadeIn 0.2s ease;
  position: relative;
}

@keyframes helpModalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.help-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-modal-header .help-icon {
  display: flex;
  align-items: center;
}

.help-modal-header .help-icon img {
  width: 24px;
  height: 24px;
}

.help-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280 !important;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.help-modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Body */
.help-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Help Content */
.help-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Help Section */
.help-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.help-section:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.help-section-title {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.help-section-title:hover {
  background: #f3f4f6;
}

.help-section-icon {
  font-size: 1.1rem;
}

.help-section-content {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}

.help-section-content p {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.6;
}

.help-section-content a {
  color: #1D398D;
  text-decoration: none;
}

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

.help-section-content ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.6;
}

.help-section-content li {
  margin-bottom: 4px;
}

/* Collapsible sections */
.help-section.is-collapsed .help-section-content {
  display: none;
}

.help-section-title::after {
  content: '';
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.help-section.is-collapsed .help-section-title::after {
  transform: rotate(-45deg);
}

/* Footer */
.help-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.help-close-btn {
  padding: 10px 24px;
  background: #1D398D;
  color: #fff;
  border: none;
  border-radius: 32px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.help-close-btn:hover {
  background: #162d70;
}

/* Mobile */
@media (max-width: 480px) {
  .help-modal-overlay.is-open {
    padding: 0;
    align-items: flex-end;
  }

  .help-modal {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }

  .help-modal-body {
    padding: 16px;
  }

  .help-section-title {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .help-section-content {
    padding: 10px 14px;
  }

  .help-modal-footer {
    padding: 12px 16px;
  }

  .help-close-btn {
    width: 100%;
  }
}
