/* rewards.css - Channel Rewards page.
   Layout, cards and inputs are inherited from settings.css; this file only
   adds what is specific to rewards: the setup wizard banner, status pills,
   the per-reward action row and the Power-up section. */

/* ---- Setup wizard banner (shown right after the bot was added) ---------- */
.setup-steps {
  max-width: 950px;
  margin: 0 auto 1.5rem auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(165, 109, 255, 0.18), rgba(209, 0, 255, 0.1));
  border: 1px solid rgba(165, 109, 255, 0.4);
}

.setup-steps-text {
  flex: 1;
  min-width: 260px;
}

.setup-steps-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d1b3ff;
  margin-bottom: 0.35rem;
}

.setup-steps h3 {
  margin: 0 0 0.35rem 0;
  color: white;
  font-size: 1.1rem;
}

.setup-steps p {
  margin: 0;
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.4;
}

.setup-steps-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.setup-skip {
  color: #bbb;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
}

.setup-skip:hover {
  color: white;
}

.setup-continue {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #a56dff, #d100ff);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.setup-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(165, 109, 255, 0.35);
}

/* ---- Notices ------------------------------------------------------------ */
.reward-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #ddd;
  margin-bottom: 1.25rem;
}

.reward-notice i {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.reward-notice strong {
  color: white;
  display: block;
  margin-bottom: 0.15rem;
}

.reward-notice-warning {
  background: rgba(255, 183, 77, 0.1);
  border: 1px solid rgba(255, 183, 77, 0.35);
}

.reward-notice-warning i {
  color: #ffb74d;
}

.reward-notice-info {
  background: rgba(165, 109, 255, 0.08);
  border: 1px solid rgba(165, 109, 255, 0.3);
}

.reward-notice-info i {
  color: #a56dff;
}

.reward-notice-danger {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.35);
}

.reward-notice-danger i {
  color: #ff6b6b;
}

/* Inline hint that sits under a specific field */
.field-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #ffb74d;
}

.field-hint.field-hint-conflict {
  color: #ff6b6b;
  font-weight: 600;
}

/* ---- Reward list (one row per reward, opens the editor overlay) ---------- */
.reward-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reward-row:hover {
  background: rgba(165, 109, 255, 0.08);
  border-color: rgba(165, 109, 255, 0.4);
  transform: translateY(-1px);
}

.reward-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(165, 109, 255, 0.15);
  color: #a56dff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.reward-row-main {
  flex: 1;
  min-width: 0;
}

.reward-row-title {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.reward-row-summary {
  display: block;
  color: #999;
  font-size: 0.82rem;
  line-height: 1.35;
}

.reward-row-chevron {
  color: #777;
  flex-shrink: 0;
}

.reward-row:hover .reward-row-chevron {
  color: #a56dff;
}

/* ---- Editor overlay ------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 1rem 8rem 1rem;
  overflow-y: auto;
}

.modal-panel {
  width: 100%;
  max-width: 720px;
  background: #14101f;
  border: 1px solid rgba(165, 109, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.18s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(165, 109, 255, 0.08);
  border-radius: 14px 14px 0 0;
}

.modal-heading h2 {
  margin: 0 0 0.25rem 0;
  color: #a56dff;
  font-size: 1.15rem;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

/* The action row sits at the top of the panel, above the fields. Qualified
   with .modal-panel so it outranks the .reward-actions base rule further down
   the file, which shares its specificity. */
.modal-panel .modal-actions {
  padding: 1rem 1.5rem;
  margin-top: 0;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-ok {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #7bd47f;
}

.status-paused {
  background: rgba(255, 183, 77, 0.15);
  border: 1px solid rgba(255, 183, 77, 0.4);
  color: #ffb74d;
}

.status-disabled {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #bbb;
}

.status-missing {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #999;
}

.status-broken {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #ff6b6b;
}

/* ---- Inputs not covered by settings.css --------------------------------- */
.setting-control input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
}

.setting-control select,
.setting-control textarea {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.setting-control select:focus,
.setting-control textarea:focus {
  outline: none;
  border-color: #a56dff;
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.1);
}

.setting-control select option {
  background: #1a1a1a;
  color: white;
}

.setting-control textarea {
  min-width: 260px;
  max-width: 320px;
  resize: vertical;
}

.setting-control input.reward-title-input {
  min-width: 220px;
}

/* A limit field: the toggle enables it, the number sits next to it */
.limit-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.limit-control input[type="number"] {
  width: 90px;
}

.limit-control input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Live preview of the resulting reward title */
.title-preview {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #a56dff;
}

.title-preview span {
  color: #ddd;
}

/* ---- Action row --------------------------------------------------------- */
.reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reward-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #ddd;
  transition: all 0.2s ease;
}

.reward-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.reward-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.reward-btn-primary {
  background: linear-gradient(135deg, #a56dff, #d100ff);
  border-color: transparent;
  color: white;
}

.reward-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #b47dff, #dd1aff);
  box-shadow: 0 6px 18px rgba(165, 109, 255, 0.3);
}

.reward-btn-danger {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
}

.reward-btn-danger:hover:not(:disabled) {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
}

/* ---- Power-ups ---------------------------------------------------------- */
.powerup-section {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.powerup-section h3 {
  margin: 0 0 0.35rem 0;
  color: #a56dff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.powerup-section .setting-description {
  margin-bottom: 0.75rem;
}

.powerup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.powerup-row select {
  min-width: 220px;
}

.powerup-meta {
  margin: 0.6rem 0 0 0;
  font-size: 0.8rem;
  color: #bbb;
}

.powerup-meta strong {
  color: #ddd;
}

.powerup-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.powerup-links a {
  font-size: 0.8rem;
  color: #a56dff;
  text-decoration: none;
}

.powerup-links a:hover {
  text-decoration: underline;
}

/* ---- Legacy rewards ----------------------------------------------------- */
.legacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.legacy-row:last-child {
  border-bottom: none;
}

.legacy-row .legacy-title {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.legacy-row .legacy-type {
  color: #888;
  font-size: 0.78rem;
}

/* settings.css already stacks .setting-item at this width; only the fields
   this page adds need their widths relaxed. */
@media (max-width: 768px) {
  .setting-control textarea,
  .setting-control select,
  .setting-control input.reward-title-input,
  .powerup-row select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .setup-steps-actions {
    width: 100%;
    justify-content: space-between;
  }

  .modal-backdrop {
    padding: 0 0 9rem 0;
  }

  .modal-panel {
    border-radius: 0;
    min-height: 100%;
  }

  .modal-header {
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #191327;
  }

  /* .modal-panel qualifier to match the specificity used above */
  .modal-panel .modal-actions,
  .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .reward-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
