/**
 * Orbital Hub Frontend Styles
 * CSS for orbital button animations and display
 *
 * @package Dear_Sticky
 */

/* ============================================
   Main Container
   ============================================ */

.drstk-orbital-hub {
  position: fixed;
  z-index: 999999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Position Variants */
.drstk-orbital-hub.position-bottom-right {
  bottom: 20px;
  right: 20px;
}

.drstk-orbital-hub.position-bottom-left {
  bottom: 20px;
  left: 20px;
}

.drstk-orbital-hub.position-top-right {
  top: 20px;
  right: 20px;
}

.drstk-orbital-hub.position-top-left {
  top: 20px;
  left: 20px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .drstk-orbital-hub.position-bottom-right,
  .drstk-orbital-hub.position-top-right {
    right: 15px;
  }

  .drstk-orbital-hub.position-bottom-left,
  .drstk-orbital-hub.position-top-left {
    left: 15px;
  }

  .drstk-orbital-hub.position-bottom-right,
  .drstk-orbital-hub.position-bottom-left {
    bottom: 15px;
  }

  .drstk-orbital-hub.position-top-right,
  .drstk-orbital-hub.position-top-left {
    top: 15px;
  }
}

/* ============================================
   Button Base Styles
   ============================================ */

.drstk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
}

.drstk-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.drstk-btn:active {
  transform: scale(0.95);
}

.drstk-btn i {
  font-size: inherit;
  line-height: 1;
}

/* Button Sizes */
.drstk-orbital-hub.size-small .drstk-btn {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.drstk-orbital-hub.size-medium .drstk-btn {
  width: 60px;
  height: 60px;
  font-size: 24px;
}

.drstk-orbital-hub.size-large .drstk-btn {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

/* ============================================
   Single Button Mode
   ============================================ */

.drstk-btn-single {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Hub Button (Master Icon)
   ============================================ */

.drstk-hub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.drstk-orbital-hub.size-small .drstk-hub-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

.drstk-orbital-hub.size-medium .drstk-hub-btn {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.drstk-orbital-hub.size-large .drstk-hub-btn {
  width: 76px;
  height: 76px;
  font-size: 30px;
}

.drstk-hub-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.drstk-hub-btn:active {
  transform: scale(0.95);
}

/* Hub Icon Container */
.drstk-hub-icon {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hub Icon States */
.drstk-hub-icon-main,
.drstk-hub-icon-close {
  position: absolute;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drstk-hub-icon-main {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.drstk-hub-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

/* Active State (Expanded) */
.drstk-hub-btn.is-active .drstk-hub-icon-main {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

.drstk-hub-btn.is-active .drstk-hub-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ============================================
   Orbital Buttons Container
   ============================================ */

.drstk-orbital-buttons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.drstk-orbital-hub.is-expanded .drstk-orbital-buttons {
  pointer-events: auto;
}

/* ============================================
   Orbital Buttons (Individual)
   ============================================ */

.drstk-btn-orbital {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Visible State (Expanded) */
.drstk-btn-orbital.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(
    calc(-50% + var(--orbital-x)),
    calc(-50% + var(--orbital-y))
  );
}

/* Staggered Animation Delay */
.drstk-btn-orbital {
  transition-delay: 0ms;
}

.drstk-btn-orbital.is-visible {
  transition-delay: var(--animation-delay, 0ms);
}

/* ============================================
   Button Tooltips
   ============================================ */

.drstk-btn-tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1;
}

/* Tooltip positions based on hub position */
.drstk-orbital-hub.position-bottom-right .drstk-btn-tooltip,
.drstk-orbital-hub.position-bottom-left .drstk-btn-tooltip {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
}

.drstk-orbital-hub.position-top-right .drstk-btn-tooltip,
.drstk-orbital-hub.position-top-left .drstk-btn-tooltip {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
}

.drstk-btn:hover .drstk-btn-tooltip {
  opacity: 1;
}

/* ============================================
   Backdrop (Optional)
   ============================================ */

.drstk-orbital-hub.is-expanded::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: -1;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ============================================
   Accessibility
   ============================================ */

.drstk-btn:focus,
.drstk-hub-btn:focus {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .drstk-btn,
  .drstk-hub-btn,
  .drstk-btn-orbital,
  .drstk-hub-icon-main,
  .drstk-hub-icon-close {
    animation: none;
    transition-duration: 0.01ms;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .drstk-orbital-hub {
    display: none !important;
  }
}

/* ============================================
   Z-Index Management
   ============================================ */

/* Ensure hub stays on top when expanded */
.drstk-orbital-hub.is-expanded .drstk-hub-btn {
  z-index: 20;
}

.drstk-orbital-hub.is-expanded .drstk-btn-orbital {
  z-index: 15;
}
