/* ── Overlay ────────────────────────────────────────── */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: shareFadeIn 0.25s ease;
}

@keyframes shareFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Modal Sheet ────────────────────────────────────── */
.share-modal {
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 95vh;
  overflow-y: auto;
  padding: 0 0 32px;
  animation: shareSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

@keyframes shareSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ── Header ─────────────────────────────────────────── */
.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.share-modal-header h3 {
  font-size: 1.05em;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 9px;
}

.share-modal-header h3 i {
  color: #1e3a5f;
  font-size: 0.9em;
}

.share-close-btn {
  width: 32px;
  height: 32px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85em;
  transition: all 0.15s;
}
.share-close-btn:hover {
  background: #fee2e2;
  color: #e11d48;
  border-color: #fecdd3;
}

/* ── Nama Input Row ──────────────────────────────────── */
.share-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 22px 12px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
  border: 1.5px solid #dbeafe;
  border-radius: 14px;
}

.share-name-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1e3a5f, #0f3460);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-size: 0.9em;
  flex-shrink: 0;
}

.share-name-field {
  flex: 1;
  min-width: 0;
}

.share-name-field label {
  display: block;
  font-size: 0.7em;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.share-name-field input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.95em;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  padding: 0;
}

.share-name-field input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* ── Canvas Preview Wrapper ──────────────────────────── */
.share-canvas-wrap {
  position: relative;
  margin: 0 22px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  /* Skala canvas 540x960 → tampil 100% width modal */
  aspect-ratio: 9 / 16;
  background: #0a1628;
}

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

.share-canvas-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 22, 40, 0.85);
  color: #ffd700;
  font-size: 0.9em;
  font-weight: 600;
}

/* ── Quote Row ───────────────────────────────────────── */
.share-quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 22px 4px;
  padding: 10px 14px;
  background: #fefce8;
  border: 1.5px solid #fef08a;
  border-radius: 12px;
}

.share-quote-label {
  font-size: 0.8em;
  font-weight: 700;
  color: #854d0e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-quote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #1e3a5f;
  color: #ffd700;
  border: none;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.share-quote-btn:hover {
  background: #0f3460;
  transform: scale(1.03);
}
.share-quote-btn:active {
  transform: scale(0.97);
}

/* ── Action Buttons ──────────────────────────────────── */
.share-actions {
  display: flex;
  gap: 10px;
  margin: 14px 22px 4px;
}

.share-btn-download,
.share-btn-copy {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 0.9em;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.share-btn-download {
  background: linear-gradient(135deg, #1e3a5f, #0f3460);
  color: #ffd700;
  box-shadow: 0 4px 16px rgba(15, 52, 96, 0.35);
}
.share-btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 52, 96, 0.45);
}
.share-btn-download:active {
  transform: scale(0.97);
}

.share-btn-copy {
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}
.share-btn-copy:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Hint text ───────────────────────────────────────── */
.share-hint {
  text-align: center;
  font-size: 0.76em;
  color: #94a3b8;
  margin: 10px 22px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.5;
}
.share-hint i {
  font-size: 0.9em;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* ── Tombol Share di Stats/Home ──────────────────────── */
.share-progress-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #1e3a5f, #0f3460);
  color: #ffd700;
  border: none;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(15, 52, 96, 0.3);
  letter-spacing: 0.2px;
}
.share-progress-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 52, 96, 0.4);
}
.share-progress-btn:active {
  transform: scale(0.97);
}
.share-progress-btn i {
  font-size: 0.95em;
}

/* ── Dark Mode ───────────────────────────────────────── */
body.dark-mode .share-modal {
  background: #1e293b;
}
body.dark-mode .share-modal-header {
  background: #1e293b;
  border-bottom-color: #334155;
}
body.dark-mode .share-modal-header h3 {
  color: #f1f5f9;
}
body.dark-mode .share-close-btn {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
}
body.dark-mode .share-name-row {
  background: linear-gradient(135deg, #1e3a5f22, #0f346022);
  border-color: #2563eb44;
}
body.dark-mode .share-name-field input {
  color: #f1f5f9;
}
body.dark-mode .share-name-field label {
  color: #475569;
}
body.dark-mode .share-quote-row {
  background: #1c1a00;
  border-color: #3d3600;
}
body.dark-mode .share-quote-label {
  color: #d97706;
}
body.dark-mode .share-btn-copy {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}
body.dark-mode .share-btn-copy:hover {
  background: #475569;
  color: #f1f5f9;
}
body.dark-mode .share-hint {
  color: #475569;
}
