/* gameControls.css - Standardized game control panel styling */

/* Floating Button */
.game-controls-floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 9999;
}

.game-controls-floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.game-controls-floating-btn.active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: rotate(90deg);
}

.game-controls-floating-btn svg {
  width: 24px;
  height: 24px;
}

/* Panel */
.game-controls-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.game-controls-panel.open {
  right: 0;
}

/* Header */
.game-controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.game-controls-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.game-controls-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.game-controls-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Sections */
.game-controls-section {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.game-controls-section:last-child {
  border-bottom: none;
}

.game-controls-section h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #764ba2;
}

/* BLE Connect Button */
.game-controls-ble-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.game-controls-ble-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.game-controls-ble-btn.connected {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.game-controls-ble-btn.connected:hover {
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Calibrate Button */
.game-controls-calibrate-btn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px rgba(255, 193, 7, 0.3);
  margin-top: 10px;
}

.game-controls-calibrate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(255, 193, 7, 0.4);
}

.game-controls-calibrate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sensor Values */
.game-controls-sensor-values {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
}

.sensor-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.sensor-value:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sensor-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.sensor-data {
  font-size: 15px;
  font-weight: 700;
  color: #764ba2;
  font-family: 'Courier New', monospace;
}

/* Status */
.game-controls-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  margin-top: 15px;
  font-size: 13px;
  color: #666;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc3545;
  animation: pulse 2s infinite;
}

.game-controls-status.status-connected .status-dot {
  background: #28a745;
}

.game-controls-status.status-connecting .status-dot {
  background: #ffc107;
}

.game-controls-status.status-error .status-dot {
  background: #dc3545;
}

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

/* Secondary Button */
.game-controls-btn-secondary {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 10px;
  color: #667eea;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.game-controls-btn-secondary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .game-controls-panel {
    width: 100%;
    right: -100%;
  }

  .game-controls-floating-btn {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }

  .game-controls-floating-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .game-controls-panel {
    background: rgba(30, 30, 30, 0.98);
    color: #f0f0f0;
  }

  .game-controls-section {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .game-controls-sensor-values {
    background: rgba(102, 126, 234, 0.1);
  }

  .sensor-label {
    color: #bbb;
  }

  .sensor-data {
    color: #a78dd8;
  }

  .sensor-value:not(:last-child) {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .game-controls-status {
    background: rgba(255, 255, 255, 0.05);
    color: #bbb;
  }

  .game-controls-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Scrollbar styling */
.game-controls-panel::-webkit-scrollbar {
  width: 8px;
}

.game-controls-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.game-controls-panel::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 4px;
}

.game-controls-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}
