/* Controls Panel */
#controls {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.85);
  padding: 0;
  border-radius: 12px;
  z-index: 1000;
  color: white;
  min-width: 300px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

#controls .controls-header {
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#controls .controls-title {
  font-weight: 600;
  font-size: 16px;
}

#controls .controls-header:after {
  content: "▼";
  font-size: 12px;
  transform: rotate(180deg);
  transition: transform 0.3s ease;
  opacity: 0.7;
}

#controls.collapsed .controls-header:after {
  transform: rotate(0deg);
}

#controls.collapsed .controls-content {
  display: none;
}

#controls .controls-content {
  padding: 20px;
}

/* Control Groups */
#controls .control-group {
  margin-bottom: 20px;
}

#controls .control-group:last-child {
  margin-bottom: 0;
}

#controls .control-row {
  display: flex;
  gap: 15px;
}

#controls .control-col {
  flex: 1;
}

#controls label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

/* Inputs and Buttons */
#controls .control-input,
#controls .control-button {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 13px;
  transition: all 0.2s ease;
}

#controls .control-input:hover,
#controls .control-button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

#controls .control-input:focus,
#controls .control-button:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
}

#controls .control-button {
  cursor: pointer;
  font-weight: 500;
  margin-top: 8px;
}

/* Sections */
#controls .section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#controls .section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
}

/* API Status */
#controls .api-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#controls .api-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

#controls .api-status:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  transition: background-color 0.3s ease;
}

#controls .api-status.available:before {
  background: #4CAF50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

#controls .api-status.unavailable:before {
  background: #f44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.4);
}

/* Keyboard Controls */
#controls .keyboard-controls {
  list-style: none;
  padding: 0;
  margin: 0;
}

#controls .keyboard-controls li {
  margin: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
}

#controls .keyboard-controls .key {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 8px;
  font-family: monospace;
  font-size: 12px;
  min-width: 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Recording indicator */
#controls .key.recording {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.5);
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% { 
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
  }
  50% { 
    background: rgba(244, 67, 54, 0.5);
    border-color: rgba(244, 67, 54, 0.7);
  }
  100% { 
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.5);
  }
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #222;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-screen .loading-text {
  color: #fff;
  font-size: 24px;
  animation: pulse 1.5s infinite;
}

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