/* Pi Keyboard Bridge - Bootstrap 5 Customizations */

:root {
  --bs-body-bg: #212529;
  --bs-body-color: #dee2e6;
}

.status-card .status-item {
  display: inline-block;
  margin-right: 1.5rem;
}

.trackpad-area {
  width: 100%;
  height: 300px;
  background: #343a40;
  border: 1px solid #495057;
  border-radius: .375rem;
  cursor: none;
  position: relative;
  user-select: none;
  touch-action: none; /* Prevent default touch behaviors */
  -webkit-touch-callout: none; /* Prevent iOS callout menu */
  -webkit-user-select: none; /* Prevent text selection on iOS */
}

#cursor_dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #000;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}

.trackpad-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #adb5bd;
  text-align: center;
  pointer-events: none;
}

.trackpad-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.trackpad-text {
  font-size: 1.25rem;
  font-weight: bold;
}

/* Touch-specific styles for mobile devices */
@media (hover: none) and (pointer: coarse) {
  .trackpad-area {
    height: 350px; /* Larger touch target on mobile */
  }
  
  .trackpad-text {
    font-size: 1rem;
  }
  
  .trackpad-text::after {
    content: " • Touch to move cursor";
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: normal;
  }
}

.unmapped-keys-container {
  max-height: 300px;
  overflow-y: auto;
}

.unmapped-key-item {
  cursor: pointer;
}

.cal-point {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  color: #ced4da;
  transition: all 0.3s;
}

.cal-point.done {
  background: #198754; /* Bootstrap success */
  color: white;
  transform: scale(1.1);
}

.cal-point.active {
  background: #ffc107; /* Bootstrap warning */
  color: #000;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* LED Status Indicators */
.led-indicators {
  border: 1px solid #495057;
}

.led-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  min-width: 100px;
  transition: all 0.2s ease;
}

.led-indicator.clickable {
  cursor: pointer;
  border-radius: 0.375rem;
  user-select: none;
}

.led-indicator.clickable:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: scale(1.05);
}

.led-indicator.clickable:active {
  transform: scale(0.98);
  background-color: rgba(255, 255, 255, 0.1);
}

.led-label {
  font-size: 0.875rem;
  color: #adb5bd;
  font-weight: 500;
}

.led-indicator.clickable .led-label {
  color: #dee2e6;
}

.led-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  transition: all 0.3s ease;
}

.led-indicator[data-state="on"] .led-badge {
  background-color: #198754 !important; /* Green when on */
  animation: led-pulse 2s infinite;
}

.led-indicator[data-state="off"] .led-badge {
  background-color: #6c757d !important; /* Gray when off */
}

.led-indicator.clickable[data-state="on"]:hover .led-badge {
  background-color: #20c997 !important; /* Lighter green on hover when on */
}

.led-indicator.clickable[data-state="off"]:hover .led-badge {
  background-color: #868e96 !important; /* Lighter gray on hover when off */
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}