/**
 * Chart Options Sidebar Styles
 */

.canvas-layout-chart-options-sidebar {
  position: fixed;
  top: 140px;
  right: 0;
  width: 320px;
  height: calc(100vh - 140px);
  background: white;
  border-left: 1px solid #e1e4e8;
  border-top: 1px solid #e1e4e8;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 900;
  overflow-y: auto;
}

.canvas-layout-chart-options-sidebar.open {
  transform: translateX(0);
}

/* When context panel (settings) is also open, shift chart options left */
.canvas-layout-right-sidebar.open ~ .canvas-layout-chart-options-sidebar.open {
  transform: translateX(-360px); /* Width of context panel + gap */
}

/* Sidebar Content */
.chart-options-sidebar .sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.chart-options-sidebar .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e1e4e8;
  background: #f6f8fa;
}

.chart-options-sidebar .sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #24292e;
}

.chart-options-sidebar .sidebar-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #586069;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.chart-options-sidebar .sidebar-close-btn:hover {
  background: #e1e4e8;
  color: #24292e;
}

/* Body */
.chart-options-sidebar .sidebar-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* Chart Info Box */
.chart-info-box {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 20px;
}

.chart-info-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #586069;
  font-weight: 600;
  margin-bottom: 4px;
}

.chart-info-name {
  font-size: 14px;
  color: #24292e;
  font-weight: 500;
}

/* Empty State */
.sidebar-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 600;
  color: #24292e;
  margin-bottom: 8px;
}

.empty-state-hint {
  font-size: 13px;
  color: #586069;
}

/* Option Section */
.option-section {
  margin-bottom: 20px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
}

.option-section.enabled {
  border-color: #0969da;
}

.option-section-header {
  background: #f6f8fa;
  padding: 12px;
  border-bottom: 1px solid #e1e4e8;
}

.option-section.enabled .option-section-header {
  background: #ddf4ff;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.option-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.option-title {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  user-select: none;
}

.option-section-body {
  padding: 12px;
  transition: opacity 0.2s;
}

.option-section-body.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Option Field */
.option-field {
  margin-bottom: 12px;
}

.option-field:last-child {
  margin-bottom: 0;
}

.option-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #57606a;
  margin-bottom: 6px;
}

.option-field select,
.option-field input[type="number"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  transition: all 0.2s;
}

.option-field select:focus,
.option-field input[type="number"]:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.option-field input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px;
}

.option-field input:disabled,
.option-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f6f8fa;
}

/* Sidebar Actions */
.sidebar-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e1e4e8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-actions .btn-primary {
  width: 100%;
  padding: 10px 16px;
  background: #0969da;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-actions .btn-primary:hover {
  background: #0860ca;
}

.sidebar-actions .btn-secondary {
  width: 100%;
  padding: 10px 16px;
  background: white;
  color: #24292e;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-actions .btn-secondary:hover {
  background: #f6f8fa;
  border-color: #b8bfc6;
}

/* Scrollbar */
.chart-options-sidebar .sidebar-body::-webkit-scrollbar {
  width: 8px;
}

.chart-options-sidebar .sidebar-body::-webkit-scrollbar-track {
  background: #f6f8fa;
}

.chart-options-sidebar .sidebar-body::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 4px;
}

.chart-options-sidebar .sidebar-body::-webkit-scrollbar-thumb:hover {
  background: #b8bfc6;
}

/* Responsive */
@media (max-width: 768px) {
  .canvas-layout-chart-options-sidebar {
    width: 100%;
  }
  
  .canvas-layout-right-sidebar.open ~ .canvas-layout-chart-options-sidebar.open {
    transform: translateX(-100%);
  }
}
