/* ================================================================ *\
	Professional Performance Dashboard Styles
\* ================================================================ */

/* Performance Dashboard Container */
.performance-dashboard {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Performance Summary Header */
.performance-summary-header {
  margin-bottom: 2rem;
  padding: 1.5rem;

  border-radius: 16px;
  backdrop-filter: blur(20px);
}

.summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.summary-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(118, 255, 212, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(118, 255, 212, 0.1);
}

.summary-metric-card.primary {
  background: linear-gradient(135deg, rgba(118, 255, 212, 0.1) 0%, rgba(99, 198, 255, 0.05) 100%);
  border-color: rgba(118, 255, 212, 0.3);
}

.summary-metric-card.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #76ffd4, #63c6ff);
}

.summary-metric-card .metric-icon {
  width: 40px;
  height: 40px;
  background: rgba(118, 255, 212, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-metric-card .metric-icon i {
  font-size: 1.25rem;
  color: #76ffd4;
}

.summary-metric-card .metric-content {
  flex: 1;
}

.summary-metric-card .metric-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.summary-metric-card .metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.125rem;
  line-height: 1;
}

.summary-metric-card.primary .metric-value {
  background: linear-gradient(135deg, #76ffd4 0%, #63c6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summary-metric-card .metric-change {
  font-size: 0.75rem;
  font-weight: 600;
}

.summary-metric-card .metric-sublabel {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.125rem;
  line-height: 1;
}

/* Realized Return Cards */
.realized-return-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.realized-return-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.1);
}

.realized-return-card.primary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.realized-return-card.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.realized-return-card .return-icon {
  width: 40px;
  height: 40px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.realized-return-card .return-icon i {
  font-size: 1.25rem;
  color: #22c55e;
}

.realized-return-card .return-content {
  flex: 1;
}

.realized-return-card .return-label {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.25rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.realized-return-card .return-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.125rem;
  line-height: 1;
}

.realized-return-card.primary .return-value {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.realized-return-card .return-change {
  font-size: 0.75rem;
  font-weight: 600;
}

.realized-return-card .return-change.positive {
  color: #22c55e;
}

.realized-return-card .return-change.negative {
  color: #ef4444;
}

.realized-return-card .return-sublabel {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.125rem;
  line-height: 1;
}

/* Performance Tabs */
.performance-tabs-container {
  margin-bottom: 2rem;
}

.performance-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.performance-tabs::-webkit-scrollbar {
  display: none;
}

.performance-tab-btn {
  flex: 1;
  min-width: 160px;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.performance-tab-btn:hover {
  color: #76ffd4;
  background: rgba(118, 255, 212, 0.1);
}

.performance-tab-btn.active {
  background: linear-gradient(135deg, #76ffd4, #63c6ff);
  color: #000000;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(118, 255, 212, 0.3);
}

.performance-tab-btn i {
  font-size: 1rem;
}

/* Performance Tab Content */
.performance-tab-content {
  min-height: 600px;
}

.performance-tab-panel {
  display: none;
}

.performance-tab-panel.active {
  display: block;
}

/* Returns Analysis Tab */
.returns-analysis-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.returns-chart-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
}

/* Unified Chart Section */
.unified-chart-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
}

.unified-chart-container {
  position: relative;
  min-height: 400px;
}

/* Chart Type Selector */
.chart-type-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.25rem;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chart-type-selector::-webkit-scrollbar {
  display: none;
}

.chart-type-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  min-width: fit-content;
}

.chart-type-btn:hover {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.chart-type-btn.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.chart-type-btn i {
  font-size: 0.875rem;
}

.chart-type-btn span {
  font-weight: inherit;
}
  backdrop-filter: blur(20px);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-header h3 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.chart-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.period-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.period-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.period-btn:last-child {
  border-right: none;
}

.period-btn:hover {
  color: #76ffd4;
  background: rgba(118, 255, 212, 0.1);
}

.period-btn.active {
  background: #76ffd4;
  color: #000000;
  font-weight: 600;
}

.chart-container {
  position: relative;
  height: 400px;
  margin-bottom: 1rem;
  z-index: 1;
}

.chart-container:not(:last-child) {
  margin-bottom: 2rem;
}

.performance-chart {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ensure both charts have distinct containers */
#performanceChart {
  position: relative;
  z-index: 10;
}

#portfolioReturnGraph {
  position: relative;
  z-index: 10;
}

.chart-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}



/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(118, 255, 212, 0.3);
  transform: translateY(-2px);
}

.kpi-card .kpi-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #76ffd4;
}

.kpi-card .kpi-value.positive {
  color: #6dff6d;
}

.kpi-card .kpi-value.negative {
  color: #ff7c7c;
}

/* Risk Analysis Tab */
.risk-analysis-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
}

.risk-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.risk-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.risk-metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(118, 255, 212, 0.3);
}

.risk-metric-card.highlight {
  background: linear-gradient(135deg, rgba(255, 124, 124, 0.05) 0%, rgba(255, 217, 61, 0.05) 100%);
  border-color: rgba(255, 124, 124, 0.3);
}

.risk-metric-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.risk-metric-header i {
  font-size: 1.25rem;
  color: #ff7c7c;
}

.risk-metric-header h4 {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.risk-level-indicator {
  margin-bottom: 1rem;
}

.risk-level-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  margin-bottom: 0.5rem;
}

.risk-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #6dff6d, #ffd93d, #ff7c7c);
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
}

.risk-level-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.risk-score {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.risk-metric-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.risk-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #76ffd4;
  margin-bottom: 0.5rem;
}

.risk-metric-sublabel {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

/* Advanced Metrics Tab */
.advanced-metrics-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
}

/* Monthly Details Tab */
.monthly-details-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .returns-chart-section {
    padding: 1.5rem;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .period-selector {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .performance-dashboard {
    padding: 0;
  }
  
  .performance-summary-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .summary-metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .summary-metric-card {
    padding: 1rem;
  }
  
  .performance-tabs {
    padding: 0.25rem;
    gap: 0.125rem;
  }
  
  .performance-tab-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    min-width: 120px;
  }
  
  .performance-tab-btn span {
    display: none;
  }
  
  .performance-tab-btn i {
    font-size: 1.125rem;
  }
  
  .returns-chart-section,
  .risk-analysis-container,
  .advanced-metrics-container,
  .monthly-details-container {
    padding: 1rem;
    margin: 0;
  }
  
  .chart-container {
    height: 300px;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .risk-metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .summary-metric-card .metric-value {
    font-size: 1.5rem;
  }
  
  .chart-container {
    height: 250px;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .period-selector {
    flex-wrap: wrap;
  }
  
  .period-btn {
    flex: 1;
    min-width: 50px;
  }
}

/* Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Metric value color classes */
.metric-value.positive,
.kpi-value.positive,
.risk-metric-value.positive {
  color: #6dff6d;
}

.metric-value.negative,
.kpi-value.negative,
.risk-metric-value.negative {
  color: #ff7c7c;
}

.metric-value.neutral,
.kpi-value.neutral,
.risk-metric-value.neutral {
  color: #76ffd4;
}

.metric-value.warning,
.kpi-value.warning,
.risk-metric-value.warning {
  color: #ffd93d;
}

/* Return Type Toggle Styles */
.return-type-indicator {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  margin-left: 0.5rem;
}

.return-toggle-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
}

.return-toggle-btn:hover {
  color: #76ffd4;
  background: rgba(118, 255, 212, 0.1);
  transform: scale(1.1);
}

.return-toggle-btn:active {
  transform: scale(0.95);
}

.return-toggle-btn i {
  transition: transform 0.3s ease;
}

.return-toggle-btn:hover i {
  transform: rotate(180deg);
}