/* ================================================
   FLOATING QUICK NAVIGATION & BACK TO TOP
   Improves navigation on long pages
   ================================================ */

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 998;
  opacity: 0;
  transform: scale(0.8);
}

.back-to-top.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
  animation: slideUp 0.3s ease-out;
}

.back-to-top:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.back-to-top:active {
  transform: scale(0.95);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== FLOATING QUICK NAVIGATION ===== */
.floating-nav {
  position: fixed;
  left: 30px;
  bottom: 30px;
  z-index: 999;
}

.floating-nav-toggle {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-nav-toggle:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.floating-nav-toggle:active {
  transform: scale(0.95);
}

.floating-nav-menu {
  position: absolute;
  bottom: 70px;
  left: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-nav-menu.show {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: slideUpMenu 0.3s ease-out;
}

@keyframes slideUpMenu {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.floating-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.floating-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transition: width 0.3s ease;
  z-index: -1;
}

.floating-nav-item:hover::before {
  width: 100%;
}

.floating-nav-item:hover {
  color: #667eea;
  transform: translateX(4px);
}

.floating-nav-item i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  color: #667eea;
}

.floating-nav-item span {
  flex: 1;
}

/* Active state */
.floating-nav-item.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: #667eea;
  font-weight: 600;
}

/* Arrow pointer */
.floating-nav-menu::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 16px;
  height: 16px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
html {
  scroll-behavior: smooth;
}

/* Optional: Scroll padding for fixed header */
html {
  scroll-padding-top: 80px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 1rem;
  }

  .floating-nav {
    left: 20px;
    bottom: 20px;
  }

  .floating-nav-toggle {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .floating-nav-menu {
    min-width: 160px;
    padding: 10px;
    gap: 6px;
  }

  .floating-nav-item {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .floating-nav-item i {
    font-size: 1rem;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 15px;
    right: 15px;
  }

  .floating-nav {
    left: 15px;
    bottom: 15px;
  }

  .floating-nav-toggle {
    width: 40px;
    height: 40px;
  }

  .floating-nav-menu {
    min-width: 150px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .floating-nav-menu {
    background: #1a1a1a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .floating-nav-item {
    color: #e0e0e0;
  }

  .floating-nav-item:hover {
    color: #667eea;
  }

  .floating-nav-menu::after {
    background: #1a1a1a;
  }
}

/* ===== ACCESSIBILITY ===== */
.back-to-top:focus,
.floating-nav-toggle:focus,
.floating-nav-item:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .floating-nav-toggle,
  .floating-nav-menu,
  .floating-nav-item {
    transition: none;
    animation: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}
