/* ========================================
   ULTRA-MODERN COURSE STYLE V2
   ======================================== */

:root {
  /* Dark theme colors */
  --bg-dark: #0a0e1a;
  --bg-card: #151b2e;
  --bg-card-hover: #1a2138;
  
  /* Accent colors - will be overridden by category classes */
  --accent: #667eea;
  --accent-light: #9f7aea;
  --accent-bright: #f687b3;
  
  /* Text colors */
  --text-primary: #f7fafc;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  
  /* UI elements */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(159, 122, 234, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.7;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ========================================
   NAVIGATION & BUTTONS
   ======================================== */

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.back-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.step-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

/* ========================================
   HEADER & TITLES
   ======================================== */

.header {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 10px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, 
    var(--accent) 0%, 
    var(--accent-light) 50%, 
    var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease;
}

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

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  animation: fadeInUp 0.6s ease 0.1s backwards;
}

h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-light);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

h2::before {
  content: '';
  width: 4px;
  height: 1.8rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  border-radius: 10px;
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.8rem;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.chapter, .toc {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1.5rem 0;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chapter::before, .toc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent-bright));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chapter:hover::before, .toc:hover::before {
  opacity: 1;
}

.chapter:hover, .toc:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.chapter p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0.8rem 0;
}

.chapter ul, .chapter ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.chapter li {
  color: var(--text-secondary);
  margin: 0.6rem 0;
  line-height: 1.7;
}

.chapter strong {
  color: var(--accent-light);
  font-weight: 700;
}

.chapter code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--accent-bright);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ========================================
   CARDS & GRIDS
   ======================================== */

.cards-grid, .steps-grid, .paliers-grid, .parcours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.level-card, .step-card, .palier-card, .parcours-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.level-card::before, .step-card::before, .palier-card::before, .parcours-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.level-card:hover::before, .step-card:hover::before, 
.palier-card:hover::before, .parcours-card:hover::before {
  transform: scaleX(1);
}

.level-card:hover, .step-card:hover, .palier-card:hover, .parcours-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.level-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 20px var(--accent));
}

.level-name, .step-card h3, .palier-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0.8rem 0;
  color: var(--text-primary);
}

.level-description, .step-card .subtitle, .palier-card .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.level-topics {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  font-weight: 900;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* ========================================
   SPECIAL ELEMENTS
   ======================================== */

.callout {
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0.1), 
    rgba(159, 122, 234, 0.1));
  border-left: 4px solid var(--accent);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.callout-title {
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip {
  background: linear-gradient(135deg, 
    rgba(72, 187, 120, 0.1), 
    rgba(56, 178, 172, 0.1));
  border-left: 4px solid #48bb78;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.warning {
  background: linear-gradient(135deg, 
    rgba(237, 137, 54, 0.1), 
    rgba(246, 173, 85, 0.1));
  border-left: 4px solid #ed8936;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

.example-box {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.example-title {
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* ========================================
   INTERACTIVE ELEMENTS
   ======================================== */

details {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: all 0.3s ease;
}

details:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

details[open] {
  border-color: var(--accent);
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-light);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '▶';
  transition: transform 0.3s ease;
  display: inline-block;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* ========================================
   FORMS
   ======================================== */

input, textarea, select {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  outline: none;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

button {
  cursor: pointer;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

/* ========================================
   CATEGORY ACCENT COLORS
   ======================================== */

.accent-science {
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-bright: #a5f3fc;
}

.accent-cyber {
  --accent: #a78bfa;
  --accent-light: #c4b5fd;
  --accent-bright: #ddd6fe;
}

.accent-python {
  --accent: #fbbf24;
  --accent-light: #fcd34d;
  --accent-bright: #fde68a;
}

.accent-shell {
  --accent: #34d399;
  --accent-light: #6ee7b7;
  --accent-bright: #a7f3d0;
}

.accent-cpp {
  --accent: #f87171;
  --accent-light: #fca5a5;
  --accent-bright: #fecaca;
}

.accent-finance {
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-bright: #6ee7b7;
}

.accent-languages {
  --accent: #ec4899;
  --accent-light: #f472b6;
  --accent-bright: #f9a8d4;
}

.accent-humanities {
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-bright: #fcd34d;
}

.accent-platform {
  --accent: #667eea;
  --accent-light: #9f7aea;
  --accent-bright: #f687b3;
}

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

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .chapter, .toc {
    padding: 1.5rem;
  }
  
  .cards-grid, .steps-grid, .paliers-grid, .parcours-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ========================================
   ANIMATIONS & EFFECTS
   ======================================== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0) 100%);
  background-size: 1000px 100%;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}
