/**
 * Chart Gallery Styles
 * Sidebar for browsing Executive Summary charts
 */

.chart-gallery {
  position: fixed;
  left: -350px;
  top: 0;
  width: 350px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e0e0e0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-gallery.visible {
  left: 0;
}

/* Header */
.chart-gallery-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-gallery-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.btn-close-gallery {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close-gallery:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Content */
.chart-gallery-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Summary Group */
.summary-group {
  margin-bottom: 24px;
}

.summary-group-header {
  padding: 12px;
  background: #f7fafc;
  border-radius: 8px;
  margin-bottom: 12px;
}

.summary-title {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
}

.summary-chart-count {
  font-size: 12px;
  color: #718096;
}

/* Charts Grid */
.summary-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Chart Item */
.chart-item {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  transition: all 0.2s;
  position: relative;
}

.chart-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.chart-item:active,
.chart-item.dragging {
  cursor: grabbing;
  opacity: 0.6;
}

.chart-thumbnail {
  width: 100%;
  height: 160px;
  background: #f7fafc;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.chart-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-drag-hint {
  font-size: 11px;
  color: #a0aec0;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.chart-item:hover .chart-drag-hint {
  opacity: 1;
}

/* Empty State */
.chart-gallery-empty,
.chart-gallery-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  height: calc(100% - 80px);
}

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

.empty-title,
.error-title {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.empty-text,
.error-text {
  font-size: 14px;
  color: #718096;
  line-height: 1.5;
}

.btn-retry-gallery {
  margin-top: 16px;
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-retry-gallery:hover {
  background: #5568d3;
}

/* Scrollbar */
.chart-gallery-content::-webkit-scrollbar {
  width: 8px;
}

.chart-gallery-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chart-gallery-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.chart-gallery-content::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Responsive */
@media (max-width: 768px) {
  .chart-gallery {
    width: 280px;
    left: -280px;
  }
  
  .chart-thumbnail {
    height: 120px;
  }
}
