/* ===============================
   LIGHTING UI STYLES v2.0 (IMPROVED)
   Styles for dynamic lighting, time controls, and ambient modes
   =============================== */

/* 🔥 NEW: Ambient Light Mode Grid */
.ambient-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ambient-mode-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ambient-mode-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ambient-mode-btn.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-color: rgba(245, 87, 108, 0.8);
  box-shadow: 0 4px 16px rgba(245, 87, 108, 0.4);
  transform: translateY(-2px) scale(1.05);
}

.ambient-mode-btn:active {
  transform: translateY(0) scale(1);
}

.ambient-icon {
  font-size: 24px;
  line-height: 1;
}

.ambient-label {
  font-size: 11px;
}

/* Specific mode colors when active */
.ambient-mode-btn[data-mode="realistic"].active {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-color: rgba(52, 73, 94, 0.8);
}

.ambient-mode-btn[data-mode="soft"].active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: rgba(102, 126, 234, 0.8);
}

.ambient-mode-btn[data-mode="balanced"].active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-color: rgba(245, 87, 108, 0.8);
}

.ambient-mode-btn[data-mode="bright"].active {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border-color: rgba(255, 215, 0, 0.8);
  color: #333;
}

/* Time preset buttons */
.modern-time-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.modern-time-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.modern-time-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.modern-time-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modern-time-btn:active {
  transform: translateY(0);
}

/* Slider for time speed */
.modern-slider {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 4px;
}

.modern-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.modern-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.modern-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.modern-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.modern-label-small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

/* Animation for lighting toggle button */
#toggleDynamicLighting.active {
  animation: lightingPulse 2s infinite;
}

@keyframes lightingPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(245, 87, 108, 0.8), 0 0 30px rgba(245, 87, 108, 0.4);
  }
}

/* Enhanced hint box */
.modern-hint {
  background: rgba(102, 126, 234, 0.1);
  border-left: 3px solid #667eea;
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.modern-hint strong {
  color: #a5b4fc;
  font-weight: 600;
}

/* Button group styling */
.modern-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.modern-btn-small {
  padding: 8px 12px !important;
  font-size: 13px !important;
}

.modern-btn-small .modern-btn-icon {
  font-size: 16px;
}

.modern-btn-small.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
  transform: translateY(-1px);
}

/* Lighting controls container */
#lightingControls {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Status indicators */
.lighting-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 11px;
  margin-top: 8px;
}

.lighting-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ambient-mode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .ambient-mode-btn {
    padding: 10px 6px;
  }
  
  .ambient-icon {
    font-size: 20px;
  }
  
  .ambient-label {
    font-size: 10px;
  }
  
  .modern-time-presets {
    gap: 4px;
  }
  
  .modern-time-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
  .ambient-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .ambient-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .modern-time-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Tooltip enhancement */
.ambient-mode-btn[title]:hover::after,
.modern-time-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Loading state for lighting */
.lighting-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
