/**
 * Single AI prompt page — ChatGPT-style code card for copyable prompts.
 *
 * @package Innov8th
 */

.ai-prompt-single-main {
  overflow: visible;
  background: linear-gradient(
    180deg,
    #08040e 0%,
    #08040e 58%,
    #050208 70%,
    #030105 80%,
    #010001 90%,
    #000000 100%
  );
}

.ai-prompt-single-main::after {
  content: "";
  display: block;
  height: clamp(72px, 9vh, 110px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.85) 75%,
    #000000 100%
  );
  pointer-events: none;
}

.ai-prompt-single-main .single-post-sticky-backdrop {
  padding-bottom: 100px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: opacity 0.35s ease;
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 52%,
    rgba(0, 0, 0, 0.82) 72%,
    rgba(0, 0, 0, 0.45) 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 52%,
    rgba(0, 0, 0, 0.82) 72%,
    rgba(0, 0, 0, 0.45) 86%,
    transparent 100%
  );
}

.ai-prompt-single-main .single-post-sticky-backdrop__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(8, 4, 14, 0) 0%,
    rgba(8, 4, 14, 0.2) 48%,
    rgba(8, 4, 14, 0.62) 78%,
    rgba(8, 4, 14, 0.88) 100%
  );
}

.ai-prompt-single-main .single-post-sticky-backdrop__wave {
  position: relative;
  z-index: 1;
  width: min(72vw, 780px);
  max-width: none;
  height: auto;
  margin-top: -32px;
  opacity: 0.96;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
  user-select: none;
}

.ai-prompt-single-main .single-post-sticky-backdrop__blur,
.ai-prompt-single-main .single-post-sticky-backdrop__blur2,
.ai-prompt-single-main .single-post-sticky-backdrop__blur3 {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.ai-prompt-single-main > :not(.single-post-sticky-backdrop) {
  position: relative;
  z-index: 1;
}

.ai-prompt-single-main .glass-stage-hero__blur,
.ai-prompt-single-main .glass-stage-hero__blur2,
.ai-prompt-single-main .glass-stage-hero__blur3 {
  display: none;
}

.ai-prompt-single-main .glass-stage-hero {
  padding-bottom: 1.5rem;
  overflow: visible;
}

.ai-prompt-single-main .glass-stage-hero__stage {
  background: rgba(10, 5, 18, 0.32);
  backdrop-filter: blur(26px) saturate(1.15);
  -webkit-backdrop-filter: blur(26px) saturate(1.15);
  border-color: rgba(255, 255, 255, 0.16);
}

.ai-prompt-single-main .single-post-layout {
  padding-top: 2rem;
  padding-bottom: 0;
}

.ai-prompt-single-main .single-post-article-panel {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 5, 18, 0.42);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ai-prompt-single-main + footer {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * clamp(72px, 9vh, 110px));
  background: #000;
}

.ai-prompt-single-main + footer .main-footer {
  overflow: visible;
}

.ai-prompt-single-main + footer .main-footer .overlay {
  overflow: visible;
  background: transparent;
}

.ai-prompt-single-main + footer .gradientBlurfooter {
  top: clamp(-48px, -6vh, -12px);
  opacity: 0.82;
}

.ai-prompt-single-main .single-post-body {
  max-width: none;
}

.ai-prompt-single-main .single-post-body > .wp-block-html,
.ai-prompt-single-main .single-post-body > figure,
.ai-prompt-single-main .single-post-body > .wp-block-group {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.ai-prompt-block {
  --ai-prompt-card: #0f0f0f;
  --ai-prompt-bar: #2f2f2f;
  --ai-prompt-muted: rgba(255, 255, 255, 0.55);
  --ai-prompt-text: #ececec;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 1.6rem 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ai-prompt-card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.ai-prompt-block__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  min-height: 2.35rem;
  padding: 0.35rem 0.7rem 0.35rem 0.9rem;
  background: var(--ai-prompt-bar);
  user-select: none;
}

.ai-prompt-block__label {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  color: var(--ai-prompt-muted);
}

.ai-prompt-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.28rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.ai-prompt-copy::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-prompt-copy:hover,
.ai-prompt-copy:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.ai-prompt-copy.is-copied,
.ai-prompt-copy.is-copied:hover {
  background: transparent;
  color: #86efac;
}

.ai-prompt-copy.is-copied::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-prompt-block__body,
.single-post-body .ai-prompt-block__body,
.single-post-body pre.ai-prompt-block__body {
  display: block;
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: var(--ai-prompt-card);
  color: var(--ai-prompt-text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.ai-prompt-block.is-collapsed .ai-prompt-block__body,
.ai-prompt-block__body.is-collapsed {
  position: relative;
  max-height: calc(1.7em * 5 + 1.15rem);
  overflow: hidden;
}

.ai-prompt-block.is-collapsed .ai-prompt-block__body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.2rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 15, 15, 0), var(--ai-prompt-card) 88%);
}

.ai-prompt-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.9rem 0.85rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.82);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.ai-prompt-expand:hover,
.ai-prompt-expand:focus-visible {
  background: rgba(255, 0, 184, 0.12);
  color: #fff;
  outline: none;
}

.ai-prompt-expand__icon {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15rem;
  transition: transform 160ms ease;
}

.ai-prompt-block.is-expanded .ai-prompt-expand__icon {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.ai-prompt-expand[hidden] {
  display: none !important;
}

/* Auth modal */
body.is-prompt-auth-open {
  overflow: hidden;
}

.prompt-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.prompt-auth-modal[hidden] {
  display: none !important;
}

.prompt-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 1, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.prompt-auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  padding: 1.45rem 1.35rem 1.4rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 6, 24, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.prompt-auth-modal__glow {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 70%;
  height: 70%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 0, 184, 0.28), transparent 68%);
}

.prompt-auth-modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.prompt-auth-modal__title {
  position: relative;
  margin: 0 1.75rem 0.35rem 0;
  font-family: "gri", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
}

.prompt-auth-modal__sub {
  position: relative;
  margin: 0 0 1.1rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  line-height: 1.45;
}

.prompt-auth-modal__tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.prompt-auth-modal__tab {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.prompt-auth-modal__tab.is-active {
  background: rgba(255, 0, 184, 0.22);
  color: #fff;
}

.prompt-auth-modal__error {
  position: relative;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 80, 120, 0.35);
  background: rgba(255, 40, 90, 0.12);
  color: #ffd0dc;
  font-size: 0.84rem;
}

.prompt-auth-modal__error[hidden] {
  display: none !important;
}

.prompt-auth-modal__google {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.prompt-auth-modal__google:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.prompt-auth-modal__divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.prompt-auth-modal__divider::before,
.prompt-auth-modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.prompt-auth-modal__divider span {
  padding: 0 0.65rem;
}

.prompt-auth-modal__form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-auth-modal__form[hidden] {
  display: none !important;
}

.prompt-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 400;
}

.prompt-auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 4, 14, 0.7);
  color: #fff;
  font-size: 0.95rem;
}

.prompt-auth-field input:focus {
  outline: 2px solid rgba(255, 0, 184, 0.55);
  outline-offset: 1px;
}

.prompt-auth-modal__submit {
  margin-top: 0.25rem;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff00b8 0%, #8b2fd6 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.prompt-auth-modal__submit:hover {
  filter: brightness(1.06);
}

.single-post-body .ai-prompt-block + .ai-prompt-block {
  margin-top: 1.35rem;
}

@media (max-width: 992px) {
  .ai-prompt-single-main .single-post-sticky-backdrop__wave {
    margin-top: -20px;
    width: min(82vw, 620px);
  }
}

@media (max-width: 600px) {
  .ai-prompt-single-main .single-post-sticky-backdrop__wave {
    margin-top: -8px;
    width: 92vw;
    opacity: 0.9;
  }

  .ai-prompt-single-main .single-post-article-panel {
    padding: 1.2rem;
    border-radius: 18px;
  }

  .ai-prompt-block__toolbar {
    flex-direction: row;
    align-items: center;
  }

  .ai-prompt-block__body,
  .single-post-body .ai-prompt-block__body,
  .single-post-body pre.ai-prompt-block__body {
    font-size: 0.8rem;
    padding: 0.9rem 0.9rem 1rem;
  }

  .prompt-auth-modal {
    padding: 0.85rem;
    align-items: flex-end;
  }

  .prompt-auth-modal__dialog {
    width: 100%;
    border-radius: 20px 20px 16px 16px;
  }
}
