/* ==========================================
   Floating Action Button (FAB) Styles
   Material Design inspired
   ========================================== */

.fab-button {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4735e 0%, #b8513d 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(212, 115, 94, 0.4),
              0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Desktop positioning - bottom right */
  bottom: 32px;
  right: 32px;
}

.fab-button:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 115, 94, 0.5),
              0 4px 8px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #e58570 0%, #c96551 100%);
}

.fab-button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(212, 115, 94, 0.3),
              0 1px 2px rgba(0, 0, 0, 0.1);
}

.fab-icon {
  color: white;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-button:hover .fab-icon {
  transform: rotate(90deg);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .fab-button {
    width: 56px;
    height: 56px;
    /* Position above bottom nav on mobile */
    bottom: 88px; /* Bottom nav is typically 64px + 24px spacing */
    right: 20px;
    box-shadow: 0 4px 16px rgba(212, 115, 94, 0.5),
                0 2px 6px rgba(0, 0, 0, 0.15);
  }

  .fab-button:hover {
    /* Reduce hover effect on mobile since it's touch */
    transform: scale(1.05);
  }

  .fab-button:active {
    transform: scale(0.9);
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .fab-button {
    bottom: 28px;
    right: 28px;
  }
}

/* Accessibility - Focus state */
.fab-button:focus {
  outline: none;
  box-shadow: 0 4px 12px rgba(212, 115, 94, 0.4),
              0 2px 4px rgba(0, 0, 0, 0.1),
              0 0 0 4px rgba(212, 115, 94, 0.2);
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
  .fab-button {
    box-shadow: 0 4px 12px rgba(212, 115, 94, 0.3),
                0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .fab-button:hover {
    box-shadow: 0 6px 20px rgba(212, 115, 94, 0.4),
                0 4px 8px rgba(0, 0, 0, 0.35);
  }
}

/* Animation on page load */
@keyframes fabEntrance {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.fab-button {
  animation: fabEntrance 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* Hide FAB when keyboard is open on mobile (optional) */
@media (max-width: 768px) {
  .fab-button.keyboard-open {
    opacity: 0;
    pointer-events: none;
  }
}

/* Ensure FAB is above other elements but below modals */
.fab-button {
  z-index: 900; /* Below modals (typically 1000+) but above content */
}

/* Ripple effect on click (optional enhancement) */
.fab-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.fab-button:active::after {
  width: 100%;
  height: 100%;
}

/* Ensure FAB doesn't interfere with sidebar on desktop */
@media (min-width: 769px) {
  .sidebar:not(.collapsed) ~ * .fab-button {
    /* Adjust if sidebar is expanded and covers the FAB */
    right: 32px;
  }
}
