/* FocusModeModal - Fullscreen boulder preview with bottom bar navigation */

.focus-mode-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.focus-mode-modal {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #0a0a0a;
  position: relative;
}

/* ================================================================
   BOULDER INFO CHIP - Top Left Overlay
   ================================================================ */

.focus-mode-info-chip {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  max-width: calc(100% - 80px); /* Leave space for X button */
}

.focus-mode-info-chip__grade {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.focus-mode-info-chip__name {
  font-size: 13px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   X CLOSE BUTTON - Top Right Overlay
   ================================================================ */

.focus-mode-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.focus-mode-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.focus-mode-close-btn:active {
  transform: scale(0.95);
}

/* ================================================================
   LAYOUT - Full Width Canvas (NEVER fades, outside auto-hide wrapper)
   ================================================================ */

.focus-mode-layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1; /* Below overlays (z-index: 10) */
  /* No padding by default (desktop) */
  padding-bottom: 0;
}

/* Mobile-only: Bottom padding for MobileBottomBar + safe area */
.focus-mode-layout.mobile {
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

/* Canvas Area - Full Width */
.focus-mode-canvas-area {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

.focus-mode-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0a;
  position: relative;
}

/* Fabric.js canvas element */
.focus-mode-canvas canvas {
  max-width: 100%;
  max-height: 100%;
}

/* Loading state */
.canvas-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  z-index: 10;
}

/* ================================================================
   OPACITY SLIDER - Vertical, Right Side
   ================================================================ */

.focus-mode-opacity-control {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
}

.opacity-slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.opacity-icon {
  font-size: 18px;
  color: #9747ff;
}

.opacity-value {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  min-width: 32px;
  text-align: center;
}

/* ================================================================
   RESET VIEW BUTTON - Bottom Left (Above Bottom Bar)
   ================================================================ */

.focus-mode-reset-btn {
  position: absolute;
  left: 16px;
  bottom: 20px;
  z-index: 15;
}

.focus-mode-reset-btn button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  font-size: 16px;
}

.focus-mode-reset-btn button:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* ================================================================
   MOBILE BOTTOM BAR OVERRIDES
   Style the MobileBottomBar specifically for Focus Mode
   ================================================================ */

.focus-mode-modal .beta-browser-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(20, 20, 30, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ================================================================
   RESPONSIVE - Mobile
   ================================================================ */

@media (max-width: 767px) {
  .focus-mode-info-chip {
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    max-width: calc(100% - 70px);
  }

  .focus-mode-info-chip__grade {
    font-size: 11px;
    padding: 2px 6px;
  }

  .focus-mode-info-chip__name {
    font-size: 12px;
  }

  .focus-mode-close-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  /* Opacity slider position */
  .focus-mode-opacity-control {
    right: 12px;
  }

  .opacity-slider-container {
    padding: 12px 8px;
  }

  /* Reset button */
  .focus-mode-reset-btn {
    left: 12px;
    bottom: 16px;
  }

  .focus-mode-reset-btn button {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .focus-mode-info-chip {
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    gap: 6px;
  }

  .focus-mode-info-chip__grade {
    font-size: 10px;
    padding: 1px 5px;
  }

  .focus-mode-info-chip__name {
    font-size: 11px;
  }

  .focus-mode-close-btn {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .focus-mode-close-btn {
    width: 44px;
    height: 44px;
  }
}

/* ================================================================
   AUTO-HIDE OVERLAYS
   ================================================================ */

/* Overlay container - positioned absolutely over canvas */
.focus-mode-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none; /* Allow clicks to pass through to canvas */
  transition: opacity 0.3s ease;
  opacity: 1;
  z-index: 10;
}

/* Hidden state - 30% opacity */
.focus-mode-overlays--hidden {
  opacity: 0.3;
}

/* Overlay children should receive pointer events */
.focus-mode-overlays > * {
  pointer-events: auto;
}

/* Close button always fully visible */
.focus-mode-close-btn {
  opacity: 1 !important;
  transition: none !important;
}

/* ================================================================
   HIDE FILTER/SEARCH BUTTON IN FOCUS MODE
   ================================================================ */

/* No longer needed - rightActions prop controls what appears on right side */

/* ================================================================
   DESKTOP PILL BUTTONS - Bottom Overlay
   ================================================================ */

/* Single pill button at bottom left - Reset View */
.focus-mode-pill-btn--left {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 15;
}

/* Pill actions group at bottom center - Info & Send */
.focus-mode-pill-actions {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 15;
}

/* Base pill button style */
.focus-mode-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;

  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px; /* Pill shape */

  color: white;
  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
  transition: all 0.2s ease;

  -webkit-tap-highlight-color: transparent;
}

.focus-mode-pill-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.focus-mode-pill-btn:active {
  transform: translateY(0);
}

.focus-mode-pill-btn svg {
  font-size: 16px;
  flex-shrink: 0;
}

/* Note: Auto-hide behavior inherited from parent .focus-mode-overlays wrapper */

/* ================================================================
   BOTTOM BAR POSITIONING FIX (MOBILE ONLY)
   ================================================================ */

/* Bottom bar - fixed at bottom, full width, centered
   Note: MobileBottomBar only renders on mobile via isMobile check in JSX */
.focus-mode-modal .beta-browser-bottom-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  transform: none !important;
  justify-content: center;
}
