/* WizOpt Styles - Portfolio Optimization Wizard */

/* Wizard Container */
.wizard-container {
    width: 100%;
    margin-top: 40px;
  }
  
  /* Wizard Steps */
  .wizard-step {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  
  .wizard-step.active {
    display: block;
    opacity: 1;
  }
  
  .step-title {
    font-size: 2rem;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 15px;
  }
  
  .step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  
  /* Sector Selection */
  .sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
  }
  
  .sector-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .sector-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  
  .sector-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
  }
  
  .sector-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
  }
  
  .sector-count {
    color: #666;
    font-size: 0.9rem;
  }
  
  /* Company Selection */
  .selection-controls {
    display: flex;
    gap: 10px;
  }
  
  .selected-sector {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--color-text);
  }
  
  .companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
  }
  
  .company-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
  }
  
  .company-card.selected {
    background-color: rgba(0, 0, 0, 0.05);
  }
  
  .company-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    color: #4CAF50;
    font-size: 1.2rem;
    font-weight: bold;
  }
  
  .company-ticker {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
  }
  
  .company-name {
    font-size: 0.9rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 40px;
  }
  
  .company-actions {
    justify-content: center;
  }
  
  /* Optimization Results */
  .results-container {
    margin-top: 20px;
  }
  
  .loading-message {
    text-align: center;
    padding: 40px;
  }
  
  .loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .error-message {
    text-align: center;
    padding: 40px;
    color: #D32F2F;
    background-color: rgba(211, 47, 47, 0.1);
    border-radius: var(--border-radius);
  }
  
  .chart-container {
    width: 100%;
    height: 500px;
    margin: 30px 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
  }
  
  /* Portfolio Metrics */
  .metrics-container {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .metric-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    flex: 1;
    min-width: 200px;
    text-align: center;
  }
  
  .metric-title {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
  }
  
  .metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
  }
  
  /* Portfolio Weights Table */
  .weights-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin: 30px 0;
    overflow-x: auto;
  }
  
  .weights-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .weights-table th,
  .weights-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
  }
  
  .weights-table th {
    background-color: #f8f8f8;
    font-weight: 600;
    color: #333;
  }
  
  .weights-table tr:last-child td {
    border-bottom: none;
  }
  
  .weights-table tr:hover {
    background-color: #f8f8f8;
  }
  
  /* Buttons */
  .primary-button,
  .secondary-button,
  .action-button {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
  }
  
  .primary-button {
    background-color: var(--color-primary);
    color: white;
  }
  
  .primary-button:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
  }
  
  .primary-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
  }
  
  .secondary-button {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid #ccc;
  }
  
  .secondary-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
  }
  
  .action-button {
    background-color: #f5f5f5;
    color: var(--color-text);
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  .action-button:hover {
    background-color: #e0e0e0;
  }

  /* Enhanced Table Styling */
.metrics-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.metrics-table thead {
  background-color: #1a1a1a;
  color: #ffffff;
}

.metrics-table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.metrics-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #dddddd;
}

.metrics-table tbody tr {
  transition: all 0.3s ease;
}

.metrics-table tbody tr:nth-child(even) {
  background-color: #f8f8f8;
}

.metrics-table tbody tr:hover {
  background-color: #f1f1f1;
}

/* Style for metric names in the first column */
.metrics-table tbody tr td:first-child {
  font-weight: 600;
  color: #333;
}

/* Style for positive and negative values */
.metrics-table .positive-value {
  color: #4CAF50;
}

.metrics-table .negative-value {
  color: #F44336;
}

/* Highlight the benchmark comparison section */
.benchmark-comparison-header {
  background-color: #f0f0f0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #333;
}

/* Responsive table */
@media screen and (max-width: 768px) {
  .metrics-table {
    font-size: 12px;
  }
  
  .metrics-table th,
  .metrics-table td {
    padding: 8px 10px;
  }
}
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
    .sector-grid,
    .companies-grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 15px;
    }
    
    .step-actions {
      flex-direction: column;
      gap: 15px;
      align-items: stretch;
    }
    
    .selection-controls {
      display: flex;
      justify-content: space-between;
      width: 100%;
    }
    
    .metrics-container {
      flex-direction: column;
    }
    
    .chart-container {
      height: 400px;
    }
  }
  
  @media (max-width: 480px) {
    .sector-grid,
    .companies-grid {
      grid-template-columns: 1fr;
    }
    
    .metric-card {
      min-width: 100%;
    }
    
    .chart-container {
      height: 300px;
      padding: 10px;
    }
    
    .weights-container {
      padding: 10px;
    }
    
    .weights-table th,
    .weights-table td {
      padding: 8px;
      font-size: 0.9rem;
    }
  }

