/**
 * Ayyıldız Spor — Share Modal CSS v3
 * Premium glassmorphism design, branded, fully responsive
 */

/* ── Overlay ── */
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 1100; /* Modal katmanı */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity .35s cubic-bezier(.4,0,.2,1),
              backdrop-filter .35s ease,
              background .35s ease;
  pointer-events: none;
}
.share-overlay.share-overlay--visible {
  opacity: 1;
  pointer-events: auto;
  background: rgba(5, 5, 15, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

/* ── Modal ── */
.share-modal {
  background: linear-gradient(165deg, #141c2e 0%, #0d1321 50%, #0a0f1e 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  transform: translateY(24px) scale(.96);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  box-shadow:
    0 24px 80px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 1px 0 rgba(255,255,255,.06) inset;
  position: relative;
  overflow: hidden;
}
.share-overlay--visible .share-modal {
  transform: translateY(0) scale(1);
}
.share-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(193,18,31,.4) 30%, rgba(193,18,31,.6) 50%, rgba(193,18,31,.4) 70%, transparent);
  z-index: 2;
}
.share-modal::-webkit-scrollbar { width: 3px; }
.share-modal::-webkit-scrollbar-track { background: transparent; }
.share-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* ── Header ── */
.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  position: relative;
  z-index: 1;
}
.share-modal-header span {
  font-size: .8rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: .16em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-modal-header span::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 3px;
  background: #c1121f;
  display: inline-block;
}
.share-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #64748b;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  padding: 0;
}
.share-close:hover {
  color: #f1f5f9;
  background: rgba(193,18,31,.15);
  border-color: rgba(193,18,31,.3);
  transform: rotate(90deg);
}

/* ── Format toggle ── */
.share-format-toggle {
  display: flex;
  gap: 4px;
  margin: 16px 24px 0;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  padding: 4px;
  position: relative;
}
.share-format-toggle button {
  flex: 1;
  background: none;
  border: none;
  color: #64748b;
  font-size: .78rem;
  font-weight: 600;
  padding: .55rem .75rem;
  border-radius: 11px;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  letter-spacing: .02em;
}
.share-format-toggle button.active {
  background: linear-gradient(135deg, rgba(193,18,31,.2), rgba(193,18,31,.08));
  color: #f1f5f9;
  box-shadow: 0 2px 12px rgba(193,18,31,.15), inset 0 1px 0 rgba(255,255,255,.06);
  border: 1px solid rgba(193,18,31,.25);
}
.share-format-toggle button:hover:not(.active) {
  color: #94a3b8;
  background: rgba(255,255,255,.03);
}

/* ── Preview ── */
.share-preview {
  position: relative;
  margin: 16px 24px 0;
  background: #060a14;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 380px;
  border: 1px solid rgba(255,255,255,.04);
}
.share-preview canvas {
  display: block;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 12px;
  transition: opacity .3s ease;
}

/* Loading */
.share-preview-loading {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  z-index: 2;
}
.share-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(255,255,255,.08);
  border-top-color: #c1121f;
  border-radius: 50%;
  animation: share-spin .65s linear infinite;
}
@keyframes share-spin { to { transform: rotate(360deg); } }

/* ── Actions ── */
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px 22px;
}

/* Primary CTA */
.share-btn-native {
  width: 100%;
  padding: .8rem 1rem;
  background: linear-gradient(135deg, #c1121f 0%, #a3101b 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  letter-spacing: .03em;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(193,18,31,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.share-btn-native::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .25s ease;
}
.share-btn-native:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(193,18,31,.35), inset 0 1px 0 rgba(255,255,255,.12);
}
.share-btn-native:hover::before { opacity: 1; }
.share-btn-native:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(193,18,31,.2);
}

/* Secondary buttons grid */
.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.share-buttons button {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: .7rem .5rem;
  color: #cbd5e1;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-align: center;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  letter-spacing: .01em;
}
.share-buttons button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  opacity: 0;
  transition: opacity .2s ease;
}
.share-buttons button:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.12);
  color: #f1f5f9;
}
.share-buttons button:active { transform: translateY(0); }

/* WhatsApp */
.share-btn-whatsapp {
  border-color: rgba(37,211,102,.15) !important;
}
.share-btn-whatsapp::before {
  background: linear-gradient(135deg, rgba(37,211,102,.1), transparent) !important;
}
.share-btn-whatsapp:hover {
  border-color: rgba(37,211,102,.4) !important;
  color: #25D366 !important;
  box-shadow: 0 4px 16px rgba(37,211,102,.12);
}
.share-btn-whatsapp:hover::before { opacity: 1; }

/* Copy */
.share-btn-copy:hover {
  border-color: rgba(96,165,250,.3) !important;
  color: #60a5fa !important;
  box-shadow: 0 4px 16px rgba(96,165,250,.1);
}
.share-btn-copy--copied {
  border-color: rgba(34,197,94,.4) !important;
  color: #22c55e !important;
  background: rgba(34,197,94,.06) !important;
}

/* Download */
.share-btn-download:hover {
  border-color: rgba(251,191,36,.3) !important;
  color: #fbbf24 !important;
  box-shadow: 0 4px 16px rgba(251,191,36,.1);
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .share-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 94vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .share-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .share-overlay--visible .share-modal {
    transform: translateY(0);
  }
  .share-modal-header { padding: 16px 20px 0; }
  .share-modal-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,.15);
  }
  .share-format-toggle { margin: 14px 20px 0; }
  .share-preview {
    margin: 14px 20px 0;
    max-height: 320px;
  }
  .share-preview canvas { max-height: 320px; }
  .share-actions { padding: 14px 20px 24px; }
  .share-btn-native { padding: .7rem .75rem; font-size: .82rem; }
  .share-buttons { gap: 6px; }
  .share-buttons button { padding: .6rem .4rem; font-size: .68rem; }
}

@media (max-width: 360px) {
  .share-preview { max-height: 260px; }
  .share-preview canvas { max-height: 260px; }
}

/* ── Success toast (JS'den tetiklenir) ── */
.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(34,197,94,.3);
  backdrop-filter: blur(12px);
  color: #22c55e;
  font-size: .82rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 50px;
  z-index: 1201; /* Toast — share overlay'in (1100) üstünde */
  opacity: 0;
  transition: all .35s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.share-toast.share-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════
   CARD SHARE BUTTON (kartlardaki paylaş ikonu)
   ═══════════════════════════════════════════ */
.card-share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(10,15,30,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.85) translateY(-4px);
  transition: all .25s cubic-bezier(.16,1,.3,1);
  z-index: 10;
  padding: 0;
  line-height: 1;
}
.card-share-btn svg { width: 15px; height: 15px; }
.card-share-btn:hover {
  background: rgba(193,18,31,.85);
  border-color: rgba(193,18,31,.6);
  transform: scale(1);
  box-shadow: 0 4px 16px rgba(193,18,31,.3);
}

/* Hover'da göster */
.duyuru-card:hover .card-share-btn,
.product-card:hover .card-share-btn,
.fixture-result-card:hover .card-share-btn,
.mc-row:hover .card-share-btn { opacity: 1; transform: scale(1); }

.mc-row { position: relative; }

/* Mobilde sürekli görünür */
@media (hover: none) {
  .card-share-btn { opacity: .8; transform: scale(1); }
}

.duyuru-card { position: relative !important; }
.product-card { position: relative; }
