/**
 * @author    SWM
 * @copyright 2025 SWM
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 or later
 */

body.tdbinpack-dialog-open {
  overflow: hidden !important;
}

.tdbinpack-help-dialog {
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  border: none;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.tdbinpack-help-dialog .notice,
.tdbinpack-help-dialog .error,
.tdbinpack-help-dialog .updated,
.tdbinpack-help-dialog .update-nag {
  display: none !important;
}

.tdbinpack-help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.15s ease-out;
}

.tdbinpack-help-dialog[open] {
  animation: slideIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.help-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.5rem;
  border-bottom: 1px solid #dcdcde;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6f7f7;
}

.help-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1d2327;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-header h2 .dashicons {
  color: #2271b1;
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.help-close {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: none;
}

.help-close:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.05);
}

.help-close:focus {
  outline: none;
  box-shadow: none;
}

.help-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
  background: #fff;
}

.help-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 1rem 1.5rem;
  border-top: 1px solid #dcdcde;
  text-align: right;
  background: #f6f7f7;
}

.help-section {
  margin-bottom: 2rem;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #1d2327;
}

.help-section p {
  margin: 0 0 0.75rem;
  color: #50575e;
  line-height: 1.6;
}

.help-section p:last-child {
  margin-bottom: 0;
}

.help-section ol,
.help-section ul {
  margin: 0.75rem 0 0.75rem 1.5rem;
  padding: 0;
  color: #50575e;
}

.help-section ol {
  list-style-type: decimal;
}

.help-section ul {
  list-style-type: disc;
}

.help-section ol:last-child,
.help-section ul:last-child {
  margin-bottom: 0;
}

.help-section li {
  margin-bottom: 0.5rem;
}

.help-fields {
  margin: 0.75rem 0;
}

.help-fields dt {
  font-weight: 600;
  color: #1d2327;
  margin: 1rem 0 0.25rem;
}

.help-fields dt:first-child {
  margin-top: 0;
}

.help-fields dd {
  margin: 0 0 0 1rem;
  color: #50575e;
  line-height: 1.6;
}

.help-faq {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #f6f7f7;
  transition: background 0.2s ease;
}

.help-faq[open] {
  background: #fff;
}

.help-faq summary {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: #1d2327;
  list-style: none;
  display: flex;
  align-items: center;
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::before {
  content: '\f345';
  font-family: dashicons;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.help-faq[open] summary::before {
  transform: rotate(90deg);
}

.help-faq summary:hover {
  color: #2271b1;
}

.help-faq p {
  margin: 0.75rem 0 0;
  padding-left: 1.75rem;
  color: #50575e;
}

.tdbinpack-help-trigger {
  background: transparent;
  border: none;
  color: #2271b1;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
}

.tdbinpacking-meta-box > .tdbinpack-help-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
  width: auto;
  height: auto;
}

.tdbinpacking-meta-box > .tdbinpack-help-trigger:hover {
  background: transparent;
  border: none;
  opacity: 0.7;
}

.tdbinpack-help-trigger:hover,
.tdbinpack-help-trigger:focus {
  opacity: 0.7;
}

.tdbinpack-help-trigger .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.tdbinpack-help-trigger--with-text {
  padding: 6px 12px;
}

.tdbinpack-help-trigger__text {
  font-size: 13px;
  font-weight: 500;
}

.my3dbinpack-help-content h4 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: #2271b1;
  line-height: 1.3;
}

.my3dbinpack-help-content .help-steps,
.my3dbinpack-help-content .help-points,
.my3dbinpack-help-content .help-field-list {
  margin: 1rem 0 1.5rem 0;
  padding-left: 1.5rem;
}

.my3dbinpack-help-content .help-steps li,
.my3dbinpack-help-content .help-points li,
.my3dbinpack-help-content .help-field-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.my3dbinpack-help-content .help-steps {
  list-style-type: decimal;
}

.my3dbinpack-help-content .help-points {
  list-style-type: disc;
}

.my3dbinpack-help-content .help-field-list {
  list-style-type: disc;
  padding-left: 1.5rem;
}

.my3dbinpack-help-content .help-field-list li {
  margin-bottom: 0.5rem;
}

.my3dbinpack-help-content .help-field-list li strong {
  color: #1d2327;
}

.my3dbinpack-help-content .help-field-list li p {
  margin: 0;
  color: #50575e;
}

.my3dbinpack-help-content .help-sublist {
  margin: 0.5rem 0 1rem 1rem;
  padding-left: 1rem;
  list-style-type: circle;
}

.my3dbinpack-help-content .help-sublist li {
  margin-bottom: 0.5rem;
}

.my3dbinpack-help-content .help-warning {
  background: #fff7e0;
  border-left: 4px solid #ffc107;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: default;
}

.my3dbinpack-help-content .help-warning::before,
.my3dbinpack-help-content .help-warning::after {
  content: none;
  display: none;
}

.my3dbinpack-help-content .help-warning .dashicons {
  color: #ff9800;
  font-size: 24px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.my3dbinpack-help-content .help-tip {
  background: #e7f4ff;
  border-left: 4px solid #0099CC;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: default;
}

.my3dbinpack-help-content .help-tip::before,
.my3dbinpack-help-content .help-tip::after {
  content: none;
  display: none;
}

.my3dbinpack-help-content .help-tip .dashicons {
  color: #0099CC;
  font-size: 24px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.my3dbinpack-help-content .help-note {
  background: #f8f9fa;
  border-left: 4px solid #6c757d;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 13px;
}

.my3dbinpack-help-content .help-field-number {
  font-size: 16px;
  color: #2271b1;
  margin-right: 4px;
}

.my3dbinpack-help-content .help-field-item > p:first-child strong {
  font-size: 16px;
}

.my3dbinpack-help-content .help-field-item {
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid #ddd;
}

.my3dbinpack-help-content .help-field-item:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
