:root {
  --main-green: #00d800;
  --main-green-light: #00d800;
  --main-green-dark: #00b86f;
  --main-orange: #ff6b35;
  --main-orange-light: #ff8c5a;
  --main-orange-dark: #e5501a;
  --main-purple: #8b5cf6;
  --main-purple-light: #a78bfa;
  --main-purple-dark: #7c3aed;
  --main-teal: #06b6d4;
  --main-teal-light: #22d3ee;
  --main-teal-dark: #0891b2;
  --main-gray: #f8fafc;
  --dark-gray: #64748b;
  --light-gray: #e2e8f0;
  --gradient-primary: linear-gradient(135deg, var(--main-green), var(--main-teal));
  --gradient-secondary: linear-gradient(135deg, var(--main-purple), var(--main-orange));
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
  color: #1e293b;
  line-height: 1.6;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Enhanced Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--light-gray) !important;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

/* Enhanced Cards */
.card {
  border: none;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}


.card:hover {
  box-shadow: var(--shadow-xl);
}

.card-body {
  padding: 2rem;
}

.card-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Enhanced Buttons */
.btn {
  border-radius: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-success {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-primary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  box-shadow: var(--shadow-md);
}

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

.btn-light {
  background: white;
  color: #1e293b;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--light-gray);
}

.btn-light:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

/* Enhanced Form Controls */
.form-control {
  border: 2px solid var(--light-gray);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: white;
}

.form-control:focus {
  border-color: var(--main-green);
  box-shadow: 0 0 0 3px rgba(0, 216, 0, 0.1);
  transform: translateY(-1px);
}

.form-control-lg {
  padding: 1.25rem 1.75rem;
  font-size: 1.2rem;
}

/* Enhanced Badges */
.badge {
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  margin: 0.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--gradient-primary);
  border: none;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* Enhanced Tree Visualization */
#treeGraph {
  width: 100%;
  height: 600px;
  background: white;
  border-radius: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

#treeGraph::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 216, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* Enhanced Modal */
.modal-content {
  border: none;
  border-radius: 2rem;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
}

.modal-header {
  border-bottom: 1px solid var(--light-gray);
  padding: 2rem 2rem 1rem;
}

.modal-body {
  padding: 1rem 2rem 2rem;
}

.modal-title {
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

/* Enhanced Alerts */
.alert {
  border: none;
  border-radius: 1rem;
  padding: 1.5rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.alert-success {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border-left: 4px solid var(--main-green);
}

.alert-danger {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

/* Unit Color Improvements */
.unit-green {
  background: var(--gradient-primary) !important;
}

.unit-purple {
  background: linear-gradient(135deg, var(--main-purple), var(--main-purple-light)) !important;
}

.unit-teal {
  background: linear-gradient(135deg, var(--main-teal), var(--main-teal-light)) !important;
}

.unit-orange {
  background: linear-gradient(135deg, var(--main-orange), var(--main-orange-light)) !important;
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1.5rem;
  }
  
  #treeGraph {
    height: 400px;
  }
  
  /* Quiz section responsive improvements */
  .quiz-section-multiple-choices {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 15px;
  }
  
  .quiz-section-multiple-choice-button {
    padding: 15px;
    font-size: 14px;
    min-height: 50px;
  }
  
  .quiz-section-question {
    font-size: 18px;
    line-height: 1.3;
  }
  
  .skill-tree-section-bubble {
    font-size: 18px;
    padding: 20px 15px;
    max-width: 300px;
    min-width: 160px;
  }
  
  .skill-tree-section {
    width: 90%;
  }
}

/* Enhanced Footer */
footer {
  background: white;
  border-top: 1px solid var(--light-gray);
  color: var(--dark-gray);
  font-weight: 500;
  margin-top: auto;
}

/* Hover Effects for Interactive Elements */
.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* Global removal of blue highlights and tap highlights */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-focus-ring-color: transparent;
}

/* Remove blue highlights from all interactive elements */
button, input, select, textarea, a, div[onclick], span[onclick], [tabindex] {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Remove active state blue highlights */
button:active, input:active, select:active, textarea:active, a:active,
div[onclick]:active, span[onclick]:active, [tabindex]:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Ensure no blue highlights on mobile touch */
@media (hover: none) and (pointer: coarse) {
  * {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--main-green);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--main-green-dark);
}

/* General styles */
.centered-container{
  margin: 0 auto;
}
.flex-center-all{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.rounded-corners{
  border-radius: 6px;
  padding: 10px 2px;
}
.pill-shape{
  border-radius: 40px;
  padding: 5px 20px;
}
.button{
  cursor: pointer;
}
.lug-input{
  border: none;
  background-color: rgb(238, 237, 237);
  padding: 10px 2px;
  text-align: center;
}
.lug-input::placeholder{
  padding-left: 10px;
}

/* Login page */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 500;
  color: #757575;
  background-color: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
}
.google-signin-btn img {
  width: 18px;
  height: 18px;
}
.google-signin-btn:hover {
  background-color: #f7f7f7;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}
.google-signin-btn:active {
  background-color: #f1f1f1;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}
.google-signin-btn:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0px 0px 3px 2px rgba(66, 133, 244, 0.5);
}

/* course creation page */
#course-creation-headline{
  font-weight: 620;
  font-size: 28px;
  margin-top: 10px;
  letter-spacing: -1px;
  line-height: 1.2;
}

/* navigation */
.navigation-top-bar{
  display: flex;
  margin: 0 auto;
  justify-content: flex-start;
  align-items: center;
  background-color: white;
  height: 80px;
  height: 100%;
  padding-left: 10%;
  padding-right: 10%;
  position: sticky;
  top: 0;
  z-index: 1002;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 56px;
}
.navigation-top-bar p{
  font-size: 26px;
  font-weight: 500;
  margin: 0;
  margin-left: 10px;
}

/* Course overview css */
#course-title{
  line-height: 20px;
  font-size: 20px;
  color: #5d5d5d;
}
.course-overview-timeline-section{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center; 
  margin-bottom: 40px;
}
.course-overview-timeline-header{
  display: flex;
  margin: 0 auto;
  justify-content: space-between;
  align-items: center; 
  width: 100%;
  background-color: rgb(0, 216, 0);
  height: 100%;
  color: white;
  padding: 9px 0px 12px 0px;
}
.course-overview-timeline-header-titleblock{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0px;
  margin-left: 10%;
  line-height: 39px;
  margin-right: 5%;
}
.course-overview-timeline-header-titleblock-unit-number{
  font-size: 30px; 
  font-weight: 700; 
  margin: 0;
  margin-bottom: -6px;

}
.course-overview-timeline-header-titleblock-unit-title{
  font-size: 24px; 
  font-weight: 600;
  margin: 0;
  line-height: 26px;
}
.course-overview-timeline-content{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center;
  position: relative;
}
.course-overview-button-and-popup-container{
    position: relative;
    display: inline-block;
    text-align: center;
}
.course-overview-round-button{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  width: 60px;
  height: 53px;
  margin-top: 17px;
  transition: transform 0.3s ease;
  cursor: pointer;
}
.completed-lesson-button{
  background-color:#3dff3d;
  box-shadow: 0px 10px 0px rgb(70, 223, 0);
}
.unlocked-lesson-button{
  background-color:#fecf3d;
  box-shadow: 0px 10px 0px #de6100;
}
.locked-lesson-button{
  background-color:#c5c5c5;
  box-shadow: 0px 10px 0px #aaaaaa;
}
.course-overview-round-button:hover{
  /* transform: translateY(3px); */
}
.button-full-left-offset{
  margin-left: -120px;
}
.button-slight-left-offset{
  margin-left: -80px;
}
.button-slight-right-offset{
  margin-right: -80px;
}
.button-full-right-offset{
  margin-right: -120px;
}
.course-overview-button-popup {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) translateY(-8px);
  background-color: #60a5fa;
  color: white;
  font-size: 14px;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  display: none;
  max-width: 220px;
  min-width: 80px;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  width: max-content;
}
.course-overview-button-popup.show {
  display: block;
}
.course-overview-popup-title{

}
.course-overview-popup-start-button{
  margin-top: 8px;
  background-color: white;
  color: #3b82f6;
  font-weight: bold;
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}
.course-overview-popup-start-button:hover {
  background-color: #f3f4f6;
}

/* lesson page */
#lesson-title{
  margin: 0;
  line-height: 20px;
  font-size: 20px;
  color: #5d5d5d;
}
.title-and-progress-bar-container{
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: flex-start;
}
.progress-bar-container {
  width: 100%;
  height: 12px;
  background-color: #d1d5db;
  border-radius: 50px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background-color: #fbbf24;
  border-radius: 50px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 0%; /* Controlls progress bar fill */
}
.progress-fill.gradient {
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #fcd34d);
}
.lesson-view-teaching-section{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center; 
  margin-bottom: 40px;
  width: 80%;
  margin-top: 18px;
  padding-bottom: 60px;
}
.teaching-section-text-bubble{
  /* background-color: rgb(230 230 230); */
  border-radius: 10px;
  /* padding: 20px; */
  /* white-space: pre-line; */
  line-height: 1.6em;
  font-size: 16px;
  width: 100%;
  max-width: 700px;
}
.teaching-section-text-bubble p{
  margin: 0;
}
.quiz-section{
  max-width: 700px;
  width: 100%;
  margin-top: 24px;
}
.quiz-section-question{
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 20px;
  line-height: 1.3em;
}
.quiz-section-multiple-choices{
  display: grid;
  grid-template-columns: 1fr; /* 1 column - single column layout */
  gap: 14px; /* space between buttons */
}
.quiz-section-multiple-choice-button{
  background-color: #ffffff;
  border: 2px solid #e5e7eb;
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0px 3px 0px rgb(234, 232, 232);
  transition: all 0.2s ease;
  /* Handle long word overflow - only break very long words, not small words */
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  /* Ensure text doesn't overflow the container */
  overflow: hidden;
  /* Text styling for better readability */
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  color: #374151;
  /* Ensure consistent height */
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Remove all blue highlights and outlines */
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-focus-ring-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.quiz-section-multiple-choice-button:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0px -2px 0px rgb(234, 232, 232);
}
.quiz-section-multiple-choice-button:focus {
  outline: none;
  border-color: #e5e7eb; /* Keep original border color */
}

.quiz-section-multiple-choice-button:focus-visible {
  outline: none;
  border-color: #e5e7eb; /* Keep original border color */
}

.quiz-section-multiple-choice-button:active {
  transform: translateY(2px);
  box-shadow: 0px 4px 0px rgb(234, 232, 232);
  outline: none;
  border-color: #e5e7eb; /* Keep original border color */
}

/* Remove margin from p tags inside quiz multiple choice buttons */
.quiz-section-multiple-choice-button p {
  margin: 0;
}

/* XP Animation for correct answers */
.xp-popup {
  font-family: system-ui, -apple-system, sans-serif;
}

@keyframes xpDramaticUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0px) scale(0.5);
  }
  25% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.3);
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-50px) scale(0.8);
    color: #15803d;
    text-shadow: 0 0 5px rgba(21, 128, 61, 0.2);
  }
}


/* All courses page - Legacy styles for other pages */
.all-courses-section-legacy{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center; 
  margin-top: 7px;
  margin-bottom: 30px;
  width: 100%;
  gap: 12px;
}
#courses-container{
  width: 100%;
  max-width: 500px;
}
.all-courses-section-option-button{
  background-color: rgb(0, 216, 0);
  color: white;
  border-radius: 10px;
  padding: 20px 10px;
  line-height: 17px;
  font-size: 16px;
  width: 100%;
  max-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
}
.create-new-course-button{
  background-color: rgb(252, 35, 53);
}
.skill-tree-access-button{
  background-color: rgb(104 0 255);
}
.my-account-access-button{
  background-color: #a3a3a3;
}
.divider-line{
  height: 1px;
  background-color: #ccc;
  width: 100%;
  max-width: 300px;
  margin: 1rem 0; 
}

/* skill-tree page */
.skill-tree-section{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center; 
  margin-top: 30px;
  margin-bottom: 30px;
  width: 80%;
}
.skill-tree-section-bubble{
  background-color: #4bd122;
  color: white;
  border-radius: 10px;
  padding: 22px 18px;
  line-height: 1.3;
  font-size: 20px;
  width: 100%;
  max-width: 340px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 3px 5px rgba(0,0,0,0.2);
  text-align: center;
  min-width: 180px;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
}
.skill-tree-section-row{
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 15px 0;
  gap: 20px;
  position: relative;
}
.skill-tree-section-row:not(:first-child)::before {
  content: '';
  position: absolute;
  top: -30px;
  height: 30px;
  border-left: 2px dashed #90ee90;
  left: 50%;
}
.skill-tree-section-connector{
  width: 2px;
  background: #90ee90;
  position: absolute;
  top: -30px;
  height: 30px;
  left: 50.5%;
  transform: translateX(-50%);
  z-index: -1;
}
.skill-tree-section-connector::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 60%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid #90ee90; /* Down arrow */
}



/* My Account page */
.my-account-section{
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  justify-content: center;
  align-items: center; 
  margin-top: 30px;
  margin-bottom: 30px;
  width: 80%;
  gap: 12px;
}
#orders-container{
  width: 100%;
}
.my-account-order-button{
  display: block;
  width: 100%;
  background-color: #dcfff2;
  border-radius: 6px;
  padding: 21px;
  text-decoration: none;
  color: black;
}

/* prerequisites page */
.prerequisites-container > * {
  max-width: 450px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.prerequisites-container input[type="text"] {
  max-width: 450px;
  width: 100%;
}
.prerequisites-container label {
  max-width: 450px;
  width: 100%;
  display: block;
}

/* === All Courses Page Styles === */
.all-courses-footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* min-height: 56px; */
  height: 50px;
  /* padding: 10px 25px; */
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

body.all-courses-page {
  min-height: 100vh;
  /* margin: 0;
  padding: 20px;*/
  padding-bottom: 76px;
  /* overflow: auto;  */
}

/* Remove old .all-courses-footer if present */
.all-courses-footer { display: none !important; }

.all-courses-container {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  /* box-shadow: 0 20px 40px rgba(0,0,0,0.1); */
  overflow: hidden;
  animation: all-courses-slideUp 0.6s ease-out;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.all-courses-header {
  /* background: linear-gradient(135deg, var(--main-green), var(--main-teal)); */
  /* background-color: rgb(0, 216, 0); */
  text-align: center;
  /* color: white; */
  position: relative;
  overflow: hidden;
  padding: 16px 10px;
  padding-bottom: 4px;
  padding-top: 220px; /* Reserve space for streak + mino so layout doesn't shift */
  flex-shrink: 0;
  flex-grow: 0;
}
.all-courses-header h1 {
  font-size: 28px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  margin: 0;
}
.all-courses-header p {
  font-size: 19px;
  position: relative;
  z-index: 1;
  margin: 0;
}
.all-courses-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 200px);
  padding: 25px;
  padding-bottom: 0;
  padding-top: 6px;
}

#all-courses-courses-container {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgb(0, 216, 0) #ffffff;
  overflow-y: auto;
}

#all-courses-courses-container::-webkit-scrollbar {
  width: 6px;
}

#all-courses-courses-container::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 3px;
}

#all-courses-courses-container::-webkit-scrollbar-thumb {
  background: var(--main-green);
  border-radius: 3px;
}

#all-courses-courses-container::-webkit-scrollbar-thumb:hover {
  background: var(--main-green-dark);
}

.all-courses-primary-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-shrink: 0;
}
.all-courses-btn-primary {
  flex: 1;
  padding: 4px 0px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: white;
}
.all-courses-btn-create {
  /* background: linear-gradient(135deg, var(--main-orange), var(--main-orange-light)); */
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.15);
  background-color: rgb(0, 216, 0);
  font-size: 18px;
}
.all-courses-btn-create:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.2);
}
.all-courses-btn-skill-tree {
  background: linear-gradient(135deg, var(--main-purple), var(--main-green));
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}
.all-courses-btn-skill-tree:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}
.all-courses-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.all-courses-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.all-courses-course-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.all-courses-course-card:hover {
  border-color: rgb(0, 216, 0);
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.10);
}
.all-courses-course-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.all-courses-course-icon {
  width: 40px;
  height: 40px;
  background: white;
  /* border: 2px solid var(--main-green); */
  border: 2px solid rgb(0, 216, 0);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.all-courses-course-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: #2d3748;
}
.all-courses-course-subtitle {
  font-size: 12px;
  color: #718096;
  margin-bottom: 12px;
}

/* Course delete button styling */
.course-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid var(--light-gray);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: #dc2626; /* red-600 */
  margin-left: 5px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease, border-color 0.2s ease, color 0.2s ease;
}

.course-delete-button:hover {
  background: #fee2e2; /* rose-100 */
  border-color: #fecaca; /* rose-200 */
  color: #b91c1c; /* red-700 */
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.course-delete-button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.course-delete-button svg {
  pointer-events: none;
  fill: currentColor;
}
.all-courses-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.all-courses-progress-fill {
  height: 100%;
  /* background: linear-gradient(90deg, var(--main-green), var(--main-teal)); */
  background: rgb(0, 216, 0);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.all-courses-progress-text {
  font-size: 14px;
  color: rgb(0, 216, 0);
  font-weight: 500;
}

/* Yellow styling for courses still generating */
.all-courses-course-card.generating {
  border-color: #ff6b35;
}

.all-courses-course-card.generating:hover {
  border-color: #e5501a;
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
}

.all-courses-course-card.generating .all-courses-course-icon {
  background: white;
  border-color: #ff6b35;
  width: 40px;
  height: 40px;
}

.all-courses-course-card.generating .all-courses-progress-fill {
  background: linear-gradient(90deg, #ff6b35, #e5501a);
}

.all-courses-course-card.generating .all-courses-progress-text {
  color: #e5501a;
}

.all-courses-generation-progress {
  font-size: 12px;
  color: #e5501a;
  font-weight: 500;
  margin-bottom: 4px;
}

.all-courses-footer {
  border-top: 1px solid #e2e8f0;
  padding: 10px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  flex-shrink: 0;
  flex-grow: 0;
  background: white;
  z-index: 100;
}
.all-courses-footer-link {
  color: #2d3748;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: none;
  border: none;
  cursor: pointer;
}
.all-courses-footer-link:hover {
  background: #f7fafc;
  color: #2d3748;
}
@media (max-width: 500px) {
  /* body.all-courses-page { padding: 10px; } */
  .all-courses-container { 
    max-width: 98vw; 
    margin: 0 1vw;
  }
  .all-courses-header { 
    padding: 18px 8px; 
    padding-bottom: 4px;
  }
  .all-courses-footer { 
    padding: 15px 17px; 
    min-height: 60px;
    background-color: white;
  }
  .all-courses-footer-link {
    font-size: 16px;
    padding: 10px 16px;
  }
}

.course-overview-round-button,
.course-overview-popup-start-button,
.navigation-top-bar a {
  -webkit-tap-highlight-color: transparent;
}

/* Mino animation styles */
.mino-anim {
  position: relative;
  width: 136px;
  height: 101px;
  display: inline-block;
  margin-left: -9px;
  margin-bottom: 2px;
  margin-top: 20px;
}
.mino-anim-courses-page {
  margin-top: 14px;
}

.animated-mino-arm {
  position: absolute;
  left: 111px;
  top: 26px;
  height: 19px;
  z-index: 1;
  transform-origin: left center;
  animation: mino-arm-wave 0.25s infinite alternate cubic-bezier(0.7, 0, 0.3, 1);
}

.mino-body {
  position: absolute;
  left: 10px; 
  top: 0;
  height: 100px; 
  z-index: 2; 
}

@keyframes mino-arm-wave {
  from { transform: rotate(-10deg); }
  to   { transform: rotate(30deg); }
}

#streak-fire-container{
  position: absolute; /* Anchor to header instead of using margins */
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: 72px;   /* Reserve constant space so loading doesn't shift layout */
  height: 72px;  /* Matches the largest (ice) icon size */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Normalize SVG size regardless of inline attributes */
#streak-fire-container svg{
  width: 72px !important;
  height: 72px !important;
}

/* Fade-in animation for streak SVGs when they are injected */
#streak-fire, #streak-ice{
  opacity: 0;
  animation: streak-fade-in 260ms ease-in forwards;
}

@keyframes streak-fade-in{
  to { opacity: 1; }
}

#streak-count{
  position: absolute;
  font-weight: bold;
  font-size: 28px;
  left: 50%;
  top: 90%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-shadow:
    -3px -3px 0 #000,
     0px -3px 0 #000,
     3px -3px 0 #000,
    -3px  0px 0 #000,
     3px  0px 0 #000,
    -3px  3px 0 #000,
     0px  3px 0 #000,
     3px  3px 0 #000,
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
    -2px  0px 0 #000,
     2px  0px 0 #000,
     0px  2px 0 #000,
     0px -2px 0 #000;
}

#streak-evolutive-bg-container{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 0;
}
#streak-evolutive-bg{
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

/* Feedback Card Styles */
.feedback-card {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 11;
}

.feedback-card.incorrect {
  background: #fef2f2;
  border: 2px solid #fecaca;
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.feedback-icon {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feedback-icon.correct {
  background: #22c55e;
}

.feedback-icon.incorrect {
  background: #ef4444;
}

.feedback-icon.correct::before {
  content: "✓";
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.feedback-icon.incorrect::before {
  content: "✗";
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.feedback-title {
  font-weight: bold;
  font-size: 18px;
  color: #15803d;
}

.feedback-title.correct {
  color: #15803d;
}

.feedback-title.incorrect {
  color: #dc2626;
}

.feedback-emoji {
  font-size: 20px;
  margin-left: auto;
}

.feedback-explanation {
  color: #16a34a;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.feedback-card.incorrect .feedback-explanation {
  color: #dc2626;
}

.feedback-button-container {
  display: flex;
  justify-content: flex-end;
}

.feedback-continue-btn {
  background-color: #ffffff;
  border: 2px solid #e5e7eb;
  color: #374151;
  border-radius: 16px;
  padding: 20px 24px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 60px;
  justify-content: center;
}

.feedback-continue-btn:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
  transform: translateY(-2px);
}

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

.feedback-continue-btn svg {
  transition: transform 0.2s ease;
}

.feedback-continue-btn:hover svg {
  transform: translateX(2px);
}

/* Progress Bar for Course Creation Flow */
.course-progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  margin: 20px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0px;
}

/* Mobile optimization for course creation layout */
@media (max-width: 768px) {
  .course-progress-bar {
    padding: 15px 0;
    margin: 10px 0;
  }
  
  .mino-anim {
    margin-top: 10px;
  }
  .mino-anim-courses-page {
    margin-top: 14px;
  }
}

/* Ensure mino anim is anchored within header and doesn't shift */
.all-courses-header .mino-anim{
  position: absolute;
  top: 103px; /* Below streak fire */
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 1;
}

/* Better responsive breakpoints for streak evolution */
@media (max-width: 500px){
  .all-courses-header{
    padding-top: 180px; padding-bottom: 4px;
  }
  #streak-evolutive-bg-container{ 
    height: 180px;
    overflow: hidden;
  }
  #streak-evolutive-bg{
    max-height: 180px;
    object-fit: contain;
  }
  .all-courses-header .mino-anim{ top: 90px; }
}

@media (max-width: 400px){
  .all-courses-header{
    padding-top: 160px;
  }
  #streak-evolutive-bg-container{ 
    height: 160px;
  }
  #streak-evolutive-bg{
    max-height: 160px;
  }
  .all-courses-header .mino-anim{ top: 80px; }
}

@media (max-width: 350px){
  .all-courses-header{
    padding-top: 140px;
  }
  #streak-evolutive-bg-container{ 
    height: 140px;
  }
  #streak-evolutive-bg{
    max-height: 140px;
  }
  .all-courses-header .mino-anim{ top: 70px; }
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.progress-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--light-gray);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 16px;
  color: var(--dark-gray);
}

.progress-dot.completed {
  background: #79c471;
  border-color: #88d880;
  color: white;
}

.progress-dot.completed::after {
  content: '✓';
  font-size: 18px;
  font-weight: bold;
}

.progress-dot.active {
  background: #5dc667;
  border-color: #6adb75;
  color: white;
  box-shadow: 0 0 0 6px rgba(0, 216, 0, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 6px rgba(0, 216, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(0, 216, 0, 0.1);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(0, 216, 0, 0.2);
  }
}

.progress-label {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark-gray);
  text-align: center;
  max-width: 120px;
  line-height: 1.3;
}

.progress-step.completed .progress-label {
  color: #8ac27a;
  font-weight: 600;
}

.progress-step.active .progress-label {
  color: #5dc667;
  font-weight: 600;
}

/* Fixed connector positioning for proper alignment */
.progress-connector {
  position: absolute;
  top: 20px;
  left: 50%;
  right: -50%;
  height: 3px;
  background: var(--light-gray);
  z-index: 1;
  transition: background-color 0.3s ease;
}

.progress-step:last-child .progress-connector {
  display: none;
}

.progress-step.completed .progress-connector {
  background: #88d880;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .course-progress-bar {
    padding: 15px 10px;
  }
  
  .progress-dot {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  .progress-label {
    font-size: 12px;
    max-width: 100px;
  }
  
  .progress-connector {
    top: 17px;
  }
}

/* Suggested Topics Styles */
.suggested-topics-container {
  margin-top: 20px;
  width: 90%;
  max-width: 500px;
}

.suggested-topics-label {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
  font-weight: 500;
}

       .suggested-topics-grid {
         display: grid;
         grid-template-columns: repeat(2, 1fr);
         gap: 8px;
         margin-top: 8px;
       }

.suggested-topic-btn {
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggested-topic-btn:hover {
  background-color: #f1f5f9;
  border-color: rgb(0, 216, 0);
  color: rgb(0, 216, 0);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Mobile responsive for suggested topics */
@media (max-width: 768px) {
  .suggested-topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .suggested-topic-btn {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .suggested-topics-label {
    font-size: 13px;
  }
}