/* Master Prompts widget — premium dark glassmorphism */
.mp-section {
  position: relative;
  padding: 56px 20px 64px;
  margin-top: 0;
  background: linear-gradient(180deg, #0a0a14 0%, #0d0d18 100%);
  color: #f5f5f5;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mp-container { max-width: 1240px; margin: 0 auto; }

.mp-head { text-align: center; margin-bottom: 28px; }
.mp-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #00f2fe;
  padding: 5px 12px;
  background: rgba(0,242,254,0.08);
  border: 1px solid rgba(0,242,254,0.22);
  border-radius: 100px;
  margin-bottom: 16px;
}
.mp-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(24px, 4.2vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
  color: #f8f9fa;
}
.mp-accent {
  background: linear-gradient(120deg, #00f2fe, #fe0979);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mp-sub { font-size: 14px; color: #8b949e; margin: 0; max-width: 580px; margin-left: auto; margin-right: auto; line-height: 1.55; }

.mp-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  margin-top: 32px;
  min-height: 480px;
}

/* Tree */
.mp-tree {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
}
.mp-tree::-webkit-scrollbar { width: 6px; }
.mp-tree::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }

.mp-cat {
  appearance: none;
  text-align: left;
  width: 100%;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  color: #f5f5f5;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, transform .15s ease;
}
.mp-cat::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--cat-color, #00f2fe);
  opacity: .6;
  transition: opacity .2s ease;
}
.mp-cat:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }
.mp-cat:hover::before { opacity: 1; }
.mp-cat.is-active { border-color: var(--cat-color, #00f2fe); background: rgba(0,242,254,0.04); }
.mp-cat.is-active::before { opacity: 1; height: 3px; }

.mp-cat__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: #f5f5f5;
}
.mp-cat__count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 700;
  color: var(--cat-color, #00f2fe);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px; border-radius: 100px;
  margin-left: auto;
}
.mp-cat__name { font-size: 13px; font-weight: 700; color: #f5f5f5; }
.mp-cat__hint { font-size: 11px; color: #8b949e; line-height: 1.4; }

/* List of prompts inside category (expanded) */
.mp-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mp-cat.is-active .mp-list { display: flex; }

.mp-prompt {
  appearance: none;
  text-align: left;
  background: rgba(255,255,255,0.025);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: #d4d4d4;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  display: flex; gap: 8px; align-items: flex-start;
  transition: background .15s ease, border-color .15s ease;
}
.mp-prompt:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); }
.mp-prompt.is-current { background: rgba(0,242,254,0.10); border-color: rgba(0,242,254,0.30); color: #fff; }
.mp-prompt__num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 700;
  color: #6c7280;
  flex: 0 0 auto;
  min-width: 24px;
}
.mp-prompt__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Viewer */
.mp-viewer {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 480px;
  position: relative;
}
.mp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; flex: 1;
  color: #6c7280; font-size: 13px;
}
.mp-empty p { margin: 12px 0 0; max-width: 280px; line-height: 1.5; }

.mp-back {
  display: none;
  appearance: none;
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f5f5f5;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  gap: 6px;
}
.mp-back:hover { background: rgba(255,255,255,0.10); }

.mp-viewer__head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mp-viewer__title {
  flex: 1 1 auto; min-width: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 700;
  color: #f5f5f5;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.mp-viewer__num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 700;
  color: var(--cat-color, #00f2fe);
  padding: 4px 10px;
  background: rgba(0,242,254,0.10);
  border-radius: 100px;
  flex: 0 0 auto;
}
.mp-viewer__source {
  font-size: 11px;
  color: #8b949e;
  display: flex; gap: 10px; align-items: center;
}
.mp-viewer__source a { color: #00f2fe; text-decoration: none; }
.mp-viewer__source a:hover { text-decoration: underline; }

.mp-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.mp-tag {
  font-size: 10px; font-weight: 600;
  color: #8b949e;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 9px;
  border-radius: 100px;
}

.mp-body-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
}
.mp-body {
  background: #050608;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
}
.mp-body::-webkit-scrollbar { width: 6px; }
.mp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }

.mp-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  background: rgba(0,242,254,0.10);
  border: 1px solid rgba(0,242,254,0.30);
  color: #00f2fe;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  z-index: 5;
}
.mp-copy:hover { background: rgba(0,242,254,0.20); transform: translateY(-1px); }
.mp-copy.is-copied {
  background: rgba(0,178,94,0.18);
  border-color: rgba(0,178,94,0.45);
  color: #6bf3ad;
}

.mp-loading {
  text-align: center;
  color: #6c7280;
  font-size: 12px;
  padding: 20px;
}

/* Mobile */
@media (max-width: 768px) {
  .mp-section { padding: 36px 14px 48px; }
  .mp-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
  }
  .mp-tree {
    max-height: 360px;
    flex-direction: column;
  }
  /* Mobile: viewer hidden by default; shows when prompt selected */
  .mp-viewer { display: none; min-height: 320px; }
  .mp-section.is-viewing .mp-viewer { display: flex; }
  .mp-section.is-viewing .mp-tree { display: none; }
  .mp-back { display: inline-flex !important; }
  .mp-viewer__title { font-size: 18px; }
  .mp-body { font-size: 11.5px; padding: 14px; max-height: 60vh; }
}
