/* Optimized glass container - reduced blur for better performance */
.glass-container {
  position: relative;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  overflow: hidden;
  flex: 1 1 auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  color: #ffffff;
  transition: transform 0.15s ease;
  transform: translateZ(0);
  contain: layout style;
  will-change: transform;
  backface-visibility: hidden;
}

.glass-filter,
.glass-overlay,
.glass-specular {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.glass-filter {
  z-index: 0;
  backdrop-filter: blur(3px); /* Reduced from 6px for better performance */
  transform: translateZ(0);
}

.glass-overlay {
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
}

.glass-specular {
  z-index: 2;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: flex-start;
  padding: 18px;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* Tooltip styles */
.glass-container-tooltip {
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 0.5rem;
  overflow: hidden;
}

.glass-filter-tooltip,
.glass-overlay-tooltip,
.glass-specular-tooltip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.glass-filter-tooltip {
  z-index: 0;
  backdrop-filter: blur(4px);
}

.glass-overlay-tooltip {
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
}

.glass-specular-tooltip {
  z-index: 2;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-content-tooltip {
  position: relative;
  z-index: 3;
}

/* Optimized animations */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.2s ease-out;
}

.animate-slide-up {
  animation: slide-up 0.2s ease-out;
}

/* Optimized command card */
.command-card {
  background: #343535;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  overflow: hidden;
  color: #ffffff;
  height: 230px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  transform: translateZ(0);
  contain: layout style paint;
  position: relative;
}

.command-card.highlighted {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4),
              0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
  0% {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 0px rgba(255, 255, 255, 0);
  }
  20% {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6),
                0 4px 16px rgba(0, 0, 0, 0.4);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 0px rgba(255, 255, 255, 0);
  }
}

/* Subtle hover effect without lift */
.command-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Grid layout */
.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  isolation: isolate;
  contain: layout style;
  transform: translateZ(0);
}

.command-grid > * {
  height: 230px;
  min-height: 230px;
  max-height: 230px;
  max-width: 400px;
  contain: layout style paint;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 50;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Category scroll container */
.category-scroll-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-scroll-container::-webkit-scrollbar {
  display: none;
}

.category-scroll-container.dragging {
  cursor: grabbing !important;
}

/* Optimized responsive styles */
@media (max-width: 768px) {
  .glass-container {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  
  .glass-filter {
    backdrop-filter: blur(2px); /* Further reduced for mobile */
  }
  
  .glass-overlay {
    background: rgba(255, 255, 255, 0.05);
  }

  .command-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
  }
  
  .command-grid > *,
  .command-card {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    width: 100%;
    max-width: none;
  }
  
  .glass-content {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .glass-container {
    border-radius: 1rem;
  }
  
  .glass-filter {
    backdrop-filter: none; /* Remove blur on small screens for performance */
  }
  
  .glass-content {
    padding: 14px;
  }

  .command-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
    padding: 0 0.5rem;
  }
  
  .command-grid > *,
  .command-card {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .glass-content {
    padding: 16px;
  }
  
  .command-grid {
    padding: 0 0.25rem;
    gap: 0.75rem;
  }
  
  .command-grid > *,
  .command-card {
    height: 250px;
    min-height: 250px;
    max-height: 250px;
    width: 100%;
    max-width: none;
  }
}

/* Loading spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Disable animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-slide-up,
  .animate-spin,
  .command-card,
  .command-card.highlighted {
    animation: none !important;
    transition: none !important;
  }
  
  .command-card.highlighted {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
  }
} 
