/* Interactive Elements - Touch & Accessibility Optimized */

/* Remove 300ms click delay on mobile */
* {
  touch-action: manipulation;
}

/* Button Base Styles - 44px minimum touch target */
.btn, button, .search-btn, .theme-toggle, .back-to-top, .scroll-to-bottom {
  min-height: 44px;
  min-width: 44px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: #4CAF50;
  border: 2px solid #4CAF50;
}

.btn-secondary:hover {
  background: #4CAF50;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Focus States - Visible for keyboard navigation */
.btn:focus,
button:focus,
.search-btn:focus,
.theme-toggle:focus,
a:focus {
  outline: 3px solid #4CAF50;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Remove focus outline for mouse users only */
.btn:focus:not(:focus-visible),
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* Search Button */
.search-btn {
  background: #4CAF50;
  color: white;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
}

.search-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

/* Theme Toggle */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #333;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(180deg) scale(1.1);
}

/* Scroll Buttons */
.back-to-top,
.scroll-to-bottom {
  position: fixed;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #4CAF50;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 0;
}

.back-to-top {
  bottom: 80px;
}

.scroll-to-bottom {
  bottom: 20px;
}

.back-to-top:hover,
.scroll-to-bottom:hover {
  background: #45a049;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* CTA Button Spacing - Prevent mis-taps */
.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-cta {
    flex-direction: row;
    gap: 24px;
    justify-content: center;
  }
}

/* Card Buttons */
.card-btn {
  min-height: 44px;
  padding: 12px 20px;
  background: #4CAF50;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.card-btn:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Form Inputs - Touch Friendly */
.form-input,
input,
textarea,
select {
  min-height: 44px;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px; /* Prevents zoom on iOS */
  transition: all 0.2s ease;
}

.form-input:hover,
input:hover,
textarea:hover,
select:hover {
  border-color: #4CAF50;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Links */
a {
  color: #4CAF50;
  text-decoration: none;
  transition: color 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

a:hover {
  color: #45a049;
  text-decoration: underline;
}

/* Navigation Links */
nav a,
.nav-link {
  padding: 12px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

nav a:hover,
.nav-link:hover {
  background: rgba(76, 175, 80, 0.1);
  text-decoration: none;
}

/* Mobile Touch Improvements */
@media (max-width: 767px) {
  /* Increase touch targets on mobile */
  .btn, button {
    min-height: 48px;
    padding: 14px 24px;
    font-size: 16px;
  }
  
  /* More spacing between buttons */
  .hero-cta {
    gap: 20px;
  }
  
  /* Larger theme toggle on mobile */
  .theme-toggle {
    width: 52px;
    height: 52px;
  }
  
  /* Larger scroll buttons */
  .back-to-top,
  .scroll-to-bottom {
    width: 52px;
    height: 52px;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .btn, button {
    border: 2px solid currentColor;
  }
  
  .btn:focus, button:focus {
    outline: 4px solid;
    outline-offset: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .btn, button, a {
    transition: none;
  }
  
  .btn:hover, button:hover {
    transform: none;
  }
}

/* Loading State */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

[data-theme="dark"] .btn-secondary {
  border-color: #4CAF50;
  color: #4CAF50;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #4CAF50;
  color: #1a1a1a;
}
/* ================================
   Floating Action Buttons Layout
   Issue #1819 (FINAL FIX)
================================ */

/* Master container for all floating buttons */
.fab-container {
  position: fixed;
  right: 20px;
  bottom: 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;

  z-index: 1001;
}

/* Normalize ALL FAB buttons */
.fab-container button,
.fab-container .chatbot-btn,
.fab-container .mic-btn,
.fab-container .back-to-top,
.fab-container .scroll-to-bottom {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;

  padding: 0;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 18px;
}

/* Kill individual fixed positioning */
.fab-container .back-to-top,
.fab-container .scroll-to-bottom,
.fab-container .chatbot-btn,
.fab-container .mic-btn {
  position: static !important;
}

/* Optional visual consistency */
.mic-btn {
  background: #22c55e;
  color: #ffffff;
}

.back-to-top {
  background: #22c55e;
  color: #ffffff;
}

.chatbot-btn {
  background: #facc15;
  color: #000000;
}

/* Hover */
.fab-container button:hover {
  transform: scale(1.1);
}

/* Mobile tweak */
@media (max-width: 768px) {
  .fab-container {
    right: 16px;
    bottom: 16px;
    gap: 12px;
  }

  .fab-container button {
    width: 56px;
    height: 56px;
  }
}
