/* =========================================================
   SOCIAL MEDIA PAGE: "One post, every platform"
   1. Create: Layla's post, pick 6 platforms and a time
   2. Publish: the post appears on each platform, in its own shape
   3. Reply: every message lands in one inbox, one is an order
   ========================================================= */

.sm-screen {
  background: #f6f6fa;
}

/* Platform name badges (names and colours, no logos) */
.pf {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  color: #ffffff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.pf-ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.pf-fb { background: #1877f2; }
.pf-x { background: #111111; }
.pf-li { background: #0a66c2; }
.pf-pin { background: #e60023; }
.pf-tt { background: #111111; box-shadow: -2px 0 0 #25f4ee, 2px 0 0 #fe2c55; }

.sm-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #8a8a9a;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- 1. Create ---------- */

.sm-composer,
.sm-wall {
  position: absolute;
  inset: 0;
  padding: 14px 16px;
  box-sizing: border-box;
  transition: opacity 0.5s, visibility 0.5s, transform 0.5s;
}

.sm-draft {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.sm-draft-img {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff9a5c, #e84393);
  font-size: 32px;
}

.sm-draft strong {
  display: block;
  font-size: 14px;
}

.sm-draft span {
  font-size: 12px;
  color: #777777;
}

.sm-toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sm-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border: 1px solid #e2e2ea;
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 0.3s, background 0.3s;
}

/* The little tick box on each platform */
.sm-toggle::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid #c8c8d4;
  border-radius: 4px;
  box-sizing: border-box;
}

.sm-toggle.on {
  border-color: #6c5ce7;
  background: #f4f1ff;
}

.sm-toggle.on::after {
  content: '✓';
  border-color: #6c5ce7;
  background: #6c5ce7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 10px;
  text-align: center;
}

.sm-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sm-when .sm-label {
  width: 100%;
  margin-bottom: 0;
}

.sm-chip {
  padding: 7px 12px;
  border: 1px solid #e2e2ea;
  border-radius: 99px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}

.sm-chip.on {
  border-color: #6c5ce7;
  background: #6c5ce7;
  color: #ffffff;
}

.sm-schedule {
  margin-left: auto;
  padding: 9px 20px;
  border-radius: 99px;
  background: linear-gradient(135deg, #6c5ce7, #00d2ff);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.sm-schedule.done {
  background: #00a86b;
}

/* ---------- 2. Publish: each platform in its own shape ---------- */

.sm-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "tt ig x  pin"
    "tt fb li pin";
  gap: 10px;
  opacity: 0;
  visibility: hidden;
}

.published .sm-composer {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
}

.published .sm-wall {
  opacity: 1;
  visibility: visible;
}

.sm-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition: opacity 0.5s, transform 0.5s;
}

.published .sm-card {
  opacity: 1;
  transform: none;
}

/* The cards fly in one after another */
.published .sm-card:nth-child(2) { transition-delay: 0.12s; }
.published .sm-card:nth-child(3) { transition-delay: 0.24s; }
.published .sm-card:nth-child(4) { transition-delay: 0.36s; }
.published .sm-card:nth-child(5) { transition-delay: 0.48s; }
.published .sm-card:nth-child(6) { transition-delay: 0.6s; }

.sm-tt { grid-area: tt; }
.sm-ig { grid-area: ig; }
.sm-x { grid-area: x; }
.sm-pin { grid-area: pin; }
.sm-fb { grid-area: fb; }
.sm-li { grid-area: li; }

.sm-card .pf {
  align-self: flex-start;
}

.sm-media {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9a5c, #e84393);
  font-size: 30px;
}

/* TikTok: a tall dark video */
.sm-tt .sm-media {
  position: relative;
  background: linear-gradient(180deg, #2b1b2f, #e84393);
  font-size: 40px;
}

.sm-play {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #ffffff;
  font-size: 13px;
}

.sm-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #333333;
}

.sm-x p,
.sm-li p,
.sm-fb p {
  flex: 1;
}

.sm-count {
  font-size: 11px;
  font-weight: 700;
  color: #555555;
}

/* ---------- 3. Reply: one inbox for everything ---------- */

.sm-inbox {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 50%;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 14px;
  background: #15151c;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  color: #e8e8f0;
  transform: translateX(115%);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.show-inbox .sm-inbox {
  transform: translateX(0);
}

.sm-inbox-head {
  margin-bottom: 4px;
  font-size: 14px;
  color: #ffffff;
}

.sm-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f1f2a;
  border: 1px solid transparent;
  font-size: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s, transform 0.4s, border-color 0.3s;
}

.sm-msg.in {
  opacity: 1;
  transform: none;
}

.sm-msg span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sm-msg em {
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(85, 239, 196, 0.15);
  color: #55efc4;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}

.sm-msg.picked {
  border-color: #55efc4;
}

.sm-reply {
  align-self: flex-end;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px 12px 4px 12px;
  background: #6c5ce7;
  color: #ffffff;
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
}

.show-reply .sm-reply {
  opacity: 1;
  transform: none;
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  .sm-screen {
    height: 470px;
  }

  .sm-toggles {
    grid-template-columns: 1fr 1fr;
  }

  .sm-wall {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr 0.8fr;
    grid-template-areas:
      "tt ig pin"
      "tt x  pin"
      "fb fb li";
    gap: 8px;
    padding: 10px;
  }

  .sm-card p {
    font-size: 10.5px;
  }

  .sm-inbox {
    width: 86%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sm-composer,
  .sm-wall,
  .sm-card,
  .sm-inbox,
  .sm-msg,
  .sm-reply {
    transition: none;
  }
}
