/* Custom styles for Product Configurator */

/* Remove scrollbars and ensure full height */
html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* Configurator Layout */
.configurator-layout {
  height: calc(100vh - 80px); /* Account for header height */
}

/* Color option selection states */
.color-option {
  position: relative;
  transition: all 0.2s ease-in-out;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-option.selected {
  border-color: #1d4ed8 !important;
  border-width: 3px;
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.color-option.selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Size option selection states */
button.selected {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

button.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Product visualization styles */
#product-shape > div {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  position: relative;
  overflow: hidden;
}

/* Material textures */
.material-plastic {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.material-metal {
  background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.material-wood {
  background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
}

.material-glass {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

/* Size variations */
.size-small {
  width: 128px !important;
  height: 128px !important;
}

.size-medium {
  width: 192px !important;
  height: 192px !important;
}

.size-large {
  width: 256px !important;
  height: 256px !important;
}

/* Feature indicators */
.feature-led::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

.feature-wireless::before {
  content: "📶";
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 16px;
}

.feature-waterproof::before {
  content: "💧";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 16px;
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Configuration panel - hide scrollbar but keep functionality */
.overflow-y-auto {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.overflow-y-auto::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome, Safari, Opera */
}

/* Responsive design */

/* Mobile-first base styles - already defined above */

/* Tablet (sm: 640px and up) */
@media (min-width: 640px) {
  /* Better touch targets for tablets */
  button {
    min-height: 44px;
  }
}

/* Tablet landscape (md: 768px and up) */
@media (min-width: 768px) {
  /* Optimize for tablet landscape */
  .size-small {
    width: 120px !important;
    height: 120px !important;
  }

  .size-medium {
    width: 180px !important;
    height: 180px !important;
  }

  .size-large {
    width: 240px !important;
    height: 240px !important;
  }
}

/* Desktop (lg: 1024px and up) */
@media (min-width: 1024px) {
  /* Return to desktop layout with side-by-side panels */
  .configurator-layout {
    flex-direction: row;
  }
}

/* Extra small devices (max-width: 640px) - Phones */
@media (max-width: 640px) {
  /* Adjust header for mobile */
  header {
    padding: 0.5rem 0;
  }

  /* Reduce font sizes for mobile */
  body {
    font-size: 14px;
  }

  /* Optimize button sizes for mobile */
  .color-option {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }

  .color-option.selected::after {
    font-size: 12px;
  }

  /* Make sure buttons stack properly on very small screens */
  .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Adjust chevron icons for mobile */
  .chevron-icon {
    width: 1rem;
    height: 1rem;
  }

  /* Smaller size variations for mobile */
  .size-small {
    width: 90px !important;
    height: 90px !important;
  }

  .size-medium {
    width: 140px !important;
    height: 140px !important;
  }

  .size-large {
    width: 180px !important;
    height: 180px !important;
  }
}

/* Very small devices (max-width: 375px) - Small phones */
@media (max-width: 375px) {
  /* Further optimize for very small screens */
  .color-option {
    width: 2rem !important;
    height: 2rem !important;
  }

  /* Reduce padding even more */
  .collapsible-content {
    padding: 0.5rem !important;
  }

  /* Smaller text for very small screens */
  body {
    font-size: 12px;
  }

  button {
    font-size: 0.75rem;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  /* Optimize for landscape mode on mobile devices */
  header {
    padding: 0.25rem 0;
  }

  header img {
    height: 1.5rem;
  }

  header p {
    font-size: 0.75rem;
  }

  /* Reduce spacing in landscape */
  .collapsible-header {
    padding: 0.5rem !important;
  }

  .collapsible-content {
    padding: 0.5rem !important;
  }

  /* Make footer more compact in landscape */
  .border-t.border-gray-200.bg-white {
    padding: 0.5rem !important;
  }
}

/* Print styles */
@media print {
  /* Optimize for printing */
  body {
    overflow: visible;
  }

  header {
    position: static;
  }

  .overflow-y-scroll {
    overflow: visible;
  }

  /* Hide interactive elements when printing */
  button:not(.selected) {
    opacity: 0.5;
  }
}

/* High DPI displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Enhance borders and shadows for high DPI screens */
  .color-option {
    border-width: 1.5px;
  }

  button {
    border-width: 1.5px;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode support
  body {
    background-color: #1f2937;
    color: #f3f4f6;
  }

  .bg-white {
    background-color: #374151;
  }

  .text-gray-800 {
    color: #f3f4f6;
  }

  .border-gray-200 {
    border-color: #4b5563;
  }
  */
}
