/* MODULE: ABTests | FILE: styles.css */
/* Styles for the A/B test manager module. */

.abtests-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: #e2e4ec;
}

.abtests-page__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.abtests-page__subtitle {
  color: #8b8fa3;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.abtests-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.abtests-page__create-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  background: #635bff;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.abtests-page__create-btn:hover {
  background: #524ae0;
}

/* Test list */
.abtests-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.abtests-list__empty {
  text-align: center;
  color: #8b8fa3;
  padding: 3rem 0;
}

/* Test card */
.test-card {
  padding: 1.25rem;
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.test-card:hover {
  border-color: #635bff;
}

.test-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.test-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.test-card__status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-card__status--running {
  background: rgba(99, 91, 255, 0.15);
  color: #635bff;
}

.test-card__status--concluded {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.test-card__status--draft {
  background: rgba(139, 143, 163, 0.15);
  color: #8b8fa3;
}

.test-card__hypothesis {
  font-size: 0.85rem;
  color: #8b8fa3;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.test-card__meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: #6b7080;
}

.test-card__winner {
  color: #22c55e;
  font-weight: 600;
}

/* Variant table */
.variant-table-wrap {
  margin-top: 1.25rem;
}

.variant-table-wrap__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.variant-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8b8fa3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2a2f4e;
  background: #1a1f36;
}

.variant-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #1e2235;
  color: #c8cbdb;
}

.variant-table tr.variant-table__winner td {
  color: #22c55e;
  font-weight: 600;
}

/* Significance bar */
.sig-bar {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 8px;
}

.sig-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sig-bar__label {
  font-size: 0.85rem;
  color: #8b8fa3;
}

.sig-bar__pct {
  font-size: 0.95rem;
  font-weight: 700;
}

.sig-bar__pct--significant {
  color: #22c55e;
}

.sig-bar__pct--pending {
  color: #f59e0b;
}

.sig-bar__track {
  width: 100%;
  height: 8px;
  background: #2a2f4e;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.sig-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.sig-bar__fill--significant {
  background: #22c55e;
}

.sig-bar__fill--pending {
  background: #f59e0b;
}

.sig-bar__target {
  position: relative;
  height: 0;
}

.sig-bar__target-line {
  position: absolute;
  left: 95%;
  top: -12px;
  width: 1px;
  height: 16px;
  background: #ef4444;
}

.sig-bar__rec {
  font-size: 0.82rem;
  color: #8b8fa3;
  line-height: 1.4;
}

.sig-bar__sample-warn {
  font-size: 0.78rem;
  color: #f59e0b;
  margin-bottom: 0.35rem;
}

/* Winner banner */
.winner-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 8px;
  margin-top: 1.25rem;
}

.winner-banner__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.winner-banner__text {
  flex: 1;
}

.winner-banner__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 0.15rem;
}

.winner-banner__detail {
  font-size: 0.82rem;
  color: #8b8fa3;
}

/* Create form */
.abtest-create {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: #e2e4ec;
}

.abtest-create__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.abtest-create__field {
  margin-bottom: 1rem;
}

.abtest-create__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #8b8fa3;
  margin-bottom: 0.3rem;
}

.abtest-create__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #2a2f4e;
  border-radius: 6px;
  background: #1e2235;
  color: #e2e4ec;
  font-size: 0.88rem;
}

.abtest-create__input:focus {
  outline: none;
  border-color: #635bff;
}

.abtest-create__textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #2a2f4e;
  border-radius: 6px;
  background: #1e2235;
  color: #e2e4ec;
  font-size: 0.88rem;
  min-height: 80px;
  resize: vertical;
}

.abtest-create__select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #2a2f4e;
  border-radius: 6px;
  background: #1e2235;
  color: #e2e4ec;
  font-size: 0.88rem;
}

.abtest-create__variants-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 1.5rem 0 0.75rem;
}

.abtest-create__variant {
  padding: 1rem;
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.abtest-create__variant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.abtest-create__variant-name {
  font-weight: 600;
  color: #e2e4ec;
  font-size: 0.9rem;
}

.abtest-create__remove-btn {
  padding: 0.2rem 0.5rem;
  border: 1px solid #ef4444;
  border-radius: 4px;
  background: transparent;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
}

.abtest-create__variant-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.abtest-create__add-variant {
  padding: 0.5rem 1rem;
  border: 1px dashed #2a2f4e;
  border-radius: 6px;
  background: transparent;
  color: #635bff;
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}

.abtest-create__add-variant:hover {
  border-color: #635bff;
}

.abtest-create__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.abtest-create__submit {
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: #635bff;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.abtest-create__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.abtest-create__cancel {
  padding: 0.5rem 1.5rem;
  border: 1px solid #2a2f4e;
  border-radius: 6px;
  background: transparent;
  color: #8b8fa3;
  cursor: pointer;
}

/* Detail page */
.abtest-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: #e2e4ec;
}

.abtest-detail__back {
  font-size: 0.82rem;
  color: #635bff;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 0;
}

.abtest-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.abtest-detail__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.abtest-detail__conclude-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  background: #22c55e;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.abtest-detail__conclude-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.abtest-detail__hypothesis {
  font-size: 0.9rem;
  color: #8b8fa3;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.abtest-detail__meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: #6b7080;
  margin-bottom: 1.25rem;
}

/* Loading & error */
.abtests-loading {
  text-align: center;
  color: #8b8fa3;
  padding: 2rem 0;
}

.abtests-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
