/* ============================================
   GLOBAL STYLES
============================================ */

:root {
  --sage-dark: #4c6a57;
  --sage-light: #dfe7e1;
  --border-soft: #e8e8e8;
  --text-main: #6f4d4d; /* warm brown */
  --radius-card: 14px;
  --shadow-soft: 0 3px 6px rgba(0,0,0,0.06);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  color: var(--text-main);
}

/* ============================================
   HEADER
============================================ */

.app-header {
  position: relative;
  text-align: center;
  padding: 20px 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-soft);
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--sage-dark);
}

.app-header p {
  margin-top: 6px;
  font-size: 13px;
  color: #888;
}

/* small phoenix logo in top-right */
.header-logo {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 90px;
  height: auto;
}

/* Customer/Admin mode toggle */
.mode-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #f2f4f2;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  margin-top: 10px;
}

.mode-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: #555;
}

.mode-btn-active {
  background: var(--sage-light);
  color: #1f3921;
}

/* ============================================
   TITLE
============================================ */

.section-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
  margin: 20px 0 12px;
}

/* ============================================
   GRID (THREE ITEMS PER ROW)
   Used for beads, charms, and bookmarks
============================================ */

/* BEADS GRID — closer together */
.bead-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 10px;   /* space left/right */
  row-gap: 12px;      /* space up/down */
  padding: 4px 16px 24px;
}

/* CHARMS GRID — more space */
.charm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 16px;   /* more breathing room */
  row-gap: 20px;
  padding: 4px 16px 24px;
}

/* ============================================
   CHARM CATEGORY TABS (All / Dogs / Hearts / Mystical)
   ============================================ */

.charm-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.charm-tab {
  padding: 10px 18px;
  background: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: 0.25s;
  user-select: none;      /* prevents text highlight on iPad */
  -webkit-tap-highlight-color: transparent;  /* removes blue tap flash */
}

.charm-tab:hover {
  background: #e8e8e8;
}

.charm-tab.active {
  background: #7a8c7a;
  color: white;
  border-color: #7a8c7a;
}

/* base card styles for all three types */
.bead-card,
.charm-card,
.bookmark-card {
  background: none;
  border: none;
  padding: 0;
  text-align: center;
  cursor: pointer;
}

/* circular images for beads + charms */
.bead-image,
.charm-image {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
  background: #f2f2f2;
}

/* tall/slim bookmark images */
.bookmark-image {
  width: 90px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
  background: #f2f2f2;
}

/* SELECTED OUTLINE */
.bead-card.selected .bead-image,
.charm-card.selected .charm-image,
.bookmark-card.selected .bookmark-image {
  outline: 3px solid var(--sage-dark);
  outline-offset: 4px;
}

/* CODE LABELS */
.bead-code,
.charm-code,
.bookmark-code {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* NAMES / EXTRA TEXT */
.bead-name,
.bead-size,
.charm-name,
.bookmark-name {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.2em;
}

/* extra bookmark framing (tall + slim card look) */
.bookmark-card {
  width: 110px;
  height: 240px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid #ddd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  transition: 0.2s ease;
}

.bookmark-card:hover {
  transform: scale(1.05);
  border-color: #bbb;
}

.bookmark-card.selected {
  border-color: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.bookmark-name {
  font-size: 12px;
  color: #555;
  text-align: center;
}

/* ============================================
   SELECTED LISTS
============================================ */

.selected-section {
  padding: 16px;
}

.selected-section h2 {
  color: var(--sage-dark);
  font-size: 16px;
  margin-bottom: 8px;
}

.selected-list {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-soft);
  list-style: none;
  margin: 0;
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.selected-item:last-child {
  border-bottom: none;
}

.selected-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #f2f2f2;
}

.selected-label {
  display: flex;
  flex-direction: column;
}

.selected-code {
  font-weight: 600;
  font-size: 13px;
}

.selected-name {
  font-size: 12px;
  color: #777;
}

.remove-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
}

.remove-btn:hover {
  color: #c0392b;
}

/* ============================================
   PRICE SUMMARY SECTION
============================================ */

.price-summary {
  background: #ffffff;
  border-radius: 12px;
  margin: 20px 16px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  font-size: 15px;
}

.price-summary div {
  margin-bottom: 4px;
}

.price-total {
  margin-top: 6px;
  font-weight: 700;
  color: var(--sage-dark);
  font-size: 17px;
}

/* ============================================
   “Next: Review Your Design” BUTTON
============================================ */

.next-review {
  width: 80%;
  margin: 30px auto 20px;
  background: #fbeaea;
  color: var(--text-main);
  text-align: center;
  padding: 16px;
  border-radius: 24px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}

/* ============================================
   FOOTER BUTTONS
============================================ */

.app-footer {
  position: static;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
}

#clear-selection,
.pay-btn {
  flex: 1;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

#clear-selection {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  color: #444;
}

.pay-btn {
  background: var(--sage-dark);
  color: white;
  border: none;
}

/* ============================================
   ADMIN MODE
============================================ */

.hidden {
  display: none;
}

#admin-view {
  padding: 16px;
}

#admin-lock {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

#admin-lock input[type="password"] {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

#admin-lock button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  background: var(--sage-dark);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.admin-block {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.admin-block h3 {
  margin-top: 0;
  font-size: 15px;
  color: var(--sage-dark);
}

.admin-block label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.admin-block input[type="text"],
.admin-block input[type="file"] {
  width: 100%;
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
}

.admin-block input[type="checkbox"] {
  margin-right: 4px;
}

.admin-block button {
  margin-top: 6px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  background: var(--sage-dark);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.admin-hint {
  font-size: 12px;
  color: #777;
  margin: 4px 0 8px;
}

.processing-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}

.admin-item:last-child {
  border-bottom: none;
}

.payment-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.payment-pill.paid {
  background-color: rgba(120, 200, 140, 0.2);
  border: 1px solid #4c9a5a;
  color: #275734;
}

.payment-pill.pending {
  background-color: rgba(240, 200, 120, 0.2);
  border: 1px solid #c38b2c;
  color: #7a5313;
}

/* ============================================
   CUSTOMER VIEW PHOENIX BACKGROUND
============================================ */

.customer-bg {
  position: relative;
  z-index: 0;
}

.customer-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/phoenix.png");
  background-repeat: no-repeat;
  background-position: center 70px;
  background-size: 750px;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

/* ============================================
   RESPONSIVE
============================================ */

@media (min-width: 768px) {
  .app-header {
    text-align: left;
    padding-left: 24px;
  }

  .section-title {
    font-size: 22px;
  }

  .app-footer {
    max-width: 1000px;
    margin: 0 auto;
  }
}

/* ========== WIZARD STEPS ========== */

.step-indicator {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 4px 0 10px;
}

.wizard-step {
  display: none;
  padding-bottom: 80px; /* extra space so content doesn't hide behind buttons */
}

.wizard-step.active-step {
  display: block;
}

.wizard-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 24px;
  padding: 0 16px;
}

.wizard-btn {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #444;
  font-weight: 500;
}

.wizard-next {
  background: var(--sage-dark);
  color: #fff;
  border-color: var(--sage-dark);
}

/* Pay button is only shown on final step via JS */
.pay-btn {
  display: none;
}

/* ============================================
   CHECKOUT FORM ON REVIEW STEP
============================================ */

.checkout-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  margin: 10px 16px 0;
  font-size: 14px;
}

.checkout-form label {
  display: block;
  margin-bottom: 10px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.admin-orders-section {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f8f8f8;
}

.admin-orders-section h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.admin-orders-help {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: #666;
}

.admin-orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* =====================================
   BOOKMARK GRID — 4 per row
   ===================================== */

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 10px 0;
}

/* Card styling to match bead + charm cards */
.bookmark-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid #e5e5e5;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  cursor: pointer;
}

/* Bookmark image uniform sizing */
.bookmark-card .bookmark-image {
  width: 100%;
  height: auto;
  max-height: 160px; /* feel free to adjust */
  object-fit: contain;
  margin-bottom: 8px;
}

/* =========================
   ADMIN PREVIEW BADGE
   ========================= */
.admin-badge {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;

  background: #4c6a57; /* sage green */
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;

  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);

  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-badge span {
  opacity: 0.85;
}