
:root {
  --color-excellent: #10b981;
  --color-good: #3b82f6;
  --color-average: #f59e0b;
  --color-below: #ef4444;
  --color-primary: #667eea;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-border-light: #e5e7eb;
  --color-bg-light: #f9fafb;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #d1d5db;
    --color-bg-light: #1f2937;
    --color-border-light: #374151;
  }
}

/* ============================================================================
   BENCHMARK SECTION STYLING
   ============================================================================ */

#benchmark-section {
  padding: 24px;
  background: var(--color-bg-light);
  border-radius: 12px;
  margin: 16px 0;
  border: 1px solid var(--color-border-light);
}

#benchmark-section h3 {
  color: var(--color-text-primary);
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.benchmark-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

#industry-selector {
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: white;
  color: var(--color-text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

#industry-selector:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

#industry-selector:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.loader-benchmark {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================================
   BENCHMARK RESULTS GRID
   ============================================================================ */

#benchmark-results {
  min-height: 100px;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.benchmark-card {
  background: white;
  border: 2px solid var(--color-border-light);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

/* Status-specific styling */
.benchmark-card.status-excellent {
  border-left: 5px solid var(--color-excellent);
}

.benchmark-card.status-good {
  border-left: 5px solid var(--color-good);
}

.benchmark-card.status-average {
  border-left: 5px solid var(--color-average);
}

.benchmark-card.status-below {
  border-left: 5px solid var(--color-below);
}

.benchmark-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
  gap: 12px;
}

.benchmark-header h4 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.excellent {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-excellent);
}

.status-badge.good {
  background: rgba(59, 130, 246, 0.2);
  color: var(--color-good);
}

.status-badge.average {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-average);
}

.status-badge.below {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-below);
}

.benchmark-content {
  background: rgba(0, 0, 0, 0.02);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-row .label {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.metric-row .value {
  color: var(--color-text-primary);
  font-weight: 600;
  font-family: "Monaco", "Courier New", monospace;
}

.benchmark-message {
  padding: 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
  border-left: 3px solid var(--color-primary);
}

/* ============================================================================
   REPORT SCHEDULE BUTTON
   ============================================================================ */

#schedule-report-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#schedule-report-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#schedule-report-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

#schedule-report-btn::before {
  content: "📧";
  font-size: 16px;
}

/* ============================================================================
   MODAL STYLING
   ============================================================================ */

#report-schedule-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in;
}

#report-schedule-modal.active {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  color: var(--color-text-primary);
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--color-text-primary);
  transform: rotate(90deg);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: var(--color-text-primary);
  transition: var(--transition);
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

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

.btn-secondary {
  background: var(--color-bg-light);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.loader-schedule {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   CONFIRMATION MESSAGE
   ============================================================================ */

#confirmation-message {
  display: none;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  animation: slideIn 0.3s ease-out;
  white-space: pre-line;
  line-height: 1.6;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert {
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-left: 4px solid var(--color-success);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border-left: 4px solid var(--color-danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border-left: 4px solid var(--color-warning);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-left: 4px solid #3b82f6;
}

.text-muted {
  color: var(--color-text-secondary);
  font-size: 14px;
}

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

@media (max-width: 768px) {
  .benchmark-grid {
    grid-template-columns: 1fr;
  }

  .benchmark-controls {
    flex-direction: column;
  }

  #industry-selector {
    width: 100%;
  }

  #schedule-report-btn {
    width: 100%;
    justify-content: center;
  }

  .modal-content {
    padding: 24px;
  }

  .benchmark-header {
    flex-direction: column;
  }

  .status-badge {
    align-self: flex-start;
  }
}

/* ============================================================================
   ACCESSIBILITY & UTILITY CLASSES
   ============================================================================ */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
#industry-selector:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  #schedule-report-btn,
  #report-schedule-modal,
  .benchmark-controls {
    display: none;
  }

  .benchmark-grid {
    page-break-inside: avoid;
  }

  .benchmark-card {
    page-break-inside: avoid;
  }
}
