/* Elvtr AI Agent Orchestration Courses - Dashboard Styles */

:root {
  /* Course Colors */
  --course-1: #6366f1; /* Game Dev - Purple/Blue */
  --course-2: #f97316; /* Orchestration - Orange/Red */
  --course-3: #10b981; /* Marketplace - Green/Teal */

  /* Semantic Colors */
  --neutral: #475569;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;

  /* Theme Colors */
  --bg-light: #ffffff;
  --bg-dark: #1e293b;
  --text-light: #1e293b;
  --text-dark: #f1f5f9;
  --card-light: #f8fafc;
  --card-dark: #334155;
  --border-light: #e2e8f0;
  --border-dark: #475569;

  /* Spacing System (8px base) */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 1.5rem;    /* 24px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 3rem;      /* 48px */
  --spacing-2xl: 4rem;     /* 64px */
  --spacing-3xl: 6rem;     /* 96px */
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-primary: var(--bg-dark);
  --text-primary: var(--text-dark);
  --card-bg: var(--card-dark);
  --border-color: var(--border-dark);
}

[data-theme="light"] {
  --bg-primary: var(--bg-light);
  --text-primary: var(--text-light);
  --card-bg: var(--card-light);
  --border-color: var(--border-light);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 1rem;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Typography Scale */
h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.4;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
  max-width: 65ch;
}

/* Text blocks with proper spacing */
.text-content p {
  margin-bottom: 1.5rem;
}

.text-content p:last-child {
  margin-bottom: 0;
}

/* Navigation */
.navbar {
  background: var(--card-bg);
  border-bottom: 2px solid var(--border-color);
  padding: var(--spacing-sm) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--course-1), var(--course-2), var(--course-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--course-1);
}

/* Dark Mode Toggle */
.theme-toggle {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1001;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--course-1), var(--course-2), var(--course-3));
  color: white;
  padding: var(--spacing-3xl) 0 var(--spacing-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%23ffffff" opacity="0.1"/></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
  z-index: 0;
}

.hero .container,
.hero .container > *,
.hero .btn {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  position: relative;
  animation: fadeInUp 0.8s ease-out;
  line-height: 1.2;
}

.hero p {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.95;
  position: relative;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Metric Cards */
.metric-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  text-align: center;
  transition: all 0.3s ease;
  min-height: fit-content;
  position: relative;
  overflow: hidden;
}

/* Full height only in grid containers */
.row > [class*="col"] > .metric-card {
  height: 100%;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--course-1), var(--course-2), var(--course-3));
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.metric-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.metric-value {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  color: var(--course-1);
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 1rem;
  color: var(--neutral);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.metric-description {
  font-size: 0.9rem;
  color: var(--neutral);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* Course Badge */
.course-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0.25rem;
}

.course-badge-1 {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.course-badge-2 {
  background: rgba(249, 115, 22, 0.2);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.course-badge-3 {
  background: rgba(16, 185, 129, 0.2);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Chart Container */
.chart-container {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  transition: all 0.3s ease;
}

.chart-container:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chart-title {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  line-height: 1.4;
}

.chart-description {
  color: var(--neutral);
  margin-bottom: var(--spacing-md);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 65ch;
}

/* DataTables Styling */
.dataTable {
  width: 100% !important;
  border-collapse: collapse;
}

.dataTable thead {
  background: linear-gradient(135deg, var(--course-1), var(--course-2));
  color: white;
}

.dataTable thead th {
  padding: var(--spacing-sm);
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  line-height: 1.5;
}

.dataTable tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.dataTable tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.dataTable tbody td {
  padding: var(--spacing-sm);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--course-1), var(--course-2));
  border: none;
  padding: 0.75rem var(--spacing-lg);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  color: white;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  padding: 0.75rem var(--spacing-lg);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  border-color: var(--course-1);
  color: var(--course-1);
  transform: translateY(-2px);
}

/* Timeline */
.timeline {
  position: relative;
  padding: var(--spacing-lg) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--course-1), var(--course-2), var(--course-3));
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--spacing-xl);
  width: 50%;
  padding: 0 var(--spacing-lg);
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--course-1);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 8px var(--course-1);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -10px;
}

.timeline-content {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-md);
  position: relative;
  transition: all 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Risk Matrix */
.risk-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.risk-cell {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.risk-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.risk-low {
  border-color: var(--success);
}

.risk-medium {
  border-color: var(--warning);
}

.risk-high {
  border-color: var(--danger);
}

.risk-score {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  line-height: 1.3;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

/* AOS Animations - DISABLED to prevent white screens */
/* Content should always be visible, animations are optional enhancement */
[data-aos] {
  opacity: 1 !important; /* Always visible - no hiding */
  transition-property: opacity, transform;
}

[data-aos].aos-animate {
  opacity: 1;
}

/* Ensure content is visible if JS fails */
.no-js [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* Print Styles */
@media print {
  .navbar,
  .theme-toggle,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .chart-container,
  .metric-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .hero {
    background: none;
    color: black;
    border-bottom: 4px solid #6366f1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: var(--spacing-2xl) 0 var(--spacing-xl);
  }

  .hero h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: clamp(1rem, 3vw, 1.125rem);
  }

  .metric-value {
    font-size: 2rem;
  }

  .metric-card {
    padding: var(--spacing-md);
  }

  .section-header {
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    padding: var(--spacing-lg) 0 0;
  }

  .section-header h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .chart-container {
    padding: var(--spacing-md);
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    text-align: left !important;
    padding-left: 3rem !important;
  }

  .timeline-dot {
    left: 10px !important;
  }

  .risk-matrix {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--course-1), var(--course-2), var(--course-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-course-1 {
  background: var(--course-1);
}

.bg-course-2 {
  background: var(--course-2);
}

.bg-course-3 {
  background: var(--course-3);
}

.text-course-1 {
  color: var(--course-1);
  font-size: 1.2rem;
}

.text-course-2 {
  color: var(--course-2);
  font-size: 1.2rem;
}

.text-course-3 {
  color: var(--course-3);
  font-size: 1.2rem;
}

/* Dropdown styling */
.dropdown-menu {
  max-width: 280px;
}

.dropdown-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--neutral);
  padding: 0.5rem 1rem 0.25rem;
}

/* Loading Spinner */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--course-1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: var(--spacing-lg) auto;
}

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

/* Tooltip */
.tooltip-custom {
  position: relative;
  display: inline-block;
}

.tooltip-custom .tooltip-text {
  visibility: hidden;
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  text-align: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  line-height: 1.5;
}

.tooltip-custom:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin: var(--spacing-2xl) 0 var(--spacing-xl);
  padding: var(--spacing-2xl) 0 0;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.section-header p {
  color: var(--neutral);
  font-size: 1.1rem;
  max-width: 65ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* Footer */
.footer {
  background: var(--card-bg);
  border-top: 2px solid var(--border-color);
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-2xl);
  text-align: center;
  color: var(--neutral);
}

.footer a {
  color: var(--course-1);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--course-2);
}
/* ===================================
   LOADING STATES & SKELETON SCREENS
   =================================== */

/* Skeleton Base Styles */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 20%,
    var(--border-color) 40%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Shimmer Animation Effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Skeleton Card Component */
.skeleton-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--course-1), var(--course-2), var(--course-3));
}

/* Skeleton Text Lines */
.skeleton-text {
  height: 16px;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-text.long {
  width: 100%;
}

/* Skeleton Title */
.skeleton-title {
  height: 32px;
  width: 70%;
  margin-bottom: 20px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* Skeleton Circle (for icons/avatars) */
.skeleton-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Skeleton Chart Container */
.skeleton-chart {
  width: 100%;
  height: 300px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral);
  font-size: 0.875rem;
}

/* Skeleton Metric Card */
.skeleton-metric {
  text-align: center;
}

.skeleton-metric .skeleton-circle {
  width: 80px;
  height: 80px;
}

.skeleton-metric .skeleton-value {
  height: 48px;
  width: 120px;
  margin: 16px auto 12px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-metric .skeleton-label {
  height: 20px;
  width: 160px;
  margin: 0 auto 8px;
  background: linear-gradient(
    90deg,
    var(--border-color) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* Loading State Wrapper */
.loading-wrapper {
  position: relative;
  min-height: 200px;
}

.loading-wrapper.is-loading .content {
  opacity: 0;
  visibility: hidden;
}

.loading-wrapper.is-loading .skeleton-overlay {
  opacity: 1;
  visibility: visible;
}

.loading-wrapper.loaded .skeleton-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-wrapper.loaded .content {
  opacity: 1;
  visibility: visible;
  animation: fadeIn 0.4s ease-out;
}

/* Lazy Load State */
.lazy-load {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.lazy-load.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Chart Loading State */
.chart-loading {
  position: relative;
  min-height: 300px;
}

.chart-loading::after {
  content: 'Loading chart...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--neutral);
  font-size: 0.875rem;
}

/* Performance: Reduce Motion for Users with Preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .skeleton {
    animation: none;
    background: var(--border-color);
  }
}

/* Content Visibility Optimization */
.below-fold {
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}

/* ===================================
   PROGRESSIVE ENHANCEMENT
   =================================== */

/* No-JS Fallback - Core content always visible */
.no-js .lazy-load {
  opacity: 1;
  transform: translateY(0);
}

.no-js .skeleton {
  display: none;
}

/* Critical Content - Ensure visible before JS loads */
.critical-content {
  opacity: 1;
  visibility: visible;
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* GPU Acceleration for Animations */
.metric-card,
.chart-container,
.timeline-content,
.risk-cell {
  will-change: transform;
  transform: translateZ(0);
}

/* Remove will-change after animation completes */
.metric-card:hover,
.chart-container:hover,
.timeline-content:hover,
.risk-cell:hover {
  will-change: auto;
}

/* Image Loading Optimization */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Defer Heavy Animations */
@media (max-width: 768px) {
  .metric-icon {
    animation: none;
  }

  .hero::before {
    display: none;
  }
}

/* =================================
   Interactive Elements CSS
   ================================= */

/* Toast Notification Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Toast Styles */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="dark"] .toast {
  background: var(--card-dark);
  color: var(--text-dark);
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast-exit {
  opacity: 0;
  transform: translateX(400px);
}

/* Toast Variants */
.toast-success {
  border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-info {
  border-left: 4px solid var(--course-1);
}

.toast-info .toast-icon {
  color: var(--course-1);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

/* Toast Components */
.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  color: var(--neutral);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

[data-theme="dark"] .toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Button Loading States */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.btn-loading .btn-text {
  vertical-align: middle;
}

/* Disabled Button Styles */
button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 12px;
  width: 60%;
}

.skeleton-card {
  height: 200px;
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Form Validation Styles */
.form-control.is-valid {
  border-color: var(--success);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2322c55e' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control.is-valid:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.25);
}

.form-control.is-invalid {
  border-color: var(--danger);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control.is-invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.valid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--success);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--danger);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Copy Code Button */
.code-wrapper {
  position: relative;
  margin: 1.5rem 0;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.7;
}

.copy-code-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}

.copy-code-btn.copied {
  background: var(--success);
  opacity: 1;
}

.code-wrapper pre {
  margin: 0;
  border-radius: 8px;
  padding: 16px;
  background: #1e293b;
  color: #e2e8f0;
  overflow-x: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.code-wrapper code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Inline code (not in pre) */
code:not(pre code) {
  background: rgba(99, 102, 241, 0.1);
  color: var(--course-1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9em;
}

[data-theme="dark"] code:not(pre code) {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* Confetti Particles */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
}

/* Smooth transitions for interactive elements */
button,
.btn,
input,
select,
textarea {
  transition: all 0.2s ease;
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* Focus visible for accessibility */
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
}

/* Enhanced hover effects */
.interactive-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Pulse animation for important elements */
.pulse {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .toast-container {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .copy-code-btn {
    padding: 4px 8px;
    font-size: 12px;
  }

  .code-wrapper pre {
    padding: 12px;
    font-size: 12px;
  }
}

/* Enhanced Export Button Group */
.export-btn-group {
  margin-top: 1rem;
}

.export-btn-group .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.export-btn-group .dropdown-menu {
  min-width: 180px;
}

.export-btn-group .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.export-btn-group .dropdown-item:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(249, 115, 22, 0.1));
  padding-left: 1.5rem;
}

.export-btn-group .dropdown-item i {
  width: 20px;
  margin-right: 0.5rem;
  text-align: center;
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.8s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

.btn-text {
  vertical-align: middle;
}

/* Toast Notification Container */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

/* Toast Notification */
.toast {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  border-left: 4px solid;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast-exit {
  opacity: 0;
  transform: translateX(400px);
}

.toast-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--neutral);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Toast Types */
.toast-success {
  border-left-color: var(--success);
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info {
  border-left-color: var(--course-1);
}

.toast-info .toast-icon {
  color: var(--course-1);
}

/* Dark Mode Toast Adjustments */
[data-theme="dark"] .toast {
  background: var(--card-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Accessibility Toggle Button */
.accessibility-toggle {
  position: fixed;
  top: 140px;
  right: 20px;
  z-index: 1001;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.accessibility-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.accessibility-toggle i {
  font-size: 1.2rem;
  color: var(--text-primary);
}

/* Responsive Toast Notifications */
@media (max-width: 768px) {
  .toast-container {
    right: 10px;
    left: 10px;
    top: 80px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }
}

/* ===========================
   NAVIGATION ENHANCEMENTS
   =========================== */

/* Skip to Main Content Link (Accessibility) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--course-1);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--course-2);
  outline-offset: 2px;
}

/* Enhanced Focus States for Navigation */
.navbar-brand:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 4px;
  border-radius: 4px;
}

.nav-link {
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.nav-link:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

.nav-link:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
  color: var(--course-1);
  background-color: rgba(99, 102, 241, 0.1);
}

/* Dropdown Menu Focus States */
.dropdown-item:focus {
  outline: 2px solid var(--course-1);
  outline-offset: -2px;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--course-1);
}

.dropdown-toggle:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Mobile Hamburger Menu Improvements */
.navbar-toggler {
  border: 2px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: var(--course-1);
}

.navbar-toggler:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  border-color: var(--course-1);
}

.navbar-toggler-icon {
  width: 1.5em;
  height: 1.5em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(99, 102, 241, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Menu - Enhanced */
@media (max-width: 991px) {
  .navbar-collapse {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .nav-item {
    margin: 0.25rem 0;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    display: block;
  }

  .dropdown-menu {
    border: none;
    box-shadow: none;
    background: transparent;
    padding-left: 1rem;
  }

  .dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 0.25rem 0;
  }
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

.breadcrumb {
  margin-bottom: 0;
  background: transparent;
  padding: 0;
}

.breadcrumb-item {
  color: var(--neutral);
}

.breadcrumb-item a {
  color: var(--neutral);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.breadcrumb-item a:hover {
  color: var(--course-1);
  background-color: rgba(99, 102, 241, 0.1);
}

.breadcrumb-item a:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
  color: var(--course-1);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--neutral);
  padding: 0 0.5rem;
  font-size: 1.2em;
}

.breadcrumb-item i {
  margin-right: 0.25rem;
  font-size: 0.9em;
}

/* General Focus States for Interactive Elements */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
}

/* Remove default focus outline for mouse users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for keyboard users */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--course-1);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}
