/* ════════════════════════════════════════════════════════════════════
   WanderKids — Share Story modal styling
   /wk-assets/wk-share-story.css
   v1.0 — 2026-05-24
   ══════════════════════════════════════════════════════════════════ */

.wkss-share-ov {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99000;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.wkss-share-ov.on {
  display: flex;
  animation: wkss-share-fade .18s ease;
}
@keyframes wkss-share-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wkss-share-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  max-height: min(92vh, 92dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  animation: wkss-share-up .22s ease;
}
@keyframes wkss-share-up {
  from { transform: translateY(20px); opacity: 0.7; }
  to   { transform: translateY(0);    opacity: 1;   }
}

.wkss-share-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #E8231A, #B83939);
  color: #fff;
}
.wkss-share-hd-t {
  font-size: 15px;
  font-weight: 800;
}
.wkss-share-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.wkss-share-x:hover { background: rgba(255, 255, 255, 0.38); }

.wkss-share-bd {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.wkss-share-ft {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
}

/* Preview canvas wrapper */
.wkss-share-prev-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  min-height: 200px;
}
.wkss-share-prev-wrap > canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.wkss-share-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Toggle nama anak */
.wkss-share-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  font-family: inherit;
  transition: border-color .12s;
}
.wkss-share-toggle:hover { border-color: #E8231A; }
.wkss-share-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #E8231A;
  margin: 0;
}

/* Buttons */
.wkss-share-btn-gray,
.wkss-share-btn-download,
.wkss-share-btn-share {
  padding: 11px 14px;
  border-radius: 9px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  transition: opacity .15s, transform .1s;
}
.wkss-share-btn-gray:active,
.wkss-share-btn-download:active,
.wkss-share-btn-share:active {
  transform: scale(0.97);
}
.wkss-share-btn-share:disabled,
.wkss-share-btn-download:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wkss-share-btn-gray {
  background: #fff;
  border: 1.5px solid #D1D5DB;
  color: #374151;
  padding-left: 16px;
  padding-right: 16px;
}
.wkss-share-btn-gray:hover { background: #F3F4F6; }

.wkss-share-btn-download {
  background: #F3F4F6;
  border: 1.5px solid #D1D5DB;
  color: #111827;
  flex: 1;
}
.wkss-share-btn-download:hover { background: #E5E7EB; }

.wkss-share-btn-share {
  background: linear-gradient(135deg, #E8231A, #B83939);
  color: #fff;
  flex: 1.3;
  box-shadow: 0 4px 14px rgba(232, 35, 26, 0.32);
}
.wkss-share-btn-share:hover {
  opacity: 0.93;
}

/* Foto picker (when >1 fotos) */
.wkss-share-pick-lbl {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 12px;
  font-weight: 600;
}
.wkss-share-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wkss-share-pick-item {
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .12s, transform .08s;
  background: #111827;
}
.wkss-share-pick-item:hover { border-color: #E8231A; }
.wkss-share-pick-item:active { transform: scale(0.97); }
.wkss-share-pick-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .wkss-share-card {
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    align-self: flex-end;
    max-height: 96vh;
    max-height: min(96vh, 96dvh);
  }
  .wkss-share-ov.on { align-items: flex-end; padding: 0; }
  .wkss-share-bd { padding: 14px 16px; }
  .wkss-share-hd { padding: 12px 16px; }
  .wkss-share-ft { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
