/* =========================================================
   Tridentu Share Control - Modern Light Premium Menu
   ========================================================= */

.trident-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.trident-share-btn {
  position: relative;
  isolation: isolate;
  height: 40px;
  min-width: 126px;
  padding: 0 13px 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(11, 18, 32, 0.92);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 820;
  letter-spacing: -0.015em;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 8px 20px rgba(11, 18, 32, 0.055);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.trident-share-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 1px;
  border-radius: 999px;
  background: rgba(0, 191, 255, 0.55);
  opacity: 0;
  transform: scaleX(0.65);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.trident-share-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 191, 255, 0.28);
  background-color: #ffffff;
  color: rgba(11, 18, 32, 0.98);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 12px 26px rgba(11, 18, 32, 0.08);
}

.trident-share-btn:hover::before,
.trident-share.is-open .trident-share-btn::before {
  opacity: 1;
  transform: scaleX(1);
}

.trident-share.is-open .trident-share-btn {
  border-color: rgba(0, 191, 255, 0.32);
  background-color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 12px 26px rgba(11, 18, 32, 0.085);
}

.trident-share-btn:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 6px 16px rgba(11, 18, 32, 0.065);
}

.trident-share-btn:focus-visible,
.trident-share-option:focus-visible {
  outline: 3px solid rgba(0, 191, 255, 0.28);
  outline-offset: 3px;
}

.trident-share-icon-wrap {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  border-radius: 9px;
  background: rgba(0, 191, 255, 0.10);
  border: 1px solid rgba(0, 191, 255, 0.15);
  color: rgba(0, 159, 227, 1);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.trident-share-btn:hover .trident-share-icon-wrap,
.trident-share.is-open .trident-share-icon-wrap {
  background: rgba(0, 191, 255, 0.13);
  border-color: rgba(0, 191, 255, 0.22);
}

.trident-share-icon {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}

.trident-share-label {
  line-height: 1;
}

.trident-share-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: rgba(11, 18, 32, 0.48);
  transition: transform 0.2s ease, color 0.2s ease;
}

.trident-share-btn:hover .trident-share-chevron,
.trident-share.is-open .trident-share-chevron {
  color: rgba(0, 159, 227, 1);
}

.trident-share.is-open .trident-share-chevron {
  transform: rotate(180deg);
}

.trident-share-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 100;
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(11, 18, 32, 0.11);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow:
    0 22px 60px rgba(11, 18, 32, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.95) inset;
  transform-origin: top right;
  animation: trident-share-menu-in 0.16s ease both;
}

@keyframes trident-share-menu-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.trident-share-option {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: rgba(11, 18, 32, 0.92);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.trident-share-option:hover {
  background:
    radial-gradient(130px 64px at 10% 110%, rgba(0, 191, 255, 0.12), transparent 72%),
    rgba(248, 252, 255, 0.96);
  transform: translateY(-1px);
}

.trident-share-option + .trident-share-option {
  margin-top: 3px;
}

.trident-share-option-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(0, 191, 255, 0.16);
  background: rgba(0, 191, 255, 0.09);
  color: rgba(0, 159, 227, 1);
}

.trident-share-option-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.trident-share-option-icon svg[data-icon-style="fill"] {
  fill: currentColor;
}

.trident-share-option-icon svg[data-icon-style="stroke"] {
  fill: none;
  stroke: currentColor;
}

.trident-share-option strong,
.trident-share-option small {
  display: block;
}

.trident-share-option strong {
  margin-bottom: 2px;
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: -0.012em;
}

.trident-share-option small {
  color: rgba(11, 18, 32, 0.56);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.trident-share-hint {
  margin: 8px 4px 2px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.04);
  color: rgba(11, 18, 32, 0.62);
  font-size: 0.76rem;
  line-height: 1.45;
}

.trident-share-feedback {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 102;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(0, 191, 255, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: rgba(0, 159, 227, 1);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(11, 18, 32, 0.10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition:
    opacity 0.16s ease,
    visibility 0.16s ease,
    transform 0.16s ease;
}

.trident-share-feedback.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.trident-share-feedback[data-tone="error"] {
  border-color: rgba(185, 28, 28, 0.18);
  color: #b91c1c;
}

/* Lesson heading alignment */
.share-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.lesson-share-row .trident-share {
  flex: 0 0 auto;
}

/* Term detail page placement */
.term-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.term-header-top .trident-share {
  margin-left: auto;
}

@media (max-width: 640px) {
  .trident-share {
    width: 100%;
  }

  .trident-share-btn {
    width: 100%;
  }

  .trident-share-menu {
    left: 0;
    right: 0;
    width: 100%;
    transform-origin: top center;
  }

  .trident-share-feedback {
    left: 50%;
    right: auto;
    transform: translate(-50%, -2px);
  }

  .trident-share-feedback.is-visible {
    transform: translate(-50%, 0);
  }

  .term-header-top {
    align-items: flex-start;
    gap: 12px;
  }

  .term-header-top .trident-share {
    margin-left: 0;
  }
}
