/* Categorise creator. Same look as the card set, board game and role play creators. */
.lh-maker {
  max-width: 760px;
  margin: 0 auto;
  color: #212529;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.lh-maker button,
.lh-maker input,
.lh-maker select,
.lh-maker textarea {
  font-family: inherit;
  font-size: 16px;
}

.lh-maker .page-header { padding: 0; margin: 0; }
.lh-maker form { margin-top: 0; }

.lh-maker h1 {
  margin: 0;
  padding: 8px 0 4px;
  font-size: 30px;
  line-height: 1.2;
  text-align: left;
  color: #212529;
}

.lh-maker .lh-intro { margin: 0 0 8px; color: #212529; }
.lh-maker .lh-links { margin: 0 0 48px; color: #6c757d; font-size: 14px; }
.lh-maker .lh-links a { color: #1875d0; text-decoration: none; }
.lh-maker .lh-links a:hover { text-decoration: underline; }

.lh-maker .lh-field { margin: 0 0 24px; }

.lh-maker .create_formhead {
  display: block;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #212529;
}

.lh-maker .lh-lab { display: block; margin: 0 0 18px; }

.lh-maker input[type="text"],
.lh-maker select,
.lh-maker textarea,
.lh-maker .create_textinput,
.lh-maker .create_textarea {
  width: 100%;
  padding: 10px 12px;
  margin: 0 !important;
  color: #212529;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 16px;
}

.lh-maker input[type="text"],
.lh-maker select { height: 44px; }

.lh-maker textarea,
.lh-maker .create_textarea { height: auto; min-height: 60px; resize: vertical; }

.lh-maker input[type="text"]:focus,
.lh-maker select:focus,
.lh-maker textarea:focus {
  outline: none;
  border-color: #1875d0;
  box-shadow: 0 0 0 3px rgba(24, 117, 208, 0.25);
}

.lh-maker ::placeholder { color: #6c757d; opacity: 1; }

.lh-maker .form-section {
  margin: 32px 0;
  padding: 24px;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 12px;
}

.lh-maker .form-section h2 { margin: 0 0 8px; color: #212529; font-size: 22px; }

.lh-maker .lh-qhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.lh-maker .lh-qhead h2,
.lh-maker .lh-qhead .lh-card-count { margin: 0; }
.lh-maker .lh-card-count { color: #6c757d; font-size: 14px; white-space: nowrap; }

.lh-maker .bulk-help { margin: 8px 0 20px; color: #6c757d; font-size: 14px; }

.lh-maker [hidden] { display: none !important; }

.lh-maker .lh-text-button,
.lh-maker .lh-text-button:hover {
  display: inline;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #1875d0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}
.lh-maker .lh-text-button:hover { text-decoration: underline; }

.lh-maker .lh-secondary,
.lh-maker .create_button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #1875d0;
  border-radius: 8px;
  background: #fff;
  color: #1875d0;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  text-decoration: none;
}
.lh-maker .lh-secondary:hover,
.lh-maker .create_button.secondary:hover { background: #f4f8fc; color: #1875d0; box-shadow: none; transform: none; }
.lh-maker .lh-secondary:disabled { color: #6c757d; border-color: #ced4da; background: #f8f9fa; cursor: not-allowed; }
.lh-maker .lh-add-card { margin: 4px 0 0; }

.lh-maker .lh-options { margin: 0 0 32px; padding: 0; background: transparent; border: none; }
.lh-maker .lh-options summary { cursor: pointer; font-size: 15px; font-weight: 600; color: #212529; }

.lh-maker .lh-submit { margin: 0 0 24px; }

.lh-maker #submitButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #1875d0;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}
.lh-maker #submitButton:hover { background: #135ba2; box-shadow: none; transform: none; }

.lh-maker .lh-status { margin: 10px 0 0; color: #6c757d; font-size: 14px; }
.lh-maker .error { margin: 0 0 16px; color: #b02a37; }

.lh-maker .exercise-creator > .success-message {
  margin: 0 0 24px;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  color: #212529;
}

/* Success screen */
.lh-maker #urlSection.success-message {
  height: auto;
  margin: 8px 0 32px;
  padding: 32px 24px;
  overflow: visible;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 12px;
  text-align: center;
}
.lh-maker #urlSection.success-message h2 { margin: 0 0 15px; font-size: 28px; font-weight: 600; text-align: center; color: #212529; }
.lh-maker #urlSection.success-message p { margin: 0 0 20px; color: #666; font-size: 16px; text-align: center; }
.lh-maker #urlSection .url-display { display: block; max-width: 100%; margin: 20px 0; padding: 15px; box-sizing: border-box; background: #fff; border: 2px solid #28a745; border-radius: 6px; }
.lh-maker #urlSection .activity-url { color: #007bff; font-size: 18px; font-weight: 500; text-decoration: none; word-break: break-all; overflow-wrap: anywhere; }
.lh-maker #urlSection .activity-url:hover { color: #0056b3; text-decoration: underline; }
.lh-maker #urlSection .action-buttons { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 25px; }
.lh-maker #urlSection .lh-success-ad { margin-top: 24px; text-align: center; }
.lh-maker .action-buttons .create_button,
.lh-maker .action-buttons a.create_button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 16px !important;
  border: 1px solid #1875d0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #1875d0 !important;
  font-weight: 600 !important;
  margin: 0 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transform: none !important;
  text-decoration: none !important;
}
.lh-maker #urlSection #copyLinkBtn { background: #1875d0 !important; color: #fff !important; }
.lh-maker #urlSection #copyLinkBtn:hover { background: #1366b8 !important; border-color: #1366b8 !important; }

/* My Role Plays and Delete pages */
.lh-maker .lh-list-item {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
}
.lh-maker .lh-list-item h2 { margin: 0 0 6px; font-size: 19px; }
.lh-maker .lh-list-item h2 a { color: #1875d0; text-decoration: none; }
.lh-maker .lh-list-item h2 a:hover { text-decoration: underline; }
.lh-maker .lh-list-item p { margin: 0 0 6px; color: #495057; font-size: 15px; }
.lh-maker .lh-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.lh-maker .lh-list-actions form { margin: 0; }
.lh-maker .lh-list-actions a,
.lh-maker .lh-list-actions button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  color: #212529;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}
.lh-maker .lh-list-actions a:hover,
.lh-maker .lh-list-actions button:hover { border-color: #1875d0; color: #1875d0; }
.lh-maker .lh-list-actions .lh-danger { color: #b02a37; }
.lh-maker .lh-list-actions .lh-danger:hover { border-color: #b02a37; color: #b02a37; }
.lh-maker .lh-confirm {
  margin: 24px 0 0;
  padding: 20px;
  background: #fff8e8;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
}


/* Tabs */
.lh-maker .lh-tabs {
  display: flex;
  margin: 0 0 20px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  overflow: hidden;
}
.lh-maker .lh-tabs .method-toggle {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 8px;
  border: none;
  border-right: 1px solid #ced4da;
  border-radius: 0;
  background: #fff;
  color: #212529;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}
.lh-maker .lh-tabs .method-toggle:last-child { border-right: none; }
.lh-maker .lh-tabs .method-toggle:hover { background: #f4f8fc; color: #1875d0; }
.lh-maker .lh-tabs .method-toggle.active,
.lh-maker .lh-tabs .method-toggle.active:hover { background: #1875d0; color: #fff; }
.lh-maker .lh-tabs .method-toggle:focus { outline: 2px solid #1875d0; outline-offset: -2px; z-index: 1; }

.lh-maker .bulk-status { margin: 0 0 12px; color: #1e7e34; font-weight: 600; }
.lh-maker .bulk-status:empty { display: none; }
.lh-maker .bulk-status.bulk-status-error { color: #b02a37; }
.lh-maker .cat-meta { margin: 0 0 16px; color: #6c757d; font-size: 14px; }
.lh-maker .cat-bulk-example {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  white-space: pre-wrap;
}
.lh-maker .paste-example { margin: 12px 0 6px; color: #6c757d; font-size: 14px; }
.lh-maker .bulk-actions { margin-top: 12px; }
.lh-maker .bulk-actions .create_button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border: 1px solid #1875d0; border-radius: 8px;
  background: #fff; color: #1875d0; font-weight: 600; cursor: pointer; box-shadow: none;
}
.lh-maker .bulk-actions .create_button:hover { background: #f4f8fc; }

/* Category editors */
.lh-maker .cat-editors { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 0 0 16px; }
.lh-maker .cat-editor {
  margin: 0;
  padding: 16px 16px 8px;
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #e2e6ea;
  border-left: 4px solid #1875d0;
  border-radius: 10px;
}
.lh-maker .cat-editor:nth-child(2) { border-left-color: #2e9e5b; }
.lh-maker .cat-editor:nth-child(3) { border-left-color: #e8860c; }
.lh-maker .cat-editor:nth-child(4) { border-left-color: #7b4fc9; }
.lh-maker .cat-editor:nth-child(5) { border-left-color: #d6457a; }
.lh-maker .cat-editor-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.lh-maker .cat-editor-label { font-size: 17px; font-weight: 700; color: #212529; }
.lh-maker .cat-name-label { display: block; margin: 0 0 12px; }
.lh-maker .cat-name { font-weight: 600; }
.lh-maker .cat-words { margin: 0 0 8px; }
.lh-maker .cat-word-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.lh-maker .cat-word-row .cat-word { flex: 1 1 auto; }
.lh-maker .cat-icon-btn {
  flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 1px solid #ced4da; border-radius: 8px; background: #fff; color: #6c757d;
  font-size: 22px; line-height: 1; box-shadow: none; cursor: pointer; transform: none;
}
.lh-maker .cat-icon-btn:hover { border-color: #b02a37; color: #b02a37; background: #fff; }
.lh-maker .cat-add-word,
.lh-maker #addCategory,
.lh-maker .cat-remove {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-height: 40px; padding: 0 16px;
  border: 1px solid #1875d0; border-radius: 8px; background: #fff; color: #1875d0;
  font-weight: 600; line-height: 1; box-shadow: none; transform: none; cursor: pointer;
}
.lh-maker .cat-add-word { margin: 0 0 8px; }
.lh-maker .cat-add-word:hover,
.lh-maker #addCategory:hover,
.lh-maker .cat-remove:hover { background: #f4f8fc; color: #1875d0; }
.lh-maker .cat-remove { height: 34px; min-height: 34px; padding: 0 12px; font-size: 14px; border-color: #ced4da; color: #6c757d; }
.lh-maker .cat-add-word:disabled { color: #6c757d; border-color: #ced4da; background: #f8f9fa; cursor: not-allowed; }
.lh-maker .cat-add-category { margin: 0; }

/* Options */
.lh-maker .create_option { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; }
.lh-maker .create_option input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: 3px 0 0; }
.lh-maker .create_option label { margin: 0; font-size: 15px; }

@media (min-width: 640px) {
  .lh-maker .cat-editors { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .lh-maker #urlSection.success-message h2 { font-size: 24px; }
  .lh-maker #urlSection .activity-url { font-size: 16px; }
  .lh-maker #urlSection .action-buttons { flex-direction: column; align-items: center; }
  .lh-maker #urlSection .action-buttons .create_button { width: 100%; max-width: 300px; }
}

@media (max-width: 480px) {
  #mainDiv { padding-left: 16px; padding-right: 16px; }
  .lh-maker .form-section { padding: 16px; }
  .lh-maker .lh-row2 { display: block; }
  .lh-maker #submitButton { width: 100%; }
}

.lh-maker .action-buttons a.create_button[hidden],
.lh-maker .action-buttons .create_button[hidden] { display: none !important; }

/* Generate tab */
.lh-maker .lh-tab-short { display: none; }
.lh-maker .ai-generate-select { width: 100%; padding: 0 12px; color: #212529; background: #fff; border: 1px solid #ced4da; border-radius: 8px; box-sizing: border-box; font-size: 16px; }
.lh-maker .ai-generate-fields { display: flex; gap: 16px; margin: 0; }
.lh-maker .ai-generate-fields > div { flex: 1 1 0; min-width: 0; }
.lh-maker .ai-generate-panel .bulk-help { margin: 0 0 16px; }
.lh-maker .ai-replace { margin-top: 16px; padding: 12px; background: #fff8e8; border: 1px solid #e2e6ea; border-radius: 8px; }
.lh-maker .ai-replace p { margin: 0 0 10px; }
.lh-maker .ai-replace-actions { display: flex; gap: 10px; }
.lh-maker .ai-replace[hidden],
.lh-maker #aiGenerateError[hidden] { display: none; }

@media (max-width: 480px) {
  .lh-maker .lh-tab-long { display: none; }
  .lh-maker .lh-tab-short { display: inline; }
  .lh-maker .lh-tabs .method-toggle { font-size: 14px; padding: 0 4px; }
  .lh-maker .ai-generate-fields { display: block; }
}
