/* Buddy PWA — Share sheet styles */

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  pointer-events: none;
}
.share-sheet.show {
  display: block;
  pointer-events: auto;
}
.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity .25s ease;
}
.share-sheet.show .share-backdrop {
  opacity: 1;
}
.share-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #14161a;
  color: #e8eaed;
  border-radius: 18px 18px 0 0;
  padding: 8px 18px 24px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.2,.8,.25,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,.45);
}
.share-sheet.show .share-panel {
  transform: translateY(0);
}
.share-grip {
  width: 44px;
  height: 4px;
  background: #3a3f47;
  border-radius: 4px;
  margin: 4px auto 10px;
}
.share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.share-title {
  font-size: 18px;
  font-weight: 600;
}
.share-close {
  background: transparent;
  color: #888;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.share-hint {
  font-size: 12px;
  color: #888;
  margin: 0 0 12px;
}
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 380px) {
  .share-grid { grid-template-columns: repeat(3, 1fr); }
}
.share-tile {
  background: #1c1f24;
  border: 1px solid #262a30;
  color: #e8eaed;
  border-radius: 12px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.share-tile:active {
  transform: scale(.96);
  background: #23272d;
}
.share-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--tile-color, #444);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.share-tile-label {
  font-size: 12px;
  color: #cfd2d6;
}
.share-row-secondary {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.share-mini {
  flex: 1;
  background: #1c1f24;
  border: 1px solid #262a30;
  color: #cfd2d6;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
}
.share-mini:active {
  background: #23272d;
}

/* Compose view */
.share-view-compose {
  padding-top: 4px;
}
.share-back {
  background: transparent;
  border: none;
  color: #7aa7ff;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 8px;
}
.share-platform-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.share-platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.share-platform-name {
  font-size: 16px;
  font-weight: 500;
}
.share-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 0;
}
.share-spinner .spin {
  width: 28px;
  height: 28px;
  border: 3px solid #2a2f37;
  border-top-color: #7aa7ff;
  border-radius: 50%;
  animation: share-spin .8s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }
.share-spinner-text {
  color: #888;
  font-size: 13px;
}
.share-error {
  color: #ff6b6b;
  padding: 20px;
  text-align: center;
  font-size: 13px;
}
.share-image-preview {
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1c20;
}
.share-image-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.share-image-aspect-hint {
  padding: 6px 10px;
  font-size: 11px;
  color: #888;
  background: #181a1e;
}
.share-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #888;
  margin-bottom: 6px;
}
.share-input,
.share-textarea {
  width: 100%;
  background: #1c1f24;
  border: 1px solid #2a2f37;
  color: #e8eaed;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  box-sizing: border-box;
}
.share-textarea {
  resize: vertical;
  min-height: 140px;
}
.share-subject-row {
  margin-bottom: 12px;
}
.share-char-count {
  text-align: right;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}
.share-char-count.over {
  color: #ff6b6b;
  font-weight: 600;
}
.share-notes {
  margin-top: 10px;
  padding: 10px;
  background: #1a1c20;
  border-radius: 8px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.4;
}
.share-notes:empty { display: none; }
.share-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.share-btn-primary,
.share-btn-secondary {
  flex: 1;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.share-btn-primary {
  background: #7aa7ff;
  color: #0b0d10;
}
.share-btn-primary:active {
  transform: scale(.98);
}
.share-btn-secondary {
  background: #1c1f24;
  color: #cfd2d6;
  border: 1px solid #262a30;
}

/* Share button on artifact cards */
.art-share-btn {
  background: #1c1f24;
  border: 1px solid #262a30;
  color: #cfd2d6;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 6px;
}
.art-share-btn:active { background: #23272d; }
.art-share-btn-inline {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(28, 31, 36, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #2a2f37;
  color: #e8eaed;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: #1c1f24;
  color: #e8eaed;
  border: 1px solid #2a2f37;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10001;
  max-width: 80vw;
  text-align: center;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.share-open {
  overflow: hidden;
}
