/**
 * Widget FAB Styles
 *
 * Floating action button for spawning contact widgets.
 * Features: draggable positioning, radial menu, keyboard hints
 */

/* ==========================================
   FAB CONTAINER
   ========================================== */
.widget-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 12px;
}

.widget-fab.is-dragging {
  opacity: 0.9;
}

/* ==========================================
   MAIN FAB BUTTON
   ========================================== */
.widget-fab-button {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--fc-flame, #f97316) 0%, #ea580c 100%);
  color: white;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(249, 115, 22, 0.4),
    0 8px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.widget-fab-button svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.widget-fab-button:hover {
  transform: scale(1.05);
  box-shadow:
    0 6px 28px rgba(249, 115, 22, 0.5),
    0 12px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.widget-fab-button:active {
  transform: scale(0.95);
  cursor: grabbing;
}

/* Menu open state */
.widget-fab.menu-open .widget-fab-button {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow:
    0 4px 20px rgba(220, 38, 38, 0.4),
    0 8px 40px rgba(0, 0, 0, 0.3);
}

.widget-fab.menu-open .widget-fab-button svg {
  transform: rotate(45deg);
}

/* Spawn feedback */
.widget-fab-button.widget-spawned {
  animation: fabPulse 0.3s ease;
}

@keyframes fabPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ==========================================
   FAB MENU
   ========================================== */
.widget-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(17, 21, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

/* ==========================================
   MENU ITEMS
   ========================================== */
.widget-fab-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary, #a1a1aa);
  cursor: pointer;
  transition: all 0.2s ease;
  animation: menuItemIn 0.2s ease backwards;
  white-space: nowrap;
}

@keyframes menuItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.widget-fab-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f4f4f6);
}

.widget-fab-menu-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.widget-fab-menu-item span {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.widget-fab-menu-item kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-tertiary, #71717a);
}

/* Type-specific colors on hover */
.widget-fab-menu-item[data-type="call"]:hover {
  color: var(--type-call, #22d3ee);
}

.widget-fab-menu-item[data-type="call"]:hover svg {
  stroke: var(--type-call, #22d3ee);
}

.widget-fab-menu-item[data-type="note"]:hover {
  color: var(--type-note, #fbbf24);
}

.widget-fab-menu-item[data-type="note"]:hover svg {
  stroke: var(--type-note, #fbbf24);
}

.widget-fab-menu-item[data-type="email"]:hover {
  color: var(--type-email, #c084fc);
}

.widget-fab-menu-item[data-type="email"]:hover svg {
  stroke: var(--type-email, #c084fc);
}

.widget-fab-menu-item[data-type="meeting"]:hover {
  color: var(--type-meeting, #f472b6);
}

.widget-fab-menu-item[data-type="meeting"]:hover svg {
  stroke: var(--type-meeting, #f472b6);
}

/* ==========================================
   MOBILE ADJUSTMENTS
   ========================================== */
@media (max-width: 640px) {
  .widget-fab {
    bottom: 16px;
    right: 16px;
  }

  .widget-fab-button {
    width: 52px;
    height: 52px;
  }

  .widget-fab-button svg {
    width: 22px;
    height: 22px;
  }

  .widget-fab-menu-item {
    padding: 10px 14px;
  }

  .widget-fab-menu-item kbd {
    display: none;
  }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  .widget-fab-button,
  .widget-fab-menu-item {
    transition: none;
  }

  .widget-fab-button svg {
    transition: none;
  }

  @keyframes fabPulse {
    0%, 100% { transform: scale(1); }
  }

  @keyframes menuItemIn {
    from, to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
