:root {
  --primary: #0d47a1;
  --primary-dark: #1565c0;
  --accent: #6d28d9;
  --accent-dark: #8b5cf6;
  --background: #ffffff;
  --background-dark: #0f172a;
  --surface: #f3f4f6ce;
  --surface-dark: #1e293b;
  --text: #111827;
  --text-dark: #f8fafc;
  --text-secondary: #374151;
  --text-secondary-dark: #e2e8f0;
  --border: #d1d5db;
  --border-dark: #475569;
}

/* Base styles */
body {
  background: var(--background);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-bs-theme="dark"] body {
  background: var(--background-dark);
  color: var(--text-dark);
}

[data-bs-theme="dark"] .text-secondary {
  color: var(--text-secondary-dark) !important;
}

[data-bs-theme="dark"] .btn-primary {
  background: var(--primary-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
  border-width: 2px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .btn-outline-primary {
  border: 2px solid var(--border-dark);
  color: var(--primary-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background: var(--primary-dark);
  color: var(--text-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Navigation */
.navbar {
  background: var(--surface);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  color: var(--primary) !important;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.nav-link {
  color: var(--text-secondary) !important;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary) !important;
  background: rgba(37, 99, 235, 0.1);
}

/* Cards and containers */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  border-width: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--border-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--border-dark);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Dark theme */
[data-bs-theme="dark"] {
  --primary: var(--primary-dark);
  --accent: var(--accent-dark);
  --background: var(--background-dark);
  --surface: var(--surface-dark);
  --text: var(--text-dark);
  --text-secondary: var(--text-secondary-dark);
  --border: var(--border-dark);
}

/* Forms */
.form-control {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Alerts */
.alert {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

/* Gradients */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border-color: var(--border);
}

.table th {
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 2px solid rgba(0,0,0,0.12);
}

.table td {
  border-bottom: 1px solid rgba(0,0,0,0.12);
  padding: 1rem;
}

.badge {
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 16px;
}

.footer {
  background: var(--surface);
  padding: 1rem 0;
  color: var(--text-secondary);
  box-shadow: var(--elevation-z4);
}

.mat-elevation-z2 {
  box-shadow: var(--elevation-z4);
}

.mat-elevation-z8 {
  box-shadow: var(--elevation-z8);
}

.loading-spinner {
  border: 3px solid rgba(0,0,0,0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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

.mat-card {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}

.mat-toolbar {
  background: var(--primary);
  color: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.mat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--elevation-z4);
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mat-fab:hover {
  background: var(--accent-light);
}

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

.mat-form-field {
  width: 100%;
  margin-bottom: 1rem;
}

.mat-form-field label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: block;
}

.mat-chip {
  padding: 0.5rem 1rem;
  border-radius: 16px;
  background: rgba(0,0,0,0.08);
  margin: 0.25rem;
  display: inline-block;
  font-size: 0.875rem;
}

.mat-dialog {
  background: var(--surface);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: var(--elevation-z8);
}

.mat-dialog-title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.mat-progress-bar {
  height: 4px;
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
  overflow: hidden;
}

.mat-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  animation: progress 2s infinite linear;
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Hero Section Styles */
.hero-section {
  background: linear-gradient(135deg, var(--surface) 0%, #1a1f24 100%);
  color: var(--text-dark);
  padding: 4rem 0;
}

/* Fact Cards */
.fact-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  padding: 1.5rem;
}

.fact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.fact-card i {
  color: var(--primary);
}

.fact-card h5 {
  color: var(--accent-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.fact-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.badge.bg-gradient {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

/* Benefit Cards */
.benefit-card {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.benefit-card h5 {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.benefit-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.benefit-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Dashboard Styles */
.welcome-banner {
  background: linear-gradient(135deg, var(--surface) 0%, #1a1f24 100%);
  color: var(--text-dark);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.welcome-icon {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Statistics Dashboard Styles */
.statistics-container {
    padding: 2rem 0;
    background: var(--background);
    min-height: 100vh;
}

.header-section {
    background: var(--surface);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  padding: 1.5rem;
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.12);
}

.stat-card i {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 600;
}

[data-bs-theme="dark"] .header-section {
    border-color: rgba(255,255,255,0.1);
}

/* Slider customization */
.noUi-connect {
    background: var(--primary);
}

.noUi-handle {
    background: var(--primary);
    border: 2px solid var(--surface);
    box-shadow: none;
    cursor: pointer;
}

.noUi-tooltip {
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--text);
    font-size: 0.8rem;
}

/* Modern components */
.analysis-container {
  padding: 2rem;
  background: var(--surface);
  min-height: 100vh;
}

.header-card {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  border-radius: 12px;
  padding: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.content-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.card-body {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.02);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.02);
}

.input-card {
  border: 2px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.input-card:hover {
  border-color: var(--primary);
}

.modern-input {
  background: var(--background);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 300px;
  resize: vertical;
}

.modern-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

[data-bs-theme="dark"] .modern-input {
  background: var(--surface-dark);
  border-color: rgba(255,255,255,0.1);
}

.result-section {
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.result-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag-item {
  background: var(--primary);
  color: var(--text-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.tag-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timing-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.status-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-text {
  font-size: 0.9rem;
  font-weight: 500;
}

[data-bs-theme="dark"] .loading-overlay {
  background: rgba(0,0,0,0.75);
}

.section-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.section-list li:last-child {
  border-bottom: none;
}

/* Exercise Table Styles */
.exercise-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-exercises {
  margin-bottom: 0;
}

.table-exercises thead tr {
  background: #f8f9fa;
}

.table-exercises thead th {
  border-bottom: 2px solid #e9ecef;
  color: #495057;
  font-weight: 600;
  padding: 1rem;
}

.table-exercises tbody tr {
  transition: all 0.2s ease;
}

.table-exercises tbody tr:hover {
  background-color: #f8f9fa;
}

.table-exercises td {
  padding: 1rem;
  vertical-align: middle;
}

.scenario-cell, .goals-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags-container .badge {
  margin-right: 0.25rem;
  padding: 0.5em 0.75em;
  font-weight: 500;
}

.exercise-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 110, 253, 0.1);
  border-radius: 8px;
}

.btn-group .btn {
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
}

.btn-group .btn:hover {
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
}

.incident-slider {
    position: relative;
    overflow: hidden;
    min-height: 150px;
}

.incident-slide {
    display: none;
    transition: opacity 0.5px ease-in-out;
}

.incident-slide.active {
    display: block;
}

.slider-controls {
    padding: 10px;
}

.slider-controls button {
    margin: 0 5px;
}

.incident-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.75rem;
  margin: 1rem;
  height: calc(100% - 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
