/*
  Aitude Startup Evaluation Plugin — ase-style.css
  ─────────────────────────────────────────────────
  Design philosophy:
  • Inherit ALL font sizes, families, weights, and colours from the Foxiz theme's CSS
    variables (--body-fcolor, --body-family, --g-color, --flex-gray-15, etc.)
  • Only add layout/structure, spacing, and minimal state colours that the theme
    does not already provide.
  • All selectors are scoped under .ase-wrap to avoid conflicts.
*/

/* ── Base wrapper ─────────────────────────────── */
.ase-wrap {
  position: relative;
}

.ase-wrap *,
.ase-wrap *::before,
.ase-wrap *::after {
  box-sizing: border-box;
}

/* ── Tab bar ──────────────────────────────────── */
.ase-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--flex-gray-15, #e5e5e5);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ase-tab-btn {
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--meta-fcolor, #666);
  font-family: var(--btn-family, inherit);
  font-size: var(--btn-fsize, inherit);
  font-weight: var(--btn-fweight, 700);
  letter-spacing: var(--btn-fspace, normal);
  text-transform: var(--btn-transform, none);
  cursor: pointer;
  margin-bottom: -2px;
  transition: var(--effect, all 0.2s ease);
}

.ase-tab-btn:hover,
.ase-tab-active {
  color: var(--body-fcolor, #282828);
  border-bottom-color: var(--g-color, #ff184e);
}

.ase-tab-panel { display: block; }

/* ── List header ──────────────────────────────── */
.ase-list-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.ase-ideas-count strong {
  color: var(--body-fcolor, #282828);
  font-weight: 700;
}

/* ── Ideas grid ───────────────────────────────── */
.ase-ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Idea card — uses theme surface + border colours ── */
.ase-idea-card {
  background: var(--solid-white, #fff);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  border-radius: var(--round-7, 7px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px var(--shadow-7, #00000012);
  transition: var(--effect, all 0.2s ease);
}

.ase-idea-card:hover {
  box-shadow: 0 3px 12px var(--shadow-12, #0000001f);
  border-color: var(--flex-gray-40, #888);
}

.ase-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ase-card-name {
  font-family: var(--h4-family, inherit);
  font-size: var(--h4-fsize, 16px);
  font-weight: var(--h4-fweight, 700);
  line-height: var(--h4-fheight, 1.45);
  color: var(--body-fcolor, #282828);
}

/* Status badges — use theme colour tokens */
.ase-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--round-7, 7px);
  font-family: var(--cat-family, inherit);
  font-size: var(--cat-fsize, 10px);
  font-weight: var(--cat-fweight, 700);
  letter-spacing: var(--cat-fspace, 0.07em);
  text-transform: var(--cat-transform, uppercase);
  white-space: nowrap;
  flex-shrink: 0;
}

.ase-badge-raw        { background: #fff8e6; color: #b8860b;   border: 1px solid #ffe08a; }
.ase-badge-validating { background: #e8f4fd; color: #1a5276;   border: 1px solid #aed6f1; }
.ase-badge-building   { background: #e9f7ef; color: #1e8449;   border: 1px solid #a9dfbf; }
.ase-badge-paused     { background: var(--flex-gray-7, #f5f5f5); color: var(--meta-fcolor, #666); border: 1px solid var(--flex-gray-15, #e5e5e5); }
.ase-badge-killed     { background: #fdedec; color: #a93226;   border: 1px solid #f1948a; }

.ase-card-desc {
  color: var(--excerpt-color, #666);
  font-family: var(--excerpt-family, inherit);
  font-size: var(--excerpt-fsize, 14px);
  font-style: italic;
  line-height: var(--excerpt-fheight, 1.7);
  margin: 0;
}

.ase-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ase-meta-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--round-3, 3px);
  background: var(--flex-gray-7, #f5f5f5);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  color: var(--meta-fcolor, #666);
}

/* Score bar */
.ase-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ase-score-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--flex-gray-15, #e5e5e5);
  overflow: hidden;
}

.ase-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.ase-score-fill.high { background: #27ae60; }
.ase-score-fill.mid  { background: var(--g-color, #ff184e); }
.ase-score-fill.low  { background: #c0392b; }

.ase-score-pct {
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  font-weight: 700;
  min-width: 36px;
  text-align: right;
  color: var(--body-fcolor, #282828);
}

.ase-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* ── Empty state ──────────────────────────────── */
.ase-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--meta-fcolor, #666);
}

.ase-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }

/* ── Buttons — follow theme button system ──────── */
.ase-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 20px;
  border-radius: var(--round-3, 3px);
  border: 1px solid transparent;
  font-family: var(--btn-family, inherit);
  font-size: var(--btn-fsize, 12px);
  font-weight: var(--btn-fweight, 700);
  font-style: var(--btn-fstyle, normal);
  letter-spacing: var(--btn-fspace, normal);
  text-transform: var(--btn-transform, none);
  line-height: var(--height-34, 34px);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--effect, all 0.2s ease);
  text-decoration: none;
}

.ase-btn-primary {
  background: var(--g-color, #ff184e);
  color: var(--awhite, #fff) !important;
  border-color: var(--g-color, #ff184e);
}
.ase-btn-primary:hover {
  opacity: 0.88;
  color: var(--awhite, #fff) !important;
}

.ase-btn-outline {
  background: transparent;
  color: var(--body-fcolor, #282828) !important;
  border-color: var(--flex-gray-40, #888);
}
.ase-btn-outline:hover {
  border-color: var(--body-fcolor, #282828);
}

.ase-btn-ghost {
  background: transparent;
  color: var(--meta-fcolor, #666) !important;
  border-color: transparent;
}
.ase-btn-ghost:hover {
  color: var(--body-fcolor, #282828) !important;
  background: var(--flex-gray-7, #f5f5f5);
}

.ase-btn-danger {
  background: transparent;
  color: #c0392b !important;
  border-color: #c0392b;
}
.ase-btn-danger:hover {
  background: #c0392b;
  color: #fff !important;
}

.ase-btn-pdf {
  background: transparent;
  color: var(--g-color, #ff184e) !important;
  border-color: var(--g-color, #ff184e);
}
.ase-btn-pdf:hover {
  background: var(--g-color, #ff184e);
  color: var(--awhite, #fff) !important;
}

/* ── Form inputs — extend theme input styles ───── */
.ase-wrap .ase-input,
.ase-wrap .ase-textarea {
  width: 100%;
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  border-radius: var(--round-3, 3px);
  background: var(--input-bg, var(--flex-gray-7, #f5f5f5));
  color: var(--input-fcolor, inherit);
  font-family: var(--input-family, inherit);
  font-size: var(--input-fsize, 14px);
  font-weight: var(--input-fweight, 400);
  line-height: 1.6;
  padding: 10px 16px;
  outline: none;
  transition: var(--effect, all 0.2s ease);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
}

.ase-wrap .ase-input:focus,
.ase-wrap .ase-textarea:focus {
  border-color: var(--g-color, #ff184e);
}

.ase-wrap .ase-textarea {
  resize: vertical;
  min-height: 80px;
  display: block;
}

.ase-wrap .ase-input.ase-invalid,
.ase-wrap .ase-textarea.ase-invalid {
  border-color: #c0392b;
  background: #fff8f8;
}

/* ── Fields ───────────────────────────────────── */
.ase-field {
  margin-bottom: 20px;
}
.ase-field:last-child { margin-bottom: 0; }

.ase-label {
  display: block;
  font-family: var(--body-family, inherit);
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--body-fcolor, #282828);
}

.ase-req { color: var(--g-color, #ff184e); }

/* ── Radio pills ──────────────────────────────── */
.ase-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ase-radio-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.ase-radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ase-radio-pill span {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--round-7, 7px);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  background: var(--flex-gray-7, #f5f5f5);
  font-family: var(--btn-family, inherit);
  font-size: var(--btn-fsize, 12px);
  font-weight: var(--btn-fweight, 700);
  color: var(--meta-fcolor, #666);
  transition: var(--effect, all 0.2s ease);
  line-height: 1.4;
}

.ase-radio-pill:hover span {
  border-color: var(--body-fcolor, #282828);
  color: var(--body-fcolor, #282828);
}

.ase-radio-pill input[type="radio"]:checked + span {
  background: var(--body-fcolor, #282828);
  border-color: var(--body-fcolor, #282828);
  color: var(--awhite, #fff);
}

.ase-radio-pill.ase-yes input[type="radio"]:checked + span {
  background: #27ae60;
  border-color: #27ae60;
  color: #fff;
}

.ase-radio-pill.ase-no input[type="radio"]:checked + span {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

/* Optional expandable textarea */
.ase-opt {
  display: none;
  margin-top: 10px;
}
.ase-opt.ase-opt-visible { display: block; }

.ase-opt-label {
  display: block;
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  color: var(--meta-fcolor, #666);
  margin-bottom: 5px;
  font-style: italic;
}

/* ── Wizard wrapper ───────────────────────────── */
.ase-wizard {
  max-width: 780px;
}

.ase-wizard-head {
  margin-bottom: 20px;
}

/* Progress */
.ase-progress-wrap { margin-bottom: 24px; }

.ase-progress-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.ase-dot {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--round-3, 3px);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  background: var(--flex-gray-7, #f5f5f5);
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  color: var(--meta-fcolor, #666);
  cursor: pointer;
  transition: var(--effect, all 0.2s ease);
  white-space: nowrap;
}

.ase-dot:hover {
  border-color: var(--g-color, #ff184e);
  color: var(--g-color, #ff184e);
}

.ase-dot-active {
  background: var(--g-color, #ff184e);
  border-color: var(--g-color, #ff184e);
  color: var(--awhite, #fff) !important;
}

.ase-dot-done {
  background: var(--flex-gray-15, #e5e5e5);
  color: var(--body-fcolor, #282828);
}

.ase-progress-track {
  height: 3px;
  border-radius: 2px;
  background: var(--flex-gray-15, #e5e5e5);
  overflow: hidden;
}

.ase-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--g-color, #ff184e);
  transition: width 0.35s ease;
  width: 0%;
}

/* ── Slides viewport ──────────────────────────── */
.ase-slides-viewport {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  transition: min-height 0.3s ease;
}

.ase-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(56px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  padding-bottom: 4px;
}

.ase-slide.ase-slide-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.ase-slide.ase-exit-left   { opacity: 0; transform: translateX(-56px); pointer-events: none; }
.ase-slide.ase-enter-right { opacity: 0; transform: translateX(56px);  pointer-events: none; }

.ase-step-label {
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--flex-gray-15, #e5e5e5);
  color: var(--meta-fcolor, #666);
}

/* ── Wizard nav ───────────────────────────────── */
.ase-wizard-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--flex-gray-15, #e5e5e5);
  margin-top: 16px;
}

.ase-nav-left  { display: flex; justify-content: flex-start; }
.ase-nav-center { display: flex; justify-content: center; }
.ase-nav-right { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ── Validation banner ────────────────────────── */
.ase-validation-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-radius: var(--round-7, 7px);
  background: #fdedec;
  border: 1px solid #f1948a;
  color: #a93226;
  box-shadow: 0 4px 16px var(--shadow-12, rgba(0,0,0,0.12));
  max-width: 90vw;
}

.ase-validation-banner button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
}

/* ── Detail view ──────────────────────────────── */
.ase-detail-view { display: none; }
.ase-detail-view.ase-detail-active { display: block; }

.ase-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--meta-fcolor, #666);
  padding: 0;
  margin-bottom: 20px;
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  transition: var(--effect, all 0.2s ease);
}
.ase-back-btn:hover { color: var(--g-color, #ff184e); }

.ase-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.ase-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.ase-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ase-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ase-detail-section {
  background: var(--solid-white, #fff);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  border-radius: var(--round-7, 7px);
  padding: 18px;
  box-shadow: 0 1px 4px var(--shadow-7, #00000012);
}

.ase-detail-section-title {
  font-family: var(--cat-family, inherit);
  font-size: var(--cat-fsize, 10px);
  font-weight: var(--cat-fweight, 700);
  letter-spacing: var(--cat-fspace, 0.07em);
  text-transform: var(--cat-transform, uppercase);
  color: var(--meta-fcolor, #666);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--flex-gray-15, #e5e5e5);
}

.ase-detail-row { margin-bottom: 10px; }
.ase-detail-row:last-child { margin-bottom: 0; }

.ase-detail-q {
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  color: var(--meta-fcolor, #666);
  margin-bottom: 2px;
  line-height: 1.4;
}

.ase-detail-a {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.ase-ans-yes { color: #27ae60; }
.ase-ans-no  { color: #c0392b; }

.ase-detail-note {
  margin-top: 4px;
  font-style: italic;
  color: var(--excerpt-color, #666);
  font-size: var(--excerpt-fsize, 14px);
  padding-left: 10px;
  border-left: 2px solid var(--flex-gray-15, #e5e5e5);
  line-height: 1.6;
}

/* Score display badge */
.ase-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--round-7, 7px);
  border: 1px solid;
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  font-weight: 700;
}
.ase-score-badge.high { background: #e9f7ef; color: #1e8449; border-color: #a9dfbf; }
.ase-score-badge.mid  { background: #fef9e7; color: #b7950b; border-color: #f9e79f; }
.ase-score-badge.low  { background: #fdedec; color: #a93226; border-color: #f1948a; }

.ase-notes-block {
  background: var(--solid-white, #fff);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  border-radius: var(--round-7, 7px);
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 1px 4px var(--shadow-7, #00000012);
}

.ase-notes-text {
  white-space: pre-wrap;
  color: var(--excerpt-color, #666);
  font-size: var(--excerpt-fsize, 14px);
  line-height: 1.7;
}

/* ── Modal ────────────────────────────────────── */
.ase-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9995;
}

.ase-modal-overlay.ase-modal-open { display: flex; }

.ase-modal-box {
  background: var(--solid-white, #fff);
  border: 1px solid var(--flex-gray-15, #e5e5e5);
  border-radius: var(--round-7, 7px);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px var(--shadow-12, rgba(0,0,0,0.12));
  animation: ase-modal-in 0.2s ease;
}

@keyframes ase-modal-in {
  from { opacity:0; transform:scale(0.95) translateY(8px); }
  to   { opacity:1; transform:none; }
}

.ase-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Toasts ───────────────────────────────────── */
.ase-toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ase-toast {
  pointer-events: auto;
  padding: 10px 16px;
  border-radius: var(--round-7, 7px);
  border: 1px solid;
  max-width: 300px;
  font-family: var(--meta-family, inherit);
  font-size: var(--meta-fsize, 13px);
  box-shadow: 0 2px 8px var(--shadow-12, rgba(0,0,0,0.12));
  animation: ase-toast-in 0.2s ease;
}

.ase-toast.success { background:#e9f7ef; border-color:#a9dfbf; color:#1e8449; }
.ase-toast.error   { background:#fdedec; border-color:#f1948a; color:#a93226; }
.ase-toast.info    { background:var(--flex-gray-7, #f5f5f5); border-color:var(--flex-gray-15, #e5e5e5); color:var(--meta-fcolor, #666); }

@keyframes ase-toast-in {
  from { opacity:0; transform:translateX(14px); }
  to   { opacity:1; transform:none; }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 640px) {
  .ase-ideas-grid      { grid-template-columns: 1fr; }
  .ase-detail-grid     { grid-template-columns: 1fr; }
  .ase-wizard          { max-width: 100%; }

  .ase-wizard-nav {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .ase-nav-center {
    grid-column: 1/-1;
    order: -1;
    justify-content: center;
    padding-bottom: 8px;
  }

  .ase-list-header { flex-direction: column; align-items: flex-start; }
  .ase-progress-dots { gap: 3px; }
  .ase-dot { font-size: 10px; padding: 2px 6px; }
}
