/**
 * EPF Share Modal Styles
 * Based on ep-share-with-friend patterns for consistency
 */

#epf-share-root {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
}

#epf-share-root[hidden] {
  display: none;
}

#epf-share-root.is-open {
  pointer-events: auto;
}

.epf-share-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#epf-share-root.is-open .epf-share-backdrop {
  opacity: 1;
}

.epf-share-panel {
  position: fixed;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 16px;
  max-width: 360px;
  width: 90%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.epf-share-panel.is-active {
  opacity: 1;
  pointer-events: auto;
}

.epf-share-panel--desktop {
  transform: translateY(6px);
}

.epf-share-panel--desktop.is-active {
  transform: translateY(0);
}

.epf-share-panel--mobile {
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 18px 18px 0 0;
  max-width: none;
  width: 100%;
  transform: translateY(100%);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.epf-share-panel--mobile.is-active {
  transform: translateY(0);
}

.epf-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.epf-share-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #111;
}

.epf-share-close {
  background: #f3f3f3;
  border: 0;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.epf-share-close:hover,
.epf-share-close:focus {
  background: #e5e5e5;
  outline: none;
}

.epf-share-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px 0;
}

.epf-share-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.epf-share-url-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #f9f9f9;
  color: #333;
}

.epf-share-url-input:focus {
  outline: none;
  border-color: #999;
}

.epf-share-copy-btn {
  padding: 10px 16px;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.epf-share-copy-btn:hover,
.epf-share-copy-btn:focus {
  background: #333;
  outline: none;
}

.epf-share-copied {
  font-size: 12px;
  color: #16a34a;
  margin-bottom: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.epf-share-copied.is-visible {
  opacity: 1;
}

.epf-share-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: space-between;
  overflow-x: auto;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.epf-share-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: #222;
  flex: 1 1 0;
  min-width: 0;
  max-width: 72px;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.epf-share-action:focus {
  outline: none;
}

.epf-share-action__icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
}

.epf-share-action[data-action="pinterest"] .epf-share-action__icon {
  background: #e60023;
  color: #fff;
}

.epf-share-action[data-action="facebook"] .epf-share-action__icon {
  background: #1877f2;
  color: #fff;
}

.epf-share-action__icon svg {
  width: 36px;
  height: 36px;
  display: block;
}

.epf-share-action__label {
  white-space: nowrap;
}

.epf-share-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000000;
}

.epf-share-toast.is-visible {
  opacity: 1;
}

body.epf-share-open {
  overflow: hidden;
}

/* Hide MVP bar when share modal is open on mobile */
body.epf-share-open .ep-mvp-bar {
  display: none !important;
}

@media (max-width: 980px) {
  .epf-share-panel--mobile {
    padding: 18px 18px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .epf-share-url-row {
    flex-direction: column;
  }

  .epf-share-copy-btn {
    width: 100%;
  }
}
