/* ============================================
   Financial Modeling Course - Main Stylesheet
   ============================================
   A modular, reusable CSS framework for 
   interactive lecture content
   ============================================ */

/* ============================================
   CSS Custom Properties (Theme Variables)
   ============================================ */
:root {
  /* Primary Colors - Finance Theme */
  --primary-navy: #1a365d;
  --primary-blue: #2c5282;
  --primary-light: #4299e1;
  --accent-gold: #3a2702;
  --accent-gold-light: #ecc94b;
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f7fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e0;
  --gray-400: #a0aec0;
  --gray-500: #718096;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --gray-900: #171923;
  
  /* Semantic Colors */
  --success: #48bb78;
  --success-light: #9ae6b4;
  --warning: #ed8936;
  --warning-light: #fbd38d;
  --error: #f56565;
  --error-light: #feb2b2;
  --info: #4299e1;
  --info-light: #90cdf4;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Poppins', var(--font-primary);
  --font-mono: 'Fira Code', 'Consolas', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-50);
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-800);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  background-color: var(--gray-800);
  color: var(--gray-100);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: none;
  padding: 0;
}

/* ============================================
   Layout Components
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-6);
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-blue) 100%);
  color: var(--white);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-lg);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-logo-icon {
  width: 40px;
  height: 40px;
  background-color: var(--accent-gold);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-navy);
}

.header-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
}

.header-subtitle {
  font-size: var(--text-sm);
  opacity: 0.8;
  margin: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  color: var(--white);
  opacity: 0.9;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
  padding: var(--space-8) 0;
  min-height: calc(100vh - 200px);
}

/* ============================================
   Section Styles
   ============================================ */
.section {
  margin-bottom: var(--space-12);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 3px solid var(--accent-gold);
}

.section-number {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
  color: var(--primary-navy);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.section-title {
  color: var(--primary-navy);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  color: var(--gray-600);
  font-size: var(--text-lg);
  margin-bottom: 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

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

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.card-subtitle {
  color: var(--gray-600);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

.card-body {
  margin-bottom: var(--space-4);
}

.card-footer {
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-blue) 100%);
  color: var(--white);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
  color: var(--primary-navy);
}

.btn-accent:hover {
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
}

.btn-outline:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ============================================
   Badges & Tags
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--white);
}

.badge-success {
  background-color: var(--success-light);
  color: var(--gray-800);
}

.badge-warning {
  background-color: var(--warning-light);
  color: var(--gray-800);
}

.badge-info {
  background-color: var(--info-light);
  color: var(--gray-800);
}

/* ============================================
   Lists
   ============================================ */
.list {
  list-style: none;
  padding: 0;
}

.list-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

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

.list-bullet {
  width: 8px;
  height: 8px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

.list-number {
  width: 24px;
  height: 24px;
  background-color: var(--primary-navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
}

/* ============================================
   Highlight Box / Callout
   ============================================ */
.highlight-box {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border-left: 4px solid;
  margin-bottom: var(--space-6);
}

.highlight-box-info {
  background-color: var(--info-light);
  border-color: var(--info);
}

.highlight-box-success {
  background-color: var(--success-light);
  border-color: var(--success);
}

.highlight-box-warning {
  background-color: var(--warning-light);
  border-color: var(--warning);
}

.highlight-box-error {
  background-color: var(--error-light);
  border-color: var(--error);
}

.highlight-box-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.highlight-box-content {
  margin-bottom: 0;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container {
  margin-bottom: var(--space-6);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.progress-bar {
  height: 8px;
  background-color: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--gray-800);
  color: var(--gray-300);
  padding: var(--space-8) 0;
  margin-top: var(--space-12);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-text {
  margin: 0;
  font-size: var(--text-sm);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-link {
  color: var(--gray-400);
  font-size: var(--text-sm);
}

.footer-link:hover {
  color: var(--white);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-navy); }
.text-secondary { color: var(--gray-600); }
.text-accent { color: var(--accent-gold); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.bg-primary { background-color: var(--primary-navy); }
.bg-secondary { background-color: var(--gray-100); }
.bg-accent { background-color: var(--accent-gold); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.hidden { display: none; }
.visible { display: block; }

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .header-content {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
  
  .header-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .section {
    margin-bottom: var(--space-8);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-3);
  }
  
  .btn {
    width: 100%;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header,
  .footer,
  .btn,
  .no-print {
    display: none;
  }
  
  .section {
    opacity: 1;
    transform: none;
    animation: none;
    page-break-inside: avoid;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
  
  body {
    background-color: white;
  }
}