/* app/assets/stylesheets/design_selection.css */
/* Design Selection Functionality - Isolated Styles */

/* ==========================================================================
   FLOATING TOOLBAR STYLES - ENHANCED WITH HIGHER SPECIFICITY
   ========================================================================== */

/* Use double class name for higher specificity to override any conflicts */
.design-groups-toolbar.design-groups-toolbar {
  /* FIXED: Much higher positioning - was 4rem, now 7.5rem (120px) */
  position: fixed !important;
  bottom: 7.5rem !important;  /* THIS IS THE KEY CHANGE */
  left: 50% !important;
  transform: translateX(-50%) translateY(120px) !important;
  
  /* Enhanced visual design */
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
  color: white !important;
  border-radius: 20px !important;
  padding: 1.5rem 2.5rem !important;
  
  /* Enhanced shadows and effects for visibility */
  box-shadow: 
    0 12px 40px rgba(0, 123, 255, 0.4),
    0 6px 20px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
  backdrop-filter: blur(20px) !important;
  
  /* Always on top */
  z-index: 9999 !important;
  
  /* Smooth animations */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  
  /* Size adjustments for better visibility */
  min-width: 380px !important;
  max-width: 90vw !important;
  
  /* Initial hidden state */
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.design-groups-toolbar.design-groups-toolbar.visible {
  /* Show state with enhanced animation - higher specificity */
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  transform: translateX(-50%) translateY(0) !important;
  animation: enhancedToolbarSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Enhanced toolbar content layout */
.design-groups-toolbar .toolbar-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 2.5rem !important;
  flex-direction: column;
}

.design-groups-toolbar .selected-info {
  font-weight: 700 !important;
  font-size: 1.2rem !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

/* Add a checkmark icon */
.design-groups-toolbar .selected-info::before {
  content: "✓" !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 50% !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  font-weight: bold !important;
}

.design-groups-toolbar .toolbar-actions {
  display: flex !important;
  gap: 0.75rem !important;
  flex-direction: column !important;
  justify-content: center !important;
}

/* Enhanced button styling */
.design-groups-toolbar .toolbar-actions .btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #007bff !important;
  border: none !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(10px) !important;
}

.design-groups-toolbar .toolbar-actions .btn:hover {
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.design-groups-toolbar .toolbar-actions .btn:active {
  transform: translateY(-1px) scale(1.02) !important;
}

.design-groups-toolbar .toolbar-actions .btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.design-groups-toolbar .btn-outline {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px) !important;
}

.design-groups-toolbar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: white !important;
  color: white !important;
  transform: translateY(-2px) !important;
}

/* Add icons to buttons for better UX */
.design-groups-toolbar .open-group-selector::before {
  content: "📁" !important;
  margin-right: 0.25rem !important;
}

.clear-selection::before {
  content: "✖" !important;
  margin-right: 0.25rem !important;
}

/* Smart positioning classes for JavaScript control */
.design-groups-toolbar.smart-top {
  bottom: 10rem !important; /* Higher when at page bottom */
}

.design-groups-toolbar.smart-bottom {
  bottom: 5rem !important; /* Lower when at page top */
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
  .design-groups-toolbar.design-groups-toolbar {
    bottom: 4rem !important; /* Lower on mobile for thumb reach */
    left: 1rem !important;
    right: 1rem !important;
    transform: translateY(120px) !important;
    border-radius: 16px !important;
    padding: 1.25rem 1.75rem !important;
    min-width: auto !important;
  }
  
  .design-groups-toolbar.design-groups-toolbar.visible {
    transform: translateY(0) !important;
  }
  
  .design-groups-toolbar .toolbar-content {
    flex-direction: column !important;
    gap: 1.25rem !important;
    text-align: center !important;
  }
  
  .design-groups-toolbar .toolbar-actions .btn {
    flex: 1 !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9rem !important;
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .design-groups-toolbar.design-groups-toolbar {
    bottom: 3rem !important; /* Even lower on very small screens */
  }
  
  .design-groups-toolbar .toolbar-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .design-groups-toolbar .toolbar-actions .btn {
    width: 100% !important;
    max-width: none !important;
  }
  
  .design-groups-toolbar .selected-info {
    font-size: 1.1rem !important;
  }
}

/* Enhanced slide-up animation */
@keyframes enhancedToolbarSlideUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(120px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Add a subtle backdrop when toolbar is visible */
.design-groups-toolbar.visible::before {
  content: "" !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: radial-gradient(circle at 50% 90%, rgba(0, 123, 255, 0.08) 0%, transparent 70%) !important;
  z-index: -1 !important;
  pointer-events: none !important;
}
  
  /* ==========================================================================
     DESIGN CARD SELECTION STYLES
     ========================================================================== */
  
  .design-card.selection-mode {
    cursor: pointer;
  }
  
  .design-card.selected {
    border: 3px solid #007bff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.2) !important;
  }
  
  .design-card.selected .design-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.1);
    pointer-events: none;
  }
