/* ==========================================================================
   CompareHeights — Share Card & Preview Modal Styling (Phase 2B)
   1080x1350 aspect-ratio: 4/5 branded social share card
   ========================================================================== */

/* Preview Modal Backdrop */
.share-card-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-card-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Dialog Window */
.share-card-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(226, 232, 240, 0.8);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-card-modal-backdrop.open .share-card-modal {
  transform: scale(1);
}

/* Modal Header */
.share-card-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.share-card-modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-card-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.share-card-modal-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
}

.share-card-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}

.share-card-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Modal Body / Image Preview Canvas Container */
.share-card-modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f1f5f9;
}

.share-card-preview-wrapper {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 4 / 5;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-card-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Modal Footer & Actions */
.share-card-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.share-card-modal-meta {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
}

.share-card-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-card-cancel {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.btn-card-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-card-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  border: none;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
  transition: background 0.12s ease, transform 0.1s ease;
}

.btn-card-download:hover {
  background: #1d4ed8;
}

.btn-card-download:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Phase 2C: Desktop Share Fallback Modal
   ========================================================================== */

.share-fallback-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

.share-fallback-backdrop.visible {
  display: flex;
}

.share-fallback-dialog {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  animation: scaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-fallback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.share-fallback-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-fallback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #eff6ff;
  border-radius: 8px;
}

.share-fallback-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.share-fallback-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.share-fallback-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.share-fallback-body {
  padding: 20px;
}

.share-fallback-preview-text {
  margin: 0 0 16px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  word-break: break-word;
}

.share-fallback-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-fallback-url-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: monospace;
  color: #1e293b;
  background: #ffffff;
  outline: none;
}

.share-fallback-url-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.share-fallback-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.share-fallback-btn-copy:hover {
  background: #1d4ed8;
}

.share-fallback-btn-copy.copied {
  background: #10b981;
}

.share-fallback-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.share-fallback-btn-cancel {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.share-fallback-btn-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
}
