/* 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 devstem.org. All rights reserved." ;
  --tooltip-icon: "🔎";
}

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

body {
  color: var(--text-main);
  background-color: var(--bg-light);
}
/* 3. BUTTON INTERACTIONS */
button {
  cursor: pointer;
  transition: 
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    filter var(--transition-speed) ease;
    
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-standard);
  filter: brightness(1.08);
}

button:active {
  transform: translateY(1px);
  box-shadow: none;
  filter: brightness(0.95);
}

button:focus-visible {
  outline: 3px solid var(--primary-yellow);
  outline-offset: 2px;
}
/* 3. HERO SECTION */
.hero,
.hero-small {
  background-image: url("assets/atom.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;
}

.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.9;
}

.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(300px, 1fr));
  gap: 15px;
}

.course-buttons button, .submit {
  background-color: red;
}

.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;
} */

.course-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
}

/* Base styles for all buttons */
/* .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;
} */
.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), box-shadow var(--transition-speed);
  box-shadow:  0 2px 8px rgba(0, 0, 0, 0.18);
}

.course-buttons button:hover,
.lesson.navigation button:hover {
  background-color: #444;
  box-shadow:  0 2px 8px rgba(0, 0, 0, 0.12);
}
/* green overrides for submit  buttons */
.course-buttons button.submit,
.course-buttons button#nextBtn {
  background-color: green;
}

.course-buttons button.submit:hover,
.course-buttons button#nextBtn:hover {
  background-color: darkgreen;
}

/* Red overrides posttest buttons */
.course-buttons button.test,
.course-buttons button#nextBtn {
  background-color: red;
}

.course-buttons button.test:hover,
.course-buttons button#nextBtn:hover {
  background-color: darkred;
}

.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: blanchedalmond;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 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: #888888 !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;
  border-radius: var(--radius-md) !important ;
}
th,
td {
  border: 1px solid lightgreen;
  padding: 10px;
  border-radius: var(--radius-md);
}

ol,
li {
  margin-left: 10px;
}

.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);
}

/* 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;
}

.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}
.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  width: 80%;
  border-radius: 8px;
}
.tab-container {
  display:block;
  gap: 10px;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px;
  cursor: pointer;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
}
.question-block {
  background: #f9f9f9;
  padding: 15px;
  margin: 10px 0;
  border-left: 5px solid #007bff;
}
.grading-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* styles for popup on dashboard */
#closeModal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

#closeModal:hover {
  color: black;
  text-decoration: none;
}

#modalStudentName {
  font-family: Arial, sans-serif;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

/* Container for each question */
.q-block {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  margin-bottom: 10px;
  padding: 15px;
  border-radius: 5px;
}

/* The area where the grade is saved */
.score-summary {
  background-color: #f8f9fa;
  border-top: 2px solid #007bff;
  padding: 20px;
  margin-top: 10px;
  text-align: right;
}

/* The header for PRETEST/POSTTEST */
.test-section h3 {
  font-size: 1.2rem;
  color: #2c3e50;
  margin-bottom: 15px;
  text-decoration: underline;
}
textarea {
  width: 100%;
}

/* input {
  width: 100%;
} */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
}
.password-input {
  width: auto;
}

/* form css */

.lab-review-container {
  padding: 10px;
  background-color: #f9f9f9;
}

.lab-section-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 25px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.act-title {
  color: #2c3e50;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 5px;
  margin-top: 0;
}

.lab-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.lab-data-table th,
.lab-data-table td {
  border: 1px solid #ccc !important; /* Forces borders to appear */
  padding: 10px;
  text-align: left;
  font-size: 0.9em;
}

.lab-data-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.key_answer {
  color: red;
}

/* css for pdf print */
@media print {
  /* 1. Hide the background and everything else */
  body * {
    visibility: hidden;
  }

  /* 2. Reset the position of the body and html to allow scrolling/multi-page */
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
  }

  /* 3. Target the modal and its content */
  .modal,
  .modal-content,
  .modal-content * {
    visibility: visible;
  }

  .modal {
    position: absolute !important;
    left: 0;
    top: 0;
    width: 100%;
    height: auto !important;
    overflow: visible !important;
    display: block !important; 
    background: white !important;
  }

  .modal-content {
    border: none !important;
    box-shadow: none !important;
    width: 100%;
    height: auto !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
  }

  /* 4. REMOVE UI ELEMENTS (Buttons, Inputs, etc.) */
  /* Use display: none so they don't take up space */
  button,
  .no-print,
  #saveNoteBtn,
  #printReportBtn,
  #closeModal,
  .lesson-tabs,
  input[type="number"],
  .print-actions {
    display: none !important;
  }

  /* 5. FORMAT NOTES FOR PRINT */
  #notesHistory {
    max-height: none !important; /* Force the box to expand to show ALL notes */
    overflow: visible !important; /* Remove scrollbars */
    border: 1px solid #eee !important;
    visibility: visible !important;
    display: block !important;
  }

  .teacher-notes-section {
    page-break-inside: avoid; /* Prevents splitting a note across two pages */
    border: 1px solid #ccc !important;
    background-color: white !important;
    padding: 15px !important;
    margin-top: 20px !important;
    visibility: visible !important;
  }
}

