/* 1. GLOBAL VARIABLES */
:root {
  /* Brand Colors */
  --primary-blue: #306998;
  --primary-yellow: #ffd43b;
  --accent-brown: #8b4513;
  --hero-text: blanchedalmond;

  /* Neutral Palette */
  --bg-light: #f9f9f9;
  --bg-dark: #111;
  --bg-code: #1e1e1e;
  --text-main: #222;
  --text-muted: #777;
  --text-light: #f1f1f1;
  --white: #ffffff;

  /* UI States */
  --success-green: #4caf50;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  --error-red: #9f1239;
  --error-bg: #fff1f2;
  --error-border: #fecdd3;
  --unlocked-blue: #2196f3;

  /* Layout & Shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 15px;
  --shadow-standard: 0 6px 20px rgba(0, 0, 0, 0.15);
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
  --transition-speed: 0.3s;
  --footer-text: "© 2026 www.devSTEM.org";
  --border-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --tooltip-icon: "🔎";
}


/* 2. RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* font-family: Arial, Helvetica, sans-serif; */
  font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
  color: var(--text-main);
  background-color: var(--bg-light);
}

/* 3. HERO SECTION */
.hero,
.hero-small {
  background-image: url('../images/2-2-python-logo-png-clipart.webp');
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero {
  height: 300px;
}
.hero-small {
  height: 40vh;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  object-position: 50% 20%; 
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.25));
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* align-items: center; */ /*keep for centered text*/
  align-items: flex-start; /* move h1 text to the left*/
  text-align: left;
  padding: 20px;
  z-index: 1;
  padding-left: 50px; /* adjust for padding on the left of h1*/
}

.hero h1,
.hero p {
  color: var(--hero-text);
  text-shadow: 2px 2px 4px var(--accent-brown);
  opacity: 0.75;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}
.hero p {
  max-width: 600px;
  font-size: 1.2rem;
}

/* 4. LAYOUT & CONTENT */
.content {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.description,
.lesson {
  margin-bottom: 40px;
}
.lesson h2,
.lesson h4,
.description h2 {
  margin-bottom: 10px;
}
.lesson p,
.description p {
  line-height: 1.6;
  margin-bottom: 15px;
}
.lesson ol,
.lesson ul {
  line-height: 1.6;
  margin-bottom: 15px;
  padding-left: 15px;
}

/* 5. BUTTONS & INTERACTION */
.course-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  
}

.course-buttons button,
.lesson.navigation button {
  padding: 15px;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--primary-blue);
  color: var(--white);
  cursor: pointer;
  transition: background var(--transition-speed);
  
}

.course-buttons button:hover,
.lesson.navigation button:hover {
  background-color: #444;
  
}

.lesson.navigation {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.lesson.navigation button {
  flex: 1;
}

/* 6. LESSON STATES & BORDERS */
.lesson-btn {
  position: relative;
  transition: all var(--transition-speed) ease;
  border-left: 8px solid #ccc;
  
}

.lesson-btn.completed {
  border-left-color: var(--success-text);
  background-color: var(--success-green);
  color: var(--bg-light);
}

.lesson-btn.completed::after {
  content: ' ✔  Complete!';
  /* content: '  👩‍🎓'; */
  color: var(--success-green);
  font-weight:bolder ;
  color: var(--primary-yellow);
}

.lesson-btn.unlocked {
  border-left-color: var(--unlocked-blue);
  font-weight: bold;
}

.lesson_border,
.border {
  border: 1px solid lightblue;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.border {
  /* border-color: lightgreen; */
  border-color: #00b4ff;
  box-shadow: var(--border-shadow);
}

/* 7. IMAGES & VIDEO */
.lesson-image,
.screenshot {
  margin: 30px 0;
  display: flex;
  justify-content: center;
}

.lesson-image img,
.screenshot {
  max-width: 100%;
  width: 800px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-standard);
}


.screenshot {
  width: 500px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-top: 20px;
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 8. CODE BLOCKS */
.code-block,
.code-dark {
  background: var(--bg-code) !important;
  color: #d4d4d4 !important;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: Consolas, monospace;
  margin: 20px 0;
}

.code-light {
  background: #f5f5f5 !important;
  color: #333 !important;
  border-radius: 6px;
  padding: 12px;
}

/* 9. QUIZ STYLING */
#quiz-box {
  background-color: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 30px 0;
  box-shadow: var(--shadow-soft);
  border: 1px solid #f0f0f0;
}

.question-block {
  background: #f8fbff;
  color: #2c3e50;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 25px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.quiz-btn {
  background-color: var(--white);
  border: 1.5px solid #e0e0e0;
  color: #4a4a4a;
  padding: 8px 5px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-btn:hover {
  background-color: #f0f7ff;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(48, 105, 152, 0.15);
}

.quiz-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* 10. FEEDBACK & ANIMATIONS */
.feedback-text {
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  display: none;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

.feedback-text.success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.feedback-text.error {
  background-color: var(--error-bg);
  color: var(--error-red);
  border: 1px solid var(--error-border);
}

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

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* 11. TOOLTIP SYSTEM */
/* 11. TOOLTIP SYSTEM */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-speed);
  z-index: 9999;
  pointer-events: none;

  /* Dimensions */
  width: 280px; /* You can make it wider since it's centered on screen */
  max-width: 90vw;
  box-sizing: border-box;

  /* Styling */
  background-color: var(--primary-blue);
  color: var(--primary-yellow);
  text-align: center;
  border-radius: var(--radius-md);
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

  /* THE FIX: Fixed to the Viewport, not the icon */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tooltip:hover .tooltiptext,
.tooltip:active .tooltiptext,
.tooltip:focus .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.tooltip::before {
  content: var(--tooltip-icon);
  margin-right: 4px;
}

/* --- THE 1030px FIX --- */

@media screen and (max-width: 1100px) {
  .tooltip .tooltiptext {
    /* Instead of forcing center, we let it be wider and use the 
       viewport to keep it from bleeding */
    width: 160px;
    left: 50%;
    /* We add a small 'safety' margin */
    margin-left: 0; 
  }
}



/* 12. TABLES & MISC */
.table-container {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  min-width: 400px;
  border-collapse: collapse;
}
th,td {
  border: 1px solid lightgreen;
  padding: 10px;
  border-radius: 5px;
}

.git {
  border-radius: 10px;
  width: 100px;
  margin: 12px;
}
.ralph {
  width: 95%;
}
.snake {
  width: 300px;
}
footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
footer p::after {
  /* content: var(--footer-text); */
   content: " • Powered by DevSTEM";
  color: var(--text-muted);
}

/* 13. MEDIA QUERIES */
@media only screen and (max-width: 600px) {
  .tooltip .tooltiptext {
    position: fixed;
    left: 50%;
    top: 30%;
    bottom: auto;
    width: 80%;
    max-width: 280px;
  }

  th,
  td {
    padding: 10px;
    font-size: 0.6rem;
  }
}
 details {
        margin-bottom: 1.5rem;
        background-color: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-md);
        overflow: hidden;
        transition: all 0.3s ease;
      }

  summary {
        padding: 20px;
        list-style: none; /* Hides default arrow */
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: bold;
        border: 1px solid rgba(255, 255, 255, 0.1);
      }

      summary::-webkit-details-marker {
        display: none; /* Hides arrow in Safari */
      }

      /* Indicator Arrow */
      summary::after {
        content: '▶';
        font-size: 2rem;
        transition: transform 0.3s;
        color: var( --primary-blue);
      }

      details[open] summary::after {
        transform: rotate(90deg);
      }
  .milestone-label {
        font-size: 0.75rem;
        background: #4caf50;
        color: white;
        padding: 5px 10px;
        border: none;
        border-radius: var(--radius-md);
        margin-left: 10px;
      }
.premium-actions {
  display: flex;
  justify-content: flex-end; /* Aligns buttons to the right */
  gap: 15px;                 /* Adds space between the buttons */
  margin-top: 25px;          /* Separates from the lesson grid */
  padding-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1); /* Subtle divider */
}

/* Style for the Certificate Button within that container */
.cert-btn-manual {
  padding: 10px 20px;
  background-color: #444;    /* Neutral dark for locked state */
  color: #888;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: not-allowed;
  font-weight: bold;
  transition: all 0.3s ease;
}

/* Style for when the JS unlocks the button */
.cert-btn-manual.unlocked {
  background-color: #ffd43b; /* Python Yellow */
  color: #333;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 212, 59, 0.3);
}
.grade{
  
          display: none;
          text-align: center;
          background: #f4f4f4;
          padding: 20px; 
          border-radius: 8px;
          margin-bottom: 20px;
        
}
.percentage{
  font-size: 2rem; font-weight: bold; color: #4caf50;
}
/* style for test.js */
.quiz-option-label {
  display: block;
  margin: 10px 0;
  cursor: pointer;
}

.quiz-question-box {
  margin-bottom: 30px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 20px;
}
