/* ============================================
   KY Consultation — Business Intelligence Demo
   Loaded on: lead-demo.html only
   Spreadsheet grid, tabs, progress bar, cell animations
   ============================================ */

/* Tab switcher */
.demo-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #27273A;
}

.demo-tab {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94A3B8;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 200ms ease;
}

.demo-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #5E289D;
  transform: scaleX(0);
  transition: transform 200ms ease;
}

.demo-tab:hover {
  color: #E2E8F0;
}

.demo-tab.is-active {
  color: #E2E8F0;
}

.demo-tab.is-active::after {
  transform: scaleX(1);
}

/* Tab panels */
.demo-panel {
  display: none;
}

.demo-panel.is-active {
  display: block;
}

/* Spreadsheet grid */
.spreadsheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}

.spreadsheet th,
.spreadsheet td {
  padding: 0.625rem 0.75rem;
  border: 1px solid #27273A;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.spreadsheet th {
  background: #131320;
  color: #94A3B8;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.spreadsheet td {
  background: #1A1A2E;
  color: #E2E8F0;
}

.spreadsheet tbody tr {
  transition: background-color 200ms ease;
}

.spreadsheet tbody tr:hover td {
  background: #1F1F36;
}

/* Row number column */
.spreadsheet .row-num {
  width: 40px;
  text-align: center;
  color: #64748B;
  font-size: 0.75rem;
  background: #131320;
}

/* Cell animation */
.cell-hidden {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.cell-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Input cell */
.spreadsheet-input {
  background: transparent;
  border: none;
  color: #E2E8F0;
  font-size: 0.8125rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  padding: 0;
}

.spreadsheet-input::placeholder {
  color: #4A5568;
}

/* Active input row */
.input-row td {
  border-color: rgba(94, 40, 157, 0.3);
}

/* Run button */
.run-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #5E289D;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.run-btn:hover {
  background: #7B3BC7;
  transform: translateY(-1px);
}

.run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Progress bar */
.progress-bar-wrap {
  height: 3px;
  background: #27273A;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 200ms ease;
}

.progress-bar-wrap.is-active {
  opacity: 1;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5E289D, #7B3BC7);
  border-radius: 2px;
  width: 0%;
  transition: width 200ms ease;
  box-shadow: 0 0 8px rgba(94, 40, 157, 0.4);
}

/* Status message */
.status-msg {
  font-size: 0.75rem;
  color: #94A3B8;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.status-msg .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #27273A;
  border-top-color: #5E289D;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.error-msg {
  font-size: 0.75rem;
  color: #F59E0B;
  min-height: 1.25rem;
}

/* LinkedIn icon in cells */
.linkedin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #0A66C2;
  border-radius: 3px;
  color: #FFFFFF;
  transition: opacity 150ms ease;
}

.linkedin-icon:hover {
  opacity: 0.85;
}

/* Star rating */
.star-rating {
  display: inline-flex;
  gap: 1px;
  color: #F59E0B;
  font-size: 0.75rem;
}

.star-rating .star-empty {
  color: #4A5568;
}

/* CTA overlay (after max rows) */
.cta-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(11, 11, 15, 0.85) 40%, rgba(11, 11, 15, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2rem;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.cta-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Local search input */
.local-search-input {
  background: #1A1A2E;
  border: 1px solid #27273A;
  color: #E2E8F0;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  transition: border-color 200ms ease;
  min-width: 320px;
}

.local-search-input:focus {
  outline: none;
  border-color: #5E289D;
  box-shadow: 0 0 0 3px rgba(94, 40, 157, 0.15);
}

.local-search-input::placeholder {
  color: #4A5568;
}

/* Citation badges */
.cite-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  color: #C4B5FD;
  background: rgba(94, 40, 157, 0.2);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 2px;
  vertical-align: super;
  line-height: 1;
}

/* Responsive: horizontal scroll on small screens */
.spreadsheet-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-radius: 0.5rem;
  border: 1px solid #27273A;
}

/* Callout box */
.demo-callout {
  background: rgba(94, 40, 157, 0.08);
  border: 1px solid rgba(94, 40, 157, 0.2);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.8125rem;
  color: #94A3B8;
  line-height: 1.6;
}

.demo-callout strong {
  color: #E2E8F0;
}

/* Differentiators column — allow wrapping */
.spreadsheet td:last-child {
  white-space: normal;
  min-width: 200px;
  max-width: 280px;
  line-height: 1.4;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .demo-tab {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  .spreadsheet th,
  .spreadsheet td {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }
}
