/**
 * Advanced Features Styling
 * Comparison Tools, Trend Analysis, Export Hub, Validation, Heatmap, Gantt, Import Wizard
 */

/* ============================================
   COMPARISON TOOLS
   ============================================ */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: white;
}

.comparison-table thead {
  background: var(--gray-100);
}

.comparison-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 2px solid var(--gray-300);
}

.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.comparison-table tbody tr:hover {
  background: var(--gray-50);
}

.comparison-table .positive {
  color: #10b981;
  font-weight: 600;
}

.comparison-table .negative {
  color: #ef4444;
  font-weight: 600;
}

/* ============================================
   TREND ANALYSIS
   ============================================ */

.trend-analysis-container {
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.trend-analysis-container h4 {
  color: var(--gray-900);
  margin-bottom: 15px;
  font-size: 16px;
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.trend-stat {
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  color: var(--gray-900);
  text-align: center;
}

.trend-stat.improvement {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
  font-weight: 600;
}

.trend-table {
  width: 100%;
  border-collapse: collapse;
}

.trend-table thead {
  background: var(--gray-100);
}

.trend-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 2px solid var(--gray-300);
}

.trend-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.trend-table .positive {
  color: #10b981;
  font-weight: 600;
}

.trend-table .negative {
  color: #ef4444;
  font-weight: 600;
}

/* ============================================
   DATA EXPORT HUB
   ============================================ */

.export-hub-container {
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.export-hub-container h3,
.export-hub-container h4 {
  color: var(--gray-900);
  margin-bottom: 15px;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.export-option {
  padding: 15px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.export-option:hover {
  background: var(--gray-100);
  border-color: var(--primary-green);
}

.export-option h4 {
  color: var(--gray-900);
  margin-bottom: 10px;
}

.export-formats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-formats .btn-secondary {
  padding: 6px 12px;
  font-size: 12px;
}

.scheduled-exports {
  margin-top: 20px;
}

.schedules-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.schedules-table thead {
  background: var(--gray-100);
}

.schedules-table th,
.schedules-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.schedules-table th {
  font-weight: 600;
  border-bottom: 2px solid var(--gray-300);
}

.empty-state {
  text-align: center;
  color: var(--gray-500);
  padding: 20px;
}

/* ============================================
   DATA VALIDATION
   ============================================ */

.validation-error {
  display: none;
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
}

.validation-summary {
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.validation-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  color: var(--gray-900);
  border-left: 4px solid var(--gray-300);
}

.validation-item.success {
  background: rgba(16, 185, 129, 0.05);
  border-left-color: #10b981;
  color: #10b981;
}

.validation-item.warning {
  background: rgba(245, 158, 11, 0.05);
  border-left-color: #f59e0b;
  color: #d97706;
}

.validation-item.error {
  background: rgba(239, 68, 68, 0.05);
  border-left-color: #ef4444;
  color: #dc2626;
}

/* ============================================
   HEATMAP CALENDAR
   ============================================ */

.heatmap-clean {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.heatmap-clean-header h3 {
  color: var(--gray-900);
  margin: 0 0 6px 0;
}

.heatmap-clean-header p {
  color: var(--gray-600);
  margin: 0 0 16px 0;
  font-size: 14px;
}

.heatmap-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.heatmap-kpi {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--gray-50);
}

.kpi-label {
  display: block;
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.kpi-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.heatmap-list {
  display: grid;
  gap: 8px;
}

.heatmap-row {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 48px 1fr max-content;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.heatmap-row:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.heatmap-row.selected {
  border-color: var(--primary-green);
  background: rgba(0, 212, 170, 0.06);
}

.heatmap-month-label {
  font-weight: 600;
  color: var(--gray-900);
}

.heatmap-track {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}

.heatmap-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary-blue);
}

.heatmap-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
}

.heatmap-detail {
  margin-top: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  padding: 12px;
}

.heatmap-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.heatmap-detail-header h4 {
  margin: 0;
  color: var(--gray-900);
  font-size: 14px;
}

.heatmap-weekly-list {
  display: grid;
  gap: 8px;
}

.heatmap-week-row {
  display: grid;
  grid-template-columns: 56px 1fr max-content;
  gap: 10px;
  align-items: center;
}

.week-label {
  font-size: 12px;
  color: var(--gray-700);
}

.week-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}

.week-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary-green);
}

.week-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
}

/* ============================================
   GANTT CHART
   ============================================ */

.gantt-container {
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.gantt-container h3 {
  color: var(--gray-900);
  margin-bottom: 15px;
}

.gantt-chart {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
}

.gantt-header {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-300);
  font-weight: 600;
  color: var(--gray-900);
}

.gantt-dates {
  border-left: 1px solid var(--gray-300);
}

.gantt-row {
  border-bottom: 1px solid var(--gray-200);
}

.gantt-row:hover {
  background: var(--gray-50);
}

.gantt-label {
  padding: 0 10px;
  color: var(--gray-900);
  font-weight: 500;
}

.gantt-bar-container {
  position: relative;
  border-left: 1px solid var(--gray-200);
}

.gantt-bar {
  background: var(--primary-green);
  color: white;
  font-weight: 600;
  transition: all 0.2s;
}

.gantt-bar:hover {
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

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

/* ============================================
   IMPORT/EXPORT WIZARD
   ============================================ */

.import-wizard-container {
  background: white;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-700);
  font-weight: 600;
}

.wizard-step.active .step-number {
  background: var(--primary-green);
  color: white;
}

.wizard-step.completed .step-number {
  background: #10b981;
  color: white;
}

.step-title {
  text-align: center;
  color: var(--gray-700);
  font-size: 12px;
}

.wizard-step.active .step-title {
  color: var(--primary-green);
  font-weight: 600;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-300);
  margin: 0 10px;
}

.wizard-step:last-child .step-connector {
  display: none;
}

.wizard-content {
  min-height: 300px;
}

.wizard-content h3 {
  color: var(--gray-900);
  margin-bottom: 15px;
}

.wizard-content p {
  color: var(--gray-700);
  margin-bottom: 15px;
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.wizard-option {
  padding: 20px;
  background: var(--gray-50);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--gray-900);
  font-weight: 500;
}

.wizard-option:hover {
  border-color: var(--primary-green);
  background: var(--gray-100);
  transform: translateY(-2px);
}

.wizard-option span:first-child {
  font-size: 32px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.preview-table thead {
  background: var(--gray-100);
}

.preview-table th,
.preview-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.preview-table th {
  font-weight: 600;
  border-bottom: 2px solid var(--gray-300);
}

.import-complete {
  text-align: center;
  padding: 30px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.import-complete p {
  color: var(--gray-900);
  margin: 10px 0;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.wizard-actions .btn-secondary,
.wizard-actions .btn-primary,
.wizard-actions .btn-success {
  padding: 10px 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .comparison-table,
  .trend-table,
  .schedules-table,
  .preview-table {
    font-size: 12px;
  }

  .export-options,
  .wizard-options {
    grid-template-columns: 1fr;
  }

  .heatmap-kpis {
    grid-template-columns: 1fr;
  }

  .heatmap-row,
  .heatmap-week-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .wizard-steps {
    flex-direction: column;
    gap: 15px;
  }

  .step-connector {
    width: 2px;
    height: 20px;
    margin: 0;
  }

  .trend-stats {
    grid-template-columns: 1fr;
  }
}
