/* ==========================================
   Demo Controls - Floating Control Panel
   ========================================== */

.demo-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  background: #fff;
  border: 2px solid #1a73e8;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-width: 280px;
  transition: opacity 0.3s, transform 0.3s;
  user-select: none;
}

.demo-controls.collapsed {
  min-width: auto;
  padding: 8px 12px;
}

.demo-controls.collapsed .demo-controls__body {
  display: none;
}

/* Header */
.demo-controls__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  cursor: pointer;
}

.demo-controls.collapsed .demo-controls__header {
  margin-bottom: 0;
}

.demo-controls__title {
  font-size: 14px;
  font-weight: 700;
  color: #1a73e8;
  letter-spacing: 0.3px;
}

.demo-controls__collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  padding: 0 4px;
  line-height: 1;

}

/* Toggle Section */
.demo-controls__section {
  margin-bottom: 12px;
}

.demo-controls__section:last-child {
  margin-bottom: 0;
}

.demo-controls__label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}

/* ON/OFF Toggle Switch */
.demo-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-toggle__switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;

}

.demo-toggle__switch.active {
  background: #1a73e8;
}

.demo-toggle__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.demo-toggle__switch.active::after {
  transform: translateX(22px);
}

.demo-toggle__status {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  min-width: 30px;
}

.demo-toggle__switch.active + .demo-toggle__status {
  color: #1a73e8;
}

/* Button Group (Year / Term) */
.demo-btn-group {
  display: flex;
  gap: 6px;
}

.demo-btn {
  padding: 6px 14px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;

}

.demo-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

.demo-btn.active {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.demo-btn.active:hover {
  background: #1557b0;
  border-color: #1557b0;
}

/* Loading overlay */
.demo-controls__loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #666;
}

.demo-controls__loading::after {
  content: '読み込み中...';
}

/* Status indicator */
.demo-controls__status {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.demo-controls__status.error {
  color: #d93025;
}

/* Responsive - smaller screens */
@media (max-width: 768px) {
  .demo-controls {
    bottom: 10px;
    right: 10px;
    min-width: 240px;
    padding: 12px 16px;
  }

  .demo-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
}
