/*!
 * Share-page UI (header trigger + modal). Loaded by index.html where only styles.min.css
 * is used; other pages already include these rules via main.css.
 * Source of truth: assets/css/main.css (keep in sync when editing share UI).
 */

.global-share-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--dark-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.global-share-btn:hover {
  background: rgba(58, 90, 254, 0.2);
  border-color: rgba(108, 140, 255, 0.38);
  color: #ffffff;
  transform: translateY(-1px);
}

.light-mode .global-share-btn {
  background: rgba(58, 90, 254, 0.1);
  border-color: rgba(58, 90, 254, 0.16);
  color: var(--primary-dark);
}

.light-mode .global-share-btn:hover {
  background: var(--primary-medium);
  color: #ffffff;
}

.global-share-mobile-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--dark-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  text-align: start;
  transition: var(--transition);
}

.global-share-mobile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.light-mode .global-share-mobile-btn:hover {
  background: var(--mobile-dropdown-hover);
  color: var(--primary-dark);
  transform: translateX(5px);
}

.light-mode .mobile-links a:hover {
  background: var(--mobile-dropdown-hover);
  color: var(--primary-dark);
  transform: translateX(5px);
}

body.global-share-modal-open {
  overflow: hidden;
}

.global-share-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.global-share-modal.is-open {
  display: flex;
}

.global-share-card {
  position: relative;
  width: min(100%, 520px);
  padding: 2.3rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top, rgba(58, 90, 254, 0.16), transparent 32%),
    rgba(10, 15, 44, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  color: #ffffff;
  text-align: center;
}

.light-mode .global-share-card {
  border-color: rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at top, rgba(58, 90, 254, 0.1), transparent 34%),
    #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

.global-share-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

html[dir="rtl"] .global-share-close,
.global-share-card[dir="rtl"] .global-share-close {
  right: auto;
  left: 1rem;
}

.global-share-close:hover {
  background: rgba(58, 90, 254, 0.22);
  color: #ffffff;
}

.light-mode .global-share-close {
  background: rgba(15, 23, 42, 0.06);
  color: #1e293b;
}

.light-mode .global-share-close:hover {
  background: var(--primary-medium);
  color: #ffffff;
}

.global-share-card h2 {
  margin: 0 2rem 0.45rem;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.global-share-subtitle {
  margin: 0 0 1.6rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 1rem;
}

.light-mode .global-share-subtitle {
  color: rgba(30, 41, 59, 0.72);
}

.global-share-socials {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.global-share-social-btn {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}

.global-share-social-btn:hover {
  transform: translateY(-3px);
  background: var(--primary-medium);
  border-color: rgba(255, 255, 255, 0.28);
}

.light-mode .global-share-social-btn {
  background: rgba(58, 90, 254, 0.08);
  border-color: rgba(58, 90, 254, 0.12);
  color: var(--primary-dark);
}

.light-mode .global-share-social-btn:hover {
  background: var(--primary-medium);
  color: #ffffff;
}

.global-share-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.35rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .global-share-link-row {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
}

.global-share-url {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.93rem;
  padding: 0 0.85rem;
  outline: none;
}

.global-share-copy-btn {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--primary-medium);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 1.1rem;
  white-space: nowrap;
  transition: var(--transition);
}

.global-share-copy-btn:hover {
  background: #2848e8;
}

@media (max-width: 560px) {
  .global-share-modal {
    padding: 1rem;
  }

  .global-share-card {
    padding: 2rem 1.15rem 1.2rem;
    border-radius: 20px;
  }

  .global-share-card h2 {
    margin-left: 1.6rem;
    margin-right: 1.6rem;
  }

  .global-share-social-btn {
    width: 48px;
    height: 48px;
  }

  .global-share-link-row {
    grid-template-columns: 1fr;
    padding: 0.55rem;
  }

  .global-share-url {
    min-height: 42px;
    padding: 0 0.55rem;
    text-align: center;
  }

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