/**
 * Background Toggle Button - SEO Pages
 * Floating Action Button (FAB) to hide content and reveal full background
 *
 * Features:
 * - Mobile-first design (56x56px touch target)
 * - Smooth transitions (0.5s fade)
 * - Theme-aware colors (green for questions, amber for quotes)
 * - Accessibility compliant (ARIA, keyboard support)
 * - High z-index (150) to stay above all content
 */

/* ============================================
 * FLOATING ACTION BUTTON (FAB)
 * ============================================ */

.background-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 150;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(0, 0, 0, 0.2);
  -webkit-tap-highlight-color: transparent;
}

/* Hover effect (desktop only) */
@media (hover: hover) and (pointer: fine) {
  .background-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(0, 0, 0, 0.3);
  }
}

/* Focus state for accessibility */
.background-toggle-btn:focus {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

/* Active/pressed state */
.background-toggle-btn:active {
  transform: scale(0.95);
}

/* Icon styling */
.background-toggle-btn i {
  transition: transform 0.3s ease;
}

/* ============================================
 * THEME COLORS - Questions (Green)
 * ============================================ */

.background-toggle-btn--green {
  border-color: rgba(0, 255, 136, 0.4);
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(108, 99, 255, 0.15));
  color: #00ff88;
}

@media (hover: hover) and (pointer: fine) {
  .background-toggle-btn--green:hover {
    border-color: #00ff88;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.35), rgba(108, 99, 255, 0.25));
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3),
                0 0 30px rgba(0, 255, 136, 0.2);
  }
}

.background-toggle-btn--green:focus {
  outline-color: #00ff88;
}

/* ============================================
 * THEME COLORS - Quotes (Amber)
 * ============================================ */

.background-toggle-btn--amber {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
  color: #f59e0b;
}

@media (hover: hover) and (pointer: fine) {
  .background-toggle-btn--amber:hover {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.25));
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3),
                0 0 30px rgba(245, 158, 11, 0.2);
  }
}

.background-toggle-btn--amber:focus {
  outline-color: #f59e0b;
}

/* ============================================
 * ACTIVE STATE - Background View Enabled
 * ============================================ */

.background-view-active .background-toggle-btn {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff4444;
  color: #ff4444;
}

@media (hover: hover) and (pointer: fine) {
  .background-view-active .background-toggle-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff6666;
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4),
                0 0 30px rgba(255, 68, 68, 0.3);
  }
}

/* Change icon to eye-slash when active */
.background-view-active .background-toggle-btn i::before {
  content: "\f070"; /* fa-eye-slash */
}

/* ============================================
 * CONTENT HIDING - Background View Active
 * ============================================ */

.background-view-active .header-wrapper,
.background-view-active .seo-question-container,
.background-view-active .seo-quote-container,
.background-view-active .footer-wrapper {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Keep main wrapper visible for proper layout */
.background-view-active .seo-question-wrapper,
.background-view-active .seo-quote-wrapper {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
 * RESPONSIVE DESIGN
 * ============================================ */

/* Tablet (641px - 1023px) */
@media (min-width: 641px) {
  .background-toggle-btn {
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .background-toggle-btn {
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
  }
}

/* Very small screens (max 375px) */
@media (max-width: 375px) {
  .background-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }
}

/* Landscape mobile - adjust position to avoid overlap */
@media (max-height: 500px) and (orientation: landscape) {
  .background-toggle-btn {
    bottom: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
}

/* ============================================
 * ACCESSIBILITY ENHANCEMENTS
 * ============================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .background-toggle-btn {
    border-width: 3px;
    border-color: #fff;
  }

  .background-toggle-btn:focus {
    outline-width: 4px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .background-toggle-btn,
  .background-toggle-btn i,
  .background-view-active .header-wrapper,
  .background-view-active .seo-question-container,
  .background-view-active .seo-quote-container,
  .background-view-active .footer-wrapper {
    transition: none;
  }
}

/* ============================================
 * PRINT STYLES
 * ============================================ */

@media print {
  .background-toggle-btn {
    display: none !important;
  }
}
