/* 
 * diBoaS Investor Portal - Charts & Data Visualization CSS
 * Investment charts, metrics, and financial data visualization
 */

/* ===========================
   FUNDING ROUNDS SECTION
   =========================== */

.funding-timeline {
  position: relative;
  padding: var(--space-8) 0;
}

.funding-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-investor);
  transform: translateX(-50%);
}

.funding-rounds {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.funding-round {
  position: relative;
  background: var(--bg-investor-card);
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  width: calc(50% - var(--space-8));
  transition: all 0.3s ease;
}

.funding-round:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2xl);
}

.funding-round:nth-child(odd) {
  margin-left: 0;
  margin-right: auto;
}

.funding-round:nth-child(even) {
  margin-left: auto;
  margin-right: 0;
}

.funding-round::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--bg-investor-card);
  border: 3px solid var(--investor-primary);
  border-radius: 50%;
  top: var(--space-8);
}

.funding-round:nth-child(odd)::before {
  right: -42px;
}

.funding-round:nth-child(even)::before {
  left: -42px;
}

.funding-round.current {
  border-color: var(--status-positive);
}

.funding-round.current::before {
  border-color: var(--status-positive);
  background: var(--status-positive);
}

.funding-round.future {
  opacity: 0.7;
}

.funding-round.future::before {
  border-color: var(--text-investor-muted);
  background: var(--bg-investor-card);
}

.round-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.round-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-investor-primary);
  margin-bottom: var(--space-2);
}

.round-timing {
  font-size: var(--text-sm);
  color: var(--text-investor-secondary);
  font-weight: 500;
}

.round-status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.funding-round.current .round-status {
  background: var(--status-positive);
  color: white;
}

.funding-round.future .round-status {
  background: var(--bg-investor-secondary);
  color: var(--text-investor-tertiary);
}

.round-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.round-amount,
.round-valuation,
.round-milestone {
  text-align: center;
}

.amount-label,
.valuation-label,
.milestone-label {
  font-size: var(--text-sm);
  color: var(--text-investor-tertiary);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.amount-value,
.valuation-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--investor-primary);
}

.milestone-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-investor-primary);
}

.round-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-investor-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--investor-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: var(--text-sm);
  color: var(--text-investor-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* ===========================
   METRICS & CHARTS
   =========================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.metric-card {
  background: var(--bg-investor-card);
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--investor-gradient);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-icon {
  width: 48px;
  height: 48px;
  background: var(--investor-light);
  color: var(--investor-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: var(--text-xl);
}

.metric-card h4 {
  font-size: var(--text-sm);
  color: var(--text-investor-tertiary);
  font-weight: 500;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-investor-primary);
  margin-bottom: var(--space-2);
}

.metric-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
}

.metric-change.positive {
  color: var(--status-positive);
}

.metric-change.negative {
  color: var(--status-negative);
}

.metric-change.neutral {
  color: var(--status-neutral);
}

/* ===========================
   GROWTH CHART
   =========================== */

.growth-chart-container {
  background: var(--bg-investor-card);
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.chart-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-investor-primary);
}

.chart-controls {
  display: flex;
  gap: var(--space-2);
}

.chart-period-btn {
  background: none;
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-base);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-investor-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-period-btn:hover,
.chart-period-btn.active {
  background: var(--investor-primary);
  border-color: var(--investor-primary);
  color: var(--text-investor-inverse);
}

.chart-canvas {
  width: 100%;
  height: 300px;
  background: var(--bg-investor-secondary);
  border-radius: var(--radius-base);
  position: relative;
  overflow: hidden;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-investor-muted);
  font-size: var(--text-sm);
}

/* ===========================
   INVESTMENT BREAKDOWN
   =========================== */

.investment-breakdown {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-8);
  background: var(--bg-investor-card);
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-8);
}

.breakdown-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pie-chart {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(
    var(--investor-primary) 0deg 126deg,
    var(--investor-secondary) 126deg 216deg,
    var(--investor-accent) 216deg 306deg,
    var(--investor-light) 306deg 360deg
  );
}

.pie-chart::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  background: var(--bg-investor-card);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.breakdown-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.breakdown-legend h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-investor-primary);
  margin-bottom: var(--space-2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
}

.legend-color.primary {
  background: var(--investor-primary);
}

.legend-color.secondary {
  background: var(--investor-secondary);
}

.legend-color.accent {
  background: var(--investor-accent);
}

.legend-color.light {
  background: var(--investor-light);
}

.legend-info {
  flex: 1;
}

.legend-label {
  font-size: var(--text-base);
  color: var(--text-investor-primary);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.legend-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-investor-secondary);
}

.legend-percentage {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-investor-tertiary);
}

/* ===========================
   MARKET DATA
   =========================== */

.market-data-container {
  background: var(--bg-investor-card);
  border: 1px solid var(--border-investor);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.market-data-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-investor);
}

.market-data-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-investor-primary);
}

.market-data-update {
  font-size: var(--text-sm);
  color: var(--text-investor-tertiary);
}

.market-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.indicator-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-investor-hover);
  border-radius: var(--radius-base);
}

.indicator-icon {
  width: 32px;
  height: 32px;
  background: var(--investor-light);
  color: var(--investor-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
}

.indicator-info {
  flex: 1;
}

.indicator-label {
  font-size: var(--text-sm);
  color: var(--text-investor-tertiary);
  margin-bottom: var(--space-1);
}

.indicator-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-investor-primary);
}

/* ===========================
   ANIMATIONS FOR CHARTS
   =========================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width, 0%);
  }
}

@keyframes pieRotate {
  from {
    transform: rotate(-90deg);
  }
  to {
    transform: rotate(270deg);
  }
}

.metric-card {
  animation: fadeInUp 0.6s ease-out;
}

.metric-card:nth-child(2) {
  animation-delay: 0.1s;
}

.metric-card:nth-child(3) {
  animation-delay: 0.2s;
}

.metric-card:nth-child(4) {
  animation-delay: 0.3s;
}

.progress-fill {
  animation: progressFill 1s ease-out 0.5s both;
}

.pie-chart {
  animation: pieRotate 1s ease-out;
}