/* Playground Panel Fix for FastAPI App */

/* Playground Panel Container */
.playground-panel {
  width: 320px;
  background: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* Playground Header */
.playground-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.playground-title {
  font-size: 18px;
  font-weight: 600;
  color: #212121;
  margin: 0 0 8px 0;
}

.context-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #616161;
}

.context-badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.context-badge.sem {
  background: #2E7D32;
  color: white;
}

.context-badge.afm {
  background: #F57C00;
  color: white;
}

.context-badge.all {
  background: #2196F3;
  color: white;
}

/* Playground Content */
.playground-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.playground-content-inner {
  padding: 20px;
}

/* Preset Section */
.preset-section {
  margin-bottom: 24px;
}

.preset-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.preset-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #616161;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #f5f5f5;
  border-color: #9e9e9e;
}

.preset-btn.active {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

/* Config Groups */
.config-group {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.config-group-header {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

.config-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #212121;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.type-indicator {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-indicator.common {
  background: #E3F2FD;
  color: #1976D2;
}

.type-indicator.sem {
  background: #E8F5E9;
  color: #2E7D32;
}

.type-indicator.afm {
  background: #FFF3E0;
  color: #F57C00;
}

/* Control Items */
.control-item {
  padding: 16px;
  border-bottom: 1px solid #e8e8e8;
}

.control-item:last-child {
  border-bottom: none;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: #424242;
}

.control-value {
  font-weight: 600;
  color: #1976D2;
  font-size: 12px;
  background: #E3F2FD;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Range Sliders */
.mini-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #e0e0e0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.mini-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #2196F3;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.mini-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.mini-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #2196F3;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.mini-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

/* Select Dropdowns */
.mini-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: white;
  font-size: 13px;
  color: #424242;
  cursor: pointer;
  transition: all 0.2s;
}

.mini-select:hover {
  border-color: #9e9e9e;
}

.mini-select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Toggle Controls */
.toggle-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e8e8e8;
}

.toggle-control:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 13px;
  color: #424242;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: #bdbdbd;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
  background: #2196F3;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

/* Apply Section */
.apply-section {
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apply-btn {
  width: 100%;
  padding: 12px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.apply-btn:hover {
  background: #1976D2;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.reset-btn {
  width: 100%;
  padding: 12px;
  background: white;
  color: #616161;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  background: #f5f5f5;
  border-color: #9e9e9e;
}

/* Scrollbar Styling */
.playground-content::-webkit-scrollbar {
  width: 8px;
}

.playground-content::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.playground-content::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 4px;
}

.playground-content::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .playground-panel {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .playground-panel {
    position: fixed;
    left: -320px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .playground-panel.open {
    left: 0;
  }
}

/* Help Icon and Tooltip Styles */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  background-color: #e3f2fd;
  color: #1976d2;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.help-icon:hover {
  background-color: #1976d2;
  color: white;
  transform: scale(1.1);
}

.binning-help {
  margin-top: 12px;
  padding: 12px;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #616161;
}

.help-content {
  max-width: 100%;
}

.strategy-help {
  display: none;
}

.strategy-help strong {
  color: #424242;
  display: block;
  margin-bottom: 4px;
}

.binning-help.show {
  display: block !important;
}

.strategy-help.active {
  display: block !important;
}