/* =========================================================
   FRONT-END FLYER BUILDER
========================================================= */

.mcf-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 980px;
  margin: 2em auto;
  color: #222;

  /* NEW: make children flex items so Step 1/2 can sit side-by-side */
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;     /* space between columns */
  row-gap: 22px;        /* space between rows */
}

/* sanity for width math */
.mcf-wrap, .mcf-wrap * { box-sizing: border-box; }

.mcf-step {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1em;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* lift the badges */
.mcf-step::before {
  content: attr(data-step);
  position: absolute;
  top: -28px; /* raised */
  left: 16px;
  z-index: 2;
  background: #2271b1; /* WordPress blue */
  color: #fff;
  font-weight: bold;
  padding: 0.3em 0.7em;
  border-radius: 6px;
  font-size: 0.9em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* --- FLEX LAYOUT RULES --- */
/* Step 1 = 65%, Step 2 = 35% (same row) */
.mcf-step[data-step="Step 1"] { flex: 1 1 65%; }
.mcf-step[data-step="Step 2"] { flex: 1 1 35%; }

/* Canvas and Step 4 each take full width row */
.mcf-canvas-wrap,
.mcf-step[data-step="Step 4"] { flex: 0 0 100%; }

/* extra breathing room before canvas/step 4 block */
.mcf-canvas-wrap { margin-top: 6px; }
.mcf-step[data-step="Step 4"] { margin-top: 8px; }

/* Stack Step 1/2 on smaller screens */
@media (max-width: 820px) {
  .mcf-step[data-step="Step 1"],
  .mcf-step[data-step="Step 2"] {
    flex: 0 0 100%;
  }
}

.mcf-canvas-wrap {
  position: relative; /* overlay & confetti anchor */
  border: 2px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  background: #f9f9f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mcf-canvas-wrap canvas {
  width: 100%;
  display: block;
}

/* Floating Controls Overlay */
.mcf-float-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: all 0.4s ease;
  cursor: default;
  z-index: 2;
}
.mcf-float-controls.visible { opacity: 1; pointer-events: auto; transform: scale(1); }

.mcf-float-controls label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9em;
  color: #222;
}
.mcf-float-controls input[type="range"] { width: 140px; }

/* =========================================================
   ACTIONS (Step 4) — responsive
========================================================= */

.mcf-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;

  /* mobile: allow wrapping; desktop: keep one line */
  flex-wrap: wrap;
  row-gap: 10px;
}
@media (min-width: 601px) {
  .mcf-actions { flex-wrap: nowrap; }
}

.mcf-sfx {
  margin-right: auto; /* push buttons to right */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #1d2327;
}

/* Name field */
.mcf-name-input {
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  padding: 0.5em 0.75em;
  min-width: 220px;
  font-size: 14px;
  flex: 1 1 220px;
}

/* Buttons */
.mcf-btn {
  background: #2271b1;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  flex: 0 0 auto; /* don't shrink */
}
.mcf-btn:hover { background: #135e96; }

/* very small screens */
@media (max-width: 480px) {
  .mcf-name-input {
    min-width: 140px;
    padding: 0.45em 0.6em;
    font-size: 13px;
    flex: 1 1 100%;  /* can take a full row when wrapping */
  }
  .mcf-btn {
    padding: 0.5em 0.75em;
    font-size: 13px;
  }
  .mcf-sfx { font-size: 13px; }
}

/* Step 2 upload button (WP primary styles) */
.mcf-upload-btn.button-primary {
  background: #2271b1;
  border-color: #2271b1;
}
.mcf-upload-btn.button-primary:hover {
  background: #135e96;
  border-color: #135e96;
}

/* Confetti overlay */
.mcf-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* =========================================================
   ADMIN DASHBOARD (WORDPRESS STYLE)
========================================================= */

.wrap h1 { color: #1d2327; font-weight: 600; }

table.form-table th {
  width: 220px;
  vertical-align: top;
  padding-top: 10px;
  color: #1d2327;
  font-weight: 500;
}

table.form-table input[type="text"],
table.form-table input[type="number"] { width: 260px; }

table.widefat {
  margin-top: 1em;
  border-radius: 8px;
  overflow: hidden;
}
table.widefat th {
  background: #f0f0f1;
  color: #1d2327;
  font-weight: 600;
  padding: 10px 8px;
}
table.widefat td { vertical-align: middle; padding: 6px 8px; }
table.widefat tr:nth-child(even) { background: #fafafa; }

.mcf-remove-row { color: #b32d2e; text-decoration: none; }
.mcf-remove-row:hover { color: #dc3232; text-decoration: underline; }

/* Save button (WP blue) */
#submit.button-primary {
  background: #2271b1;
  border-color: #2271b1;
  box-shadow: 0 1px 0 #135e96;
  text-shadow: none;
}
#submit.button-primary:hover {
  background: #135e96;
  border-color: #135e96;
}

/* Media buttons */
.mcf-media-btn {
  background: #f6f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #2271b1;
  font-weight: 500;
  margin-left: 4px;
  padding: 2px 8px;
}
.mcf-media-btn:hover {
  background: #2271b1;
  color: #fff;
}
