/* Solar System 3D Component Styles */

.demo-container {
  position: relative;
  width: 100%;
  height: 600px;
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#three-canvas:active {
  cursor: grabbing;
}

.demo-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  padding: 20px;
  background: rgba(27, 34, 48, 0.8);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* Control Panel Styles */
.control-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.control-toggle {
  background: rgba(166, 128, 255, 0.9);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(166, 128, 255, 0.4);
}

.control-toggle:hover {
  background: rgba(166, 128, 255, 1);
  transform: rotate(90deg);
  box-shadow: 0 6px 20px rgba(166, 128, 255, 0.6);
}

.control-content {
  position: absolute;
  top: 60px;
  right: 0;
  background: rgba(27, 34, 48, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  min-width: 280px;
  max-height: 500px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(166, 128, 255, 0.2);
  /* Enable smooth scrolling on mobile */
  -webkit-overflow-scrolling: touch;
  /* Allow vertical touch scrolling only */
  touch-action: pan-y;
}

.control-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.control-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.control-label {
  display: block;
  color: #a680ff;
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-weight: 500;
}

.control-btn {
  background: rgba(166, 128, 255, 0.1);
  border: 1px solid rgba(166, 128, 255, 0.3);
  color: white;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.control-btn:hover {
  background: rgba(166, 128, 255, 0.2);
  border-color: rgba(166, 128, 255, 0.5);
  transform: translateX(5px);
}

.control-btn:active {
  background: rgba(166, 128, 255, 0.3);
}

.reset-btn {
  background: rgba(255, 107, 157, 0.1);
  border-color: rgba(255, 107, 157, 0.3);
}

.reset-btn:hover {
  background: rgba(255, 107, 157, 0.2);
  border-color: rgba(255, 107, 157, 0.5);
}

.control-slider {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(166, 128, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a680ff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(166, 128, 255, 0.5);
}

.control-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a680ff;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(166, 128, 255, 0.5);
}

.slider-value {
  display: inline-block;
  color: white;
  font-size: 0.85rem;
  margin-top: 5px;
  padding: 2px 8px;
  background: rgba(166, 128, 255, 0.1);
  border-radius: 4px;
}

.animation-toggle {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(139, 92, 246, 0.5) !important;
  font-weight: 500;
}

.animation-toggle:hover {
  background: rgba(139, 92, 246, 0.3) !important;
  border-color: rgba(139, 92, 246, 0.7) !important;
}

/* Planet Labels */
#planet-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.planet-label {
  position: absolute;
  background: rgba(27, 34, 48, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(166, 128, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.planet-label::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #a680ff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(166, 128, 255, 0.8);
}

/* Position connector dot and label based on side */
.planet-label.label-left {
  transform: translate(-100%, -50%);
  margin-left: -5px;
}

.planet-label.label-left::before {
  right: -8px;
  left: auto;
}

.planet-label.label-right {
  transform: translateY(-50%);
  margin-left: 5px;
}

.planet-label.label-right::before {
  left: -8px;
  right: auto;
}

.planet-label.sun-label {
  border-color: rgba(253, 184, 19, 0.6);
}

.planet-label.sun-label::before {
  background: #FDB813;
  box-shadow: 0 0 12px rgba(253, 184, 19, 1);
}

/* Game-style Info Box */
.service-info-box {
  position: absolute;
  top: 150px;
  left: 15%;
  transform: translate(-50%, 30px) scale(0.9);
  background: linear-gradient(135deg, rgba(27, 34, 48, 0.98), rgba(20, 25, 36, 0.98));
  border: 2px solid rgba(166, 128, 255, 0.6);
  border-radius: 16px;
  padding: 20px 28px;
  max-width: 300px;
  min-width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 20px rgba(166, 128, 255, 0.3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

.service-info-box.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.service-info-box::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    rgba(166, 128, 255, 0.3),
    rgba(139, 92, 246, 0.3),
    rgba(166, 128, 255, 0.3)
  );
  border-radius: 16px;
  z-index: -1;
  opacity: 0.5;
  animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.service-info-box .info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(166, 128, 255, 0.3);
}

.service-info-box .info-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #a680ff, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(166, 128, 255, 0.4);
}

.service-info-box .info-title {
  color: #a680ff;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 8px rgba(166, 128, 255, 0.3);
}

.service-info-box .info-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.service-info-box .info-timer {
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 30px;
  height: 3px;
  background: rgba(166, 128, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.service-info-box .info-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #a680ff, #8b5cf6);
  width: 100%;
  animation: timerCountdown 5s linear;
}

@keyframes timerCountdown {
  from { width: 100%; }
  to { width: 0%; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .demo-container {
    height: 400px;
  }

  .demo-overlay {
    top: 10px;
    left: 10px;
    padding: 15px;
  }

  .demo-overlay h4 {
    font-size: 1rem;
  }

  .demo-overlay p {
    font-size: 0.85rem;
  }

  .control-panel {
    top: 10px;
    right: 10px;
  }

  .control-content {
    /* Reduce height on mobile for better visibility */
    max-height: 70vh;
    /* Ensure scrolling works on mobile */
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .service-info-box {
    left: 50%;
    top: auto;
    bottom: 15px;
    max-width: 90%;
    min-width: 280px;
    padding: 16px 20px;
  }

  .service-info-box .info-title {
    font-size: 1.1rem;
  }

  .service-info-box .info-description {
    font-size: 0.85rem;
  }

  .service-info-box .info-icon {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
  }

  .service-info-box .info-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
}
