/* aux-pane.css - Flexible shared width layout */

#aux-pane {
  position: relative;
  width: 400px;
  min-width: 320px;
  max-width: 60vw;
  height: 100vh;
  background: white;
  border-left: 1px solid #e5e7eb;
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
}

#aux-pane.active {
  display: flex;
}

/* Grip Handle - Always visible on right edge */
.aux-grip-handle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background: white;
  border: 1px solid #e5e7eb;
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* When aux pane is active, grip moves with it */
/*#aux-pane.active ~ .aux-grip-handle {
  right: var(--aux-pane-width, 400px);
  cursor: ew-resize;
}*/

.aux-grip-handle:hover {
  background: #f9fafb;
}

.aux-grip-handle:active {
  background: #f3f4f6;
}

.grip-icon {
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: color 0.2s;
}

.aux-grip-handle:hover .grip-icon {
  color: #3b82f6;
}

/* Add visual grab indicator */
.aux-grip-handle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 24px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 10%,
    #d1d5db 10%,
    #d1d5db 30%,
    transparent 30%,
    transparent 50%,
    #d1d5db 50%,
    #d1d5db 70%,
    transparent 70%,
    transparent 90%,
    #d1d5db 90%,
    #d1d5db 100%
  );
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.aux-grip-handle:hover::before {
  opacity: 1;
}

/* Header */
#aux-header {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.aux-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  margin-left: auto;
}

.aux-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Content */
#aux-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.aux-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Carousel */
.carousel-section {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px 0;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #e5e7eb;
}

.carousel-section::-webkit-scrollbar {
  height: 8px;
}

.carousel-section::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 4px;
}

.carousel-section::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 4px;
  transition: background 0.2s;
}

.carousel-section::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

.carousel-item {
  min-width: 140px;
  max-width: 140px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.carousel-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.carousel-item.active {
  background: #eff6ff;
  border-color: #3b82f6;
}

.carousel-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.carousel-item-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.opportunity-indicator {
  display: flex;
  align-items: center;
}

.carousel-item-title {
  font-size: 13px;
  color: #111827;
  line-height: 1.3;
}

.carousel-empty {
  padding: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* Job Content */
.job-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pains-gains-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.charts-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 4px;
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-wrapper {
  background: #f9fafb;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-reference-key {
  flex-shrink: 0;
  order: -1; /* Ensure reference key appears first */
}

.chart-canvas-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.items-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  padding: 8px;
  background: #f9fafb;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.item.has-opportunity {
  background: #fef3c7;
  border-left: 2px solid #f59e0b;
}

.opportunity-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* User Stories Section */
.user-stories-section {
  margin-top: 16px;
}

.stories-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-scenario-card {
  background: #f9fafb;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s;
}

.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.story-header:hover {
  background: #f3f4f6;
}

.story-content-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.story-text {
  font-size: 13px;
  color: #111827;
  line-height: 1.5;
  margin: 0;
}

.story-chevron {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s;
  margin-left: 8px;
}

.story-scenario-card.expanded .story-chevron {
  transform: rotate(180deg);
}

.scenario-content {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px 10px 10px;
  border-top: 1px solid #e5e7eb;
  animation: slideDown 0.2s ease-out;
}

.story-scenario-card.expanded .scenario-content {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scenario-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.scenario-code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #111827;
  line-height: 1.6;
  margin: 0;
  padding: 8px;
  background: white;
  border-radius: 4px;
  border-left: 3px solid #3b82f6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Empty State */
.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* Scrollbar Styling */
#aux-content::-webkit-scrollbar {
  width: 8px;
}

#aux-content::-webkit-scrollbar-track {
  background: transparent;
}

#aux-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

#aux-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
  #aux-pane {
    position: fixed;
    right: 0;
    top: 0;
    width: 100vw !important;
    max-width: 100vw;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  #aux-pane.active {
    display: flex;
    transform: translateX(0);
  }

  .aux-grip-handle {
    display: flex !important;
    right: 0 !important;
  }

  #aux-pane.active ~ .aux-grip-handle {
    right: auto !important;
    left: 0;
    border-radius: 0 8px 8px 0;
    border-left: none;
    border-right: 1px solid #e5e7eb;
  }
}