/* ============================================================
   RESULTS.CSS - Results Visualization & Analytics
   Data display, charts, and performance metrics
   ============================================================ */

/* Results Container */
.results-container {
  height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}

.results-container::-webkit-scrollbar {
  width: 10px;
}

.results-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 5px;
}

.results-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}

.results-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* Results Placeholder */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  color: var(--text-secondary);
  height: 100%;
}

.results-placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
}

.results-placeholder h3 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-weight: 600;
}

.results-placeholder p {
  font-size: 1rem;
  margin: 0;
  max-width: 400px;
}

/* Results Tabs */
.results-tabs {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.results-tab {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: var(--transition-smooth);
  white-space: nowrap;
  font-family: var(--font-main);
}

.results-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.results-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Three Column Layout */
.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.column-panel {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  transition: var(--transition-smooth);
}

.column-panel:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.column-panel::-webkit-scrollbar {
  width: 6px;
}

.column-panel::-webkit-scrollbar-track {
  background: transparent;
}

.column-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.column-header {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-header.blue {
  color: var(--accent-blue);
}

.column-header.orange {
  color: var(--accent-orange);
}

.column-header.green {
  color: var(--accent-green);
}

.column-header.purple {
  color: var(--accent-purple);
}

.column-header.teal {
  color: var(--accent-teal);
}

.column-header.gold {
  color: var(--accent-gold);
}

.column-content {
  color: var(--text-primary);
  font-size: 0.925rem;
  line-height: 1.7;
}

.column-content p {
  margin: 0 0 0.75rem 0;
}

.column-content ul {
  margin: 0;
  padding-left: 1.25rem;
}

.column-content li {
  margin-bottom: 0.5rem;
}

/* Token Chart */
.token-chart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chart-label {
  min-width: 120px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.chart-bar-container {
  flex: 1;
  position: relative;
  height: 28px;
}

.chart-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chart-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.15), transparent);
  animation: chartShimmer 2s infinite;
}

@keyframes chartShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.chart-bar.blue {
  background: linear-gradient(90deg, var(--accent-blue), rgba(74, 158, 255, 0.7));
}

.chart-bar.orange {
  background: linear-gradient(90deg, var(--accent-orange), rgba(255, 140, 66, 0.7));
}

.chart-bar.green {
  background: linear-gradient(90deg, var(--accent-green), rgba(0, 210, 106, 0.7));
}

.chart-bar.purple {
  background: linear-gradient(90deg, var(--accent-purple), rgba(168, 85, 247, 0.7));
}

.chart-bar.teal {
  background: linear-gradient(90deg, var(--accent-teal), rgba(45, 212, 191, 0.7));
}

.chart-bar.gold {
  background: linear-gradient(90deg, var(--accent-gold), rgba(245, 158, 11, 0.7));
}

.chart-value {
  min-width: 60px;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Summary Stats */
.summary-stats {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  flex: 1;
  min-width: 200px;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--accent-green);
}

.stat-change.negative {
  color: var(--accent-orange);
}

/* Gantt Chart */
.gantt-container {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.gantt-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.gantt-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.gantt-label {
  min-width: 140px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.gantt-bar-area {
  flex: 1;
  position: relative;
  height: 32px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  overflow: visible;
}

.gantt-bar {
  position: absolute;
  height: 28px;
  top: 2px;
  border-radius: 6px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gantt-bar.blue {
  background: var(--accent-blue);
}

.gantt-bar.orange {
  background: var(--accent-orange);
}

.gantt-bar.green {
  background: var(--accent-green);
}

.gantt-bar.purple {
  background: var(--accent-purple);
}

.gantt-bar.teal {
  background: var(--accent-teal);
}

.gantt-bar.gold {
  background: var(--accent-gold);
}

/* Timeline Container */
.timeline-container {
  margin-top: 1.5rem;
  position: relative;
  padding-left: 2rem;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.375rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.timeline-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-content {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 1rem;
  border-left: 3px solid var(--accent-blue);
}

.timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.comparison-table thead {
  background: rgba(0, 0, 0, 0.04);
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.comparison-table td {
  padding: 1rem;
  color: var(--text-primary);
  font-size: 0.925rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.comparison-table tbody tr {
  transition: background 0.2s ease;
}

.comparison-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

/* Metric Badge */
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.metric-badge.success {
  background: rgba(0, 210, 106, 0.15);
  color: var(--accent-green);
}

.metric-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

.metric-badge.info {
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent-blue);
}

/* Responsive */
@media (max-width: 1024px) {
  .results-container {
    height: auto;
    padding: 1rem;
  }

  .three-column {
    grid-template-columns: 1fr;
  }

  .summary-stats {
    flex-direction: column;
  }

  .stat-card {
    min-width: 100%;
  }

  .gantt-label {
    min-width: 100px;
    font-size: 0.8rem;
  }

  .timeline-container {
    padding-left: 1.5rem;
  }

  .comparison-table {
    font-size: 0.85rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Loading State */
.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
}
