/**
 * Toolbar Styles
 * Floating toolbar with fullscreen, rotate, and share buttons
 */

/* Toolbar container */
.sign-toolbar {
  --toolbar-bg: rgba(18, 18, 20, 0.85);
  --toolbar-border: rgba(255, 255, 255, 0.08);
  --toolbar-btn-bg: transparent;
  --toolbar-btn-color: rgba(255, 255, 255, 0.55);
  --toolbar-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --toolbar-btn-hover-color: #fff;

  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 24px;
  border: 1px solid var(--toolbar-border);
  background: var(--toolbar-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

/* Cursor sync — hide toolbar when cursor is hidden */
body.cursor-hidden .sign-toolbar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

/* Toolbar buttons */
.sign-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 18px;
  background: var(--toolbar-btn-bg);
  color: var(--toolbar-btn-color);
  cursor: pointer;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.sign-toolbar-btn:hover {
  background: var(--toolbar-btn-hover-bg);
  color: var(--toolbar-btn-hover-color);
  transform: scale(1.1);
}

.sign-toolbar-btn:active {
  transform: scale(0.92);
}

.sign-toolbar-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sign-toolbar-btn[data-action="settings"]:hover svg {
  transform: rotate(60deg);
}

/* Special treatment for settings button to make it more distinct if needed */
.sign-toolbar-btn[data-action="settings"] {
  margin-left: 2px;
  background: rgba(255, 255, 255, 0.04);
}

.sign-toolbar-btn[data-action="settings"]:hover {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
}

/* Toast notification */
.sign-toolbar-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 10000;
  padding: 10px 20px;
  border-radius: 100px;
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sign-toolbar-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Cast button active state — breathing pulse */
.sign-toolbar-btn.casting-active {
  color: #2979ff;
  animation: cast-pulse 2s ease-in-out infinite;
}

@keyframes cast-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Rotation classes applied to #sign-container */
#sign-container.rotated-90 {
  width: 100vh;
  height: 100vw;
  transform: translate(calc((100vw - 100vh) / 2), calc((100vh - 100vw) / 2)) rotate(90deg);
}

#sign-container.rotated-180 {
  transform: rotate(180deg);
}

#sign-container.rotated-270 {
  width: 100vh;
  height: 100vw;
  transform: translate(calc((100vw - 100vh) / 2), calc((100vh - 100vw) / 2)) rotate(270deg);
}