/* =============================================
   features.css (Domain / page feature styles)
   ============================================= */

/* Scenario Profitability Simulation */
#scenarios .sim-panel {
  margin: 1rem 0;
}
#scenarios .sim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
#scenarios .sim-grid .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: 0.2s;
}
#scenarios .sim-grid .row:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 231, 255, 0.2);
  transform: translateY(-1px);
}
#scenarios .sim-grid .row.emph {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 231, 255, 0.15);
}
#scenarios .sim-grid .row.input {
  background: rgba(0, 0, 0, 0.25);
}
#scenarios .sim-grid .label {
  color: rgba(255, 255, 255, 0.7);
}
#scenarios .sim-grid .value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
#scenarios .sim-grid .value-input {
  width: 180px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: right;
  font-weight: 600;
  transition: 0.2s;
}
#scenarios .sim-grid .value-input:focus {
  outline: none;
  border-color: rgba(0, 231, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
}
#scenarios .scenario-chart {
  margin: 1rem 0;
  padding: 1.5rem;
}
#scenarios #scenarioChart {
  width: 100%;
  height: 160px;
  display: block;
}
#scenarios .chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.dot.up {
  background: var(--accent);
}
.dot.down {
  background: var(--brand);
}
.dot.spread {
  background: #a78bfa;
}
.dot.profit {
  background: #22c55e;
}

/* Economics Section */
/* Removed scoped kpi-list styles to use global .kpi-list in components.css */
#economics .eco-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
#economics .eco-cols .col {
  padding: 1.5rem;
}
@media (max-width: 900px) {
  #economics .eco-cols {
    grid-template-columns: 1fr;
  }
}

/* Finance / Investment */
.investment-input {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border: 1px solid rgba(0, 231, 255, 0.2);
  border-radius: 16px;
}
.investment-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .investment-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
}
.capex-breakdown h4 {
  margin: 0 0 1rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.breakdown-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}
.breakdown-list li:last-child {
  border-bottom: none;
}
.breakdown-list .amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.breakdown-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.5rem;
  border-top: 2px solid rgba(0, 231, 255, 0.3);
  font-weight: 700;
  font-size: 16px;
}
.breakdown-total .amount.total {
  color: var(--brand);
  font-size: 18px;
}
.input-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
}
.input-wrapper .currency {
  padding: 1rem 0 1rem 1rem;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 231, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.input-wrapper input {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.input-slider {
  margin-top: 1rem;
}
.input-slider input[type="range"] {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--muted);
}
.investment-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.metric {
  text-align: center;
  padding: 1rem;
}
.metric-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .investment-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .investment-metrics {
    grid-template-columns: 1fr;
  }
}

/* Portfolio */
#portfolio {
  position: relative;
  z-index: 1;
  overflow: hidden;
}
#portfolio .section-intro {
  color: var(--muted);
  font-size: 16px;
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
}
.portfolio-summary {
  margin: 2rem 0 3rem;
}
.portfolio-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  min-height: 140px;
}
.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 0.5rem;
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.site-card {
  padding: 0;
  min-height: 340px;
  overflow: hidden;
}
.site-card-header {
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.site-status.operational {
  color: var(--brand);
}
.site-status.construction {
  color: var(--accent);
}
.site-status.planning {
  color: var(--muted);
}
.site-details {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.site-spec {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.site-spec:last-child {
  border-bottom: none;
}
.site-performance {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  margin-top: auto;
}
.performance-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.performance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-700));
  transition: width 0.6s ease;
}
.construction-progress .performance-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent));
}
.planning-progress .performance-fill {
  background: linear-gradient(90deg, var(--muted), var(--muted));
}
.performance-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Strategy */
.portfolio-strategy {
  margin: 4rem 0;
}
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.strategy-item {
  display: flex;
  gap: 1.5rem;
  min-height: 120px;
  align-items: flex-start;
}
.strategy-icon {
  font-size: 1.5rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(0, 231, 255, 0.3));
  margin-top: 0.25rem;
}
.strategy-content h4 {
  margin: 0 0 0.75rem;
  font-size: 16px;
  font-weight: 700;
}
.strategy-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}
@media (max-width: 900px) {
  .strategy-grid {
    grid-template-columns: 1fr;
  }
}

/* Metrics */
.portfolio-metrics {
  margin: 4rem 0;
}
.metrics-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.metric-group h4 {
  margin: 0 0 1.5rem;
  font-size: 16px;
  font-weight: 700;
}
.revenue-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.revenue-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.revenue-bar {
  height: 10px;
  border-radius: 5px;
}
.revenue-bar.balancing {
  background: linear-gradient(90deg, var(--brand), var(--brand-700));
}
.revenue-bar.arbitrage {
  background: linear-gradient(90deg, var(--accent), var(--accent));
}
.revenue-bar.ancillary {
  background: linear-gradient(90deg, var(--muted), var(--muted));
}
.revenue-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.kpi-item {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: 0.2s;
}
.kpi-item:hover {
  border-color: rgba(0, 231, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
}
.kpi-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 0.25rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
@media (max-width: 900px) {
  .metrics-container {
    grid-template-columns: 1fr;
  }
}

/* Roadmap */
.portfolio-roadmap {
  margin: 4rem 0;
}
.roadmap-timeline {
  position: relative;
  padding-left: 2rem;
}
.roadmap-timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 2rem;
}
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: 0.3s;
}
.timeline-item.completed .timeline-dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 16px rgba(0, 255, 209, 0.5);
}
.timeline-item.active .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 231, 255, 0.5);
  animation: pulse 2s infinite;
}
.timeline-item.future .timeline-dot {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}
.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  transition: 0.3s;
}
.timeline-item:hover .timeline-content {
  border-color: rgba(0, 231, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}
.timeline-date {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.timeline-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.timeline-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* Ops Playbook */
#ops .ops-center {
  justify-content: center;
  align-items: center;
  text-align: center;
}
#ops .ops-center h3 {
  margin: 0;
}

/* Chat (restored styles) */
#aiChat {
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 231, 255, 0.06);
  overflow: hidden;
}
#aiChat .chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
      1200px 200px at 0% 0%,
      rgba(0, 231, 255, 0.07),
      transparent
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
}
#aiChat .chat-header h3 {
  margin: 0 0 0.25rem;
  font-size: 16px;
  font-weight: 700;
}
#aiChat .chat-messages {
  max-height: 360px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
}
#aiChat .chat-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
#aiChat .chat-message .message-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 8px;
  background: rgba(0, 231, 255, 0.12);
  border: 1px solid rgba(0, 231, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 231, 255, 0.15) inset;
}
#aiChat .chat-message.user .message-icon {
  color: var(--brand);
  background: rgba(0, 255, 209, 0.1);
  border-color: rgba(0, 255, 209, 0.25);
}
#aiChat .chat-message .message-content {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.5;
}
#aiChat .chat-message.user .message-content {
  background: rgba(0, 255, 209, 0.06);
  border-color: rgba(0, 255, 209, 0.18);
}
#aiChat .chat-input-area {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.35));
}
#aiChat #chatInput {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
#aiChat #chatInput:focus {
  outline: none;
  border-color: rgba(0, 231, 255, 0.45);
  background: rgba(0, 0, 0, 0.55);
}
#aiChat #chatSend {
  border: 1px solid rgba(0, 231, 255, 0.3);
  background: linear-gradient(
    180deg,
    rgba(0, 231, 255, 0.2),
    rgba(0, 231, 255, 0.05)
  );
  color: #dffcff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 700;
}
#aiChat #chatSend:hover {
  border-color: rgba(0, 231, 255, 0.5);
  box-shadow: 0 0 18px rgba(0, 231, 255, 0.25);
}

/* Placeholder removed — see restored chat styles later in this file */

/* Responsive Tweaks */
@media (max-width: 768px) {
  #scenarios .sim-grid .value-input {
    width: 100%;
  }
  .strategy-grid,
  .metrics-container {
    gap: 1.25rem;
  }
}
