/* AI Prompt Footnote System */

.ai-prompt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-left: 0.2em;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 180ms ease, transform 180ms ease;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
}

.ai-prompt-link:hover {
  opacity: 1;
  transform: scale(1.18);
}

.ai-prompt-link svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Modal overlay */
.ai-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1.5rem;
}

.ai-prompt-modal.is-open {
  display: flex;
}

.ai-prompt-modal-card {
  position: relative;
  width: min(580px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 1.2rem;
  border: 1px solid rgba(205, 179, 255, 0.28);
  background: linear-gradient(160deg, rgba(32, 24, 49, 0.96), rgba(14, 10, 22, 0.98));
  box-shadow: 0 2rem 4rem rgba(6, 4, 10, 0.5), 0 0 0 1px rgba(234, 223, 255, 0.05) inset;
  overflow: hidden;
}

.ai-prompt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(205, 179, 255, 0.16);
  background: rgba(90, 35, 148, 0.12);
}

.ai-prompt-modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f3d08d;
}

.ai-prompt-modal-title svg {
  width: 1.3em;
  height: 1.3em;
  flex-shrink: 0;
}

.ai-prompt-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border: none;
  border-radius: 999px;
  background: rgba(205, 179, 255, 0.12);
  color: rgba(246, 240, 255, 0.72);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 140ms ease;
}

.ai-prompt-modal-close:hover {
  background: rgba(205, 179, 255, 0.26);
  color: #fff;
}

.ai-prompt-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}

.ai-prompt-context {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: rgba(246, 240, 255, 0.56);
  letter-spacing: 0.02em;
}

.ai-prompt-text {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(205, 179, 255, 0.18);
  background: rgba(10, 7, 16, 0.6);
  font-family: "Liberation Sans", "DejaVu Sans", sans-serif;
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(246, 240, 255, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-prompt-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(205, 179, 255, 0.12);
}

.ai-prompt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  color: #180d25;
  background: linear-gradient(90deg, #eadfff, #cdb3ff);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.ai-prompt-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.4rem 1rem rgba(205, 179, 255, 0.25);
}

.ai-prompt-copy-btn.is-copied {
  background: linear-gradient(90deg, #7dff7d, #5cdb5c);
}

/* Level slider */
.ai-prompt-slider-wrap {
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ai-prompt-slider-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 0.15rem;
}

.ai-prompt-slider-labels span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 240, 255, 0.42);
  cursor: pointer;
  transition: color 140ms ease;
}

.ai-prompt-slider-labels span:hover {
  color: rgba(246, 240, 255, 0.7);
}

.ai-prompt-slider-labels span.is-active {
  color: #f3d08d;
}

.ai-prompt-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(205, 179, 255, 0.2), rgba(205, 179, 255, 0.35));
  outline: none;
  cursor: pointer;
}

.ai-prompt-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3d08d, #e7a86c);
  border: 2px solid rgba(10, 7, 16, 0.5);
  box-shadow: 0 0 8px rgba(243, 208, 141, 0.35);
  cursor: pointer;
}

.ai-prompt-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3d08d, #e7a86c);
  border: 2px solid rgba(10, 7, 16, 0.5);
  box-shadow: 0 0 8px rgba(243, 208, 141, 0.35);
  cursor: pointer;
}

.ai-prompt-slider-desc {
  text-align: center;
  font-size: 0.68rem;
  color: rgba(246, 240, 255, 0.45);
  letter-spacing: 0.06em;
  min-height: 1em;
}

.ai-prompt-hint {
  font-size: 0.7rem;
  color: rgba(246, 240, 255, 0.38);
  letter-spacing: 0.04em;
}

/* Disclaimer button in modal header */
.ai-prompt-disclaimer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 160ms ease, transform 160ms ease;
  flex-shrink: 0;
}

.ai-prompt-disclaimer-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.ai-prompt-disclaimer-btn svg {
  width: 100%;
  height: 100%;
}

/* Disclaimer overlay */
.ai-prompt-disclaimer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 10, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
}

.ai-prompt-disclaimer.is-open {
  display: flex;
}

.ai-prompt-disclaimer-card {
  width: min(440px, 100%);
  border-radius: 1rem;
  border: 1px solid rgba(243, 208, 141, 0.3);
  background: linear-gradient(160deg, rgba(38, 28, 55, 0.98), rgba(14, 10, 22, 0.99));
  box-shadow: 0 1.5rem 3rem rgba(6, 4, 10, 0.5);
  overflow: hidden;
}

.ai-prompt-disclaimer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(243, 208, 141, 0.18);
  background: rgba(243, 208, 141, 0.06);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f3d08d;
}

.ai-prompt-disclaimer-header svg {
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  margin-right: 0.3em;
}

.ai-prompt-disclaimer-body {
  padding: 1rem;
}

.ai-prompt-disclaimer-body p {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(246, 240, 255, 0.82);
  font-family: "Liberation Sans", "DejaVu Sans", sans-serif;
}

.ai-prompt-disclaimer-body p:last-child {
  margin-bottom: 0;
}

.ai-prompt-disclaimer-body a {
  color: #cdb3ff;
  text-decoration: none;
  font-weight: 600;
}

.ai-prompt-disclaimer-body a:hover {
  color: #eadfff;
  text-decoration: underline;
}
