/* Saved Charts Panel Styles */

/* List */
.saved-charts-list {
  padding: 8px 0;
}

/* Tabs */
.saved-charts-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  padding: 0 12px;
  background-color: #f9fafb;
}

.saved-charts-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
  position: relative;
  margin-bottom: -2px;
}

.saved-charts-tab:hover {
  color: #374151;
  background-color: #f3f4f6;
}

.saved-charts-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background-color: #ffffff;
}

.saved-charts-section-header {
  padding: 16px 12px 8px;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.saved-charts-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* Individual Chart Item */
.saved-chart-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 12px;
  background-color: #ffffff;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.saved-chart-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.chart-clickable-area {
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: 94px;
}

.chart-clickable-area:hover {
  background-color: #f9fafb;
}

.chart-thumbnail {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.chart-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chart-thumbnail i {
  font-size: 28px;
  color: #9ca3af;
}

.chart-info {
  flex: 1;
  min-width: 0;
}

.chart-info h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.chart-info h4:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  background-color: #1f2937;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 13px;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chart-info .chart-type {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: #6b7280;
}

.chart-info .chart-dataset {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-info .chart-dataset i {
  font-size: 11px;
  color: #9ca3af;
}

.chart-info .chart-date {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
}

.saved-chart-item .chart-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
}

.chart-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
  min-width: 40px;
  background: white;
  color: #374151;
}

.saved-chart-item .chart-actions .btn.btn-primary,
.chart-actions .btn-primary {
  flex: 1;
  border-color: #d1d5db;
}

.saved-chart-item .chart-actions .btn.btn-primary:hover,
.chart-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-item .chart-actions .btn.btn-secondary,
.chart-actions .btn-secondary {
  border-color: #d1d5db;
}

.saved-chart-item .chart-actions .btn.btn-secondary:hover,
.chart-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.chart-actions .btn-info {
  border-color: #d1d5db;
}

.chart-actions .btn-info:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-item .chart-actions .btn.btn-danger,
.chart-actions .btn-danger {
  border-color: #d1d5db;
  color: #ef4444;
}

.saved-chart-item .chart-actions .btn.btn-danger:hover,
.chart-actions .btn-danger:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

/* Chart Set Item */
.saved-chart-set-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 12px;
  background-color: #ffffff;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.saved-chart-set-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.chart-set-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chart-set-header:hover {
  background-color: #f9fafb;
}

.chart-set-expand-icon {
  font-size: 16px;
  color: #6b7280;
  flex-shrink: 0;
  width: 20px;
  transition: transform 0.2s;
}

.chart-set-info {
  flex: 1;
  min-width: 0;
}

.chart-set-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-set-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.chart-set-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 13px;
}

.chart-set-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.chart-set-note-icon {
  font-size: 14px;
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chart-set-note-icon:hover {
  opacity: 1;
}

.chart-set-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.chart-set-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
  min-width: 40px;
  background: white;
  color: #374151;
}

.saved-chart-set-item .chart-set-actions .btn.btn-primary,
.chart-set-actions .btn-primary {
  flex: 1;
  border-color: #d1d5db;
}

.saved-chart-set-item .chart-set-actions .btn.btn-primary:hover,
.chart-set-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-set-item .chart-set-actions .btn.btn-secondary,
.chart-set-actions .btn-secondary {
  border-color: #d1d5db;
}

.saved-chart-set-item .chart-set-actions .btn.btn-secondary:hover,
.chart-set-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-set-item .chart-set-actions .btn.btn-danger,
.chart-set-actions .btn-danger {
  border-color: #d1d5db;
  color: #ef4444;
}

.saved-chart-set-item .chart-set-actions .btn.btn-danger:hover,
.chart-set-actions .btn-danger:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

/* Chart Set Charts Container */
.chart-set-charts-container {
  padding: 12px;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.chart-set-chart-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.chart-set-chart-preview:hover {
  background-color: #ffffff;
  border-color: #3b82f6;
}

.chart-set-chart-preview:last-child {
  margin-bottom: 0;
}

.chart-preview-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-preview-name {
  flex: 1;
  font-size: 13px;
  color: #1f2937;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chart-preview-actions .btn,
.chart-preview-actions .btn-sm,
.chart-preview-actions .btn-xs {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 36px;
  background: white;
  color: #374151;
  font-weight: 500;
}

.chart-preview-actions .btn i {
  font-size: 12px;
}

.chart-preview-actions .btn-primary {
  border-color: #d1d5db;
}

.chart-preview-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.chart-preview-actions .btn-secondary {
  border-color: #d1d5db;
}

.chart-preview-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #6b7280;
  font-size: 13px;
}

.empty-state-small {
  text-align: center;
  padding: 12px;
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

.error-message-small {
  text-align: center;
  padding: 12px;
  color: #ef4444;
  font-size: 12px;
}
