/* ==== BASE STYLES ==== */
body {
  margin: 0;
  font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif,
    sans-serif;
  background-color: rgb(12, 12, 12);
}

body {
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.fade-in {
  opacity: 1;
}

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #202020;
  padding: 15px 35px;
  position: sticky;
  top: 0;
  transform: scale(1);
  z-index: 1000;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: #00f; /* blue logo with glow */
  text-shadow: 0 0 5px #00f;
  cursor: pointer;
  letter-spacing: 1px;
}

.logo:hover {
  text-shadow: 0 0 10px #00f, 0 0 15px #00f;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.nav-item a {
  color: white;
  text-decoration: none;
  font-size: 17px;
  position: relative;
  transition: color 0.3s;
}

/* Hover underline animation */
.nav-item a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 3px;
  background-color: #00f;
  transition: width 0.3s;
}

.nav-item a:hover::after {
  width: 100%;
}

/* Active tab */
.nav-item.active a {
  color: #00f;
  text-shadow: 0 0 10px #00f;
}

.nav-item.active a::after {
  width: 100%;
}

.content {
  padding: 50px 30px;
}

/* Full-page white overlay (except navbar) */
#welcome-overlay {
  position: fixed; /* cover the screen */
  top: 50px; /* adjust to navbar height */
  left: 0;
  width: 100%;
  height: calc(100% + 100px); /* fill remaining space below navbar */
  background-color: rgba(19, 19, 19, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Welcome box styling */
#welcome-box {
  max-width: 900px;
  max-height: 600px;
  width: 90%;
  padding: 40px 30px;
  margin-left: 100px;
  left: 100px;
  background-color: #222222; /* Blue box */
  color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(158, 158, 158, 0.3);
  text-align: left;
  position: relative;
  font-family: Arial, sans-serif;
  transform: scale(0.75); /* 80% of original size */
  transform-origin: top left; /* keeps it anchored properly */
}

#welcome-box h3 {
  margin-top: 0;
  font-size: 40px;
  color: rgb(189, 189, 236);
  margin-bottom: -1px;
}

#welcome-box p {
  margin-top: 15px;
  font-size: 22px;
  color: rgb(163, 212, 27);
  margin-bottom: 10px;
}

#welcome-box ul {
  padding-left: 20px;
  margin: 10px 0;
  font-size: 18px;
  padding: 10px;
  line-height: 1.5;
}

#welcome-box button {
  margin-top: 10px;
  background-color: rgb(103, 43, 182);
  color: #ffffff;
  border: none;
  padding: 15px 20px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 17px;
  cursor: pointer;
}

#welcome-box button:hover {
  background-color: #9e57ee;
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: #131313;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: -200px;
  margin-left: 10px;
  gap: 20px;
  width: 1780px;
  height: 630px;
  transform: scale(0.75); /* 80% of original size */
  transform-origin: top left; /* keeps it anchored properly */
}

/* ===== LEFT LESSON BOX ===== */
.lesson-left {
  width: 54%;
  background-color: #1b1b1b;
  color: #d4d4d4;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(239, 241, 243, 0.3);
  height: 560px;
  overflow-y: auto;
  margin-top: 20px;
  margin-left: 20px;
}

.lesson-left h2 {
  color: #00bfff;
  font-size: 24px;
  margin-bottom: 10px;
  text-shadow: 0 0 5px #00bfff;
}

.lesson-content {
  font-size: 24px;
  line-height: 1.6;
}

/* ===== RIGHT CONSOLE BOX ===== */
.console-box {
  width: 700px;
  height: 560px;
  background-color: #252526;
  border-radius: 10px;
  padding: 20px;
  margin-left: 0;
  margin-top: 20px;
  margin-right: 10px;
  margin-bottom: -50px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
}

/* ===== LESSON TITLES ===== */
.lesson-title {
  font-size: 25px;
  color: #8400ff;
  margin-bottom: 5px;
}

.step-title {
  font-size: 20px;
  color: #7fff00;
  margin-bottom: 20px;
  text-align: left;
}

/* ===== CONSOLE AREA ===== */
#console {
  width: 97%;
  height: 30%;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border: none;
  padding: 10px;
  font-family: monospace;
  font-size: 20px;
  outline: none;
  border-radius: 5px;
  resize: none;
}

/* ===== BUTTONS ===== */
.button-row {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  gap: 8px;
}

button {
  padding: 6px 12px;
  height: 130%;
  background-color: #00bfff;
  border: none;
  color: white;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #009acd;
}

/* ===== OUTPUT + PLOT ===== */
.result-area {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  width: 100%;
  height: 25%;
  justify-content: space-between;
}

.output-box {
  flex: 1;
  background-color: #1e1e1e;
  border: 1px solid #333;
  height: 5%;
  padding: 10px;
  min-height: 200px;
  color: #d4d4d4;
  border-radius: 5px;
  overflow-y: auto;
  white-space: pre-wrap;
}

#plotCanvas {
  flex: 1;
  background-color: #3d3d3d;
  border-radius: 5px;
  min-height: 250px;
  max-height: 250px;
  border: 1px solid #333;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    align-items: center;
  }
  .lesson-left,
  .console-box {
    width: 100%;
    margin: 0;
  }
  .result-area {
    flex-direction: column;
  }
}

/* ===== LESSON NOTES ===== */

/* ===== LESSON NOTES ===== */

/* Lesson Title */
#lessonNotes .lesson-title {
  background: linear-gradient(to right, #383838, #1b1b1b);
  color: white;
  font-size: 30px;
  font-weight: bold;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Description Label */
#lessonNotes .lesson-desc-label {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 5px;
}

/* Description Text */
#lessonNotes .lesson-desc-text {
  color: white;
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 10px;
}

/* Description List */
#lessonNotes .lesson-desc-list li {
  color: white;
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 5px;
}

/* Lessons Label */
#lessonNotes .lesson-notes-label {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 10px;
}

/* Subtitles (3.1, 3.2, etc.) */
#lessonNotes .lesson-subtitle {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 8px;
}

/* Sub-subtitles (3.2.1, 3.2.2, etc.) */
#lessonNotes .lesson-subsubtitle {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

/* Subtext (explanations) */
#lessonNotes .lesson-subtext {
  color: white;
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 10px;
}

/* Sublist for bullet points */
#lessonNotes .lesson-sublist li {
  color: white;
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 5px;
}

/* Features Label */
#lessonNotes .lesson-features-label {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

/* Individual Feature Code */
#lessonNotes .lesson-feature {
  display: inline-block;
  color: #ffffff;
  font-family: monospace;
  font-size: 20px;
  padding: 2px 5px;
  border-radius: 3px;
  margin: 3px 5px 3px 0;
}

/* Examples Label */
#lessonNotes .lesson-exa-label {
  color: #ffcc00;
  font-size: 25px;
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 5px;
}

/* Example Text */
#lessonNotes .lesson-exa-text {
  color: white;
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 15px;
}

/* Code rectangle */
.code-box {
  display: inline-block;
  background-color: #5f5f5f;
  color: #ffffff;
  font-family: monospace;
  font-size: 20px;
  padding: 5px 8px;
  border-radius: 8px;
  height: 25px;
  text-align: center;
  margin-right: 10px;
}

/* Feature description */
.feature-desc {
  color: white;
  font-size: 20px;
  text-align: center;
}

/* Flex container for code + description */
.feature-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

/* Answer Box */
#lessonNotes .answer-box {
  display: block;
  background-color: #3a3a3a;
  color: #cacaca;
  font-family: monospace;
  font-size: 20px;
  line-height: 1.5;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-top: 10px;
  margin-bottom: 20px;
}

/* ==== Scrollbar Styling for Lesson Notes ==== */

/* ===== Style Scrollbar Inside Lesson Left Box Only ===== */
.lesson-left {
  overflow-y: auto; /* enable scrolling inside only this area */
  overflow-x: hidden;
  scrollbar-width: thin; /* Firefox support */
  scrollbar-color: #1e90ff #2b2b2b; /* thumb and track color */
}

/* ===== Chrome, Edge, Safari scrollbar styling ===== */
.lesson-left::-webkit-scrollbar {
  width: 10px;
}

.lesson-left::-webkit-scrollbar-track {
  background: #2b2b2b; /* scrollbar track color */
  border-radius: 10px;
}

.lesson-left::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e90ff, #0077ff); /* blue gradient */
  border-radius: 10px;
  box-shadow: 0 0 6px #1e90ff;
}

.lesson-left::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4aa3ff, #0077ff);
  box-shadow: 0 0 10px #4aa3ff;
}

/* ===== Frozen Footer ===== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  text-align: center;
  padding: -15px 0;
  background-color: #101010;
  color: #ccefff;
  font-size: 14px;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
  box-shadow: 0 -2px 10px rgba(0, 255, 255, 0.1);
  animation: footerGlow 3s ease-in-out infinite;
}

/* glowing animation */
@keyframes footerGlow {
  0%,
  100% {
    text-shadow: 0 0 5px #00ffff;
  }
  50% {
    text-shadow: 0 0 15px #00ffff;
  }
}

/* Make sure content does not overlap footer */
body,
.main-content {
  padding-bottom: 60px; /* height of footer */
}

/* ===== Screen Size Warning (Mobile & Tablet Only) ===== */
/* ===== MOBILE / TABLET FULL SCREEN WARNING ===== */
.screen-warning-only {
  display: none;
}

/* Mobile & Tablet */
@media (max-width: 1024px) {
  /* Hide everything */
  body > * {
    display: none !important;
  }

  /* Show only the warning */
  .screen-warning-only {
    display: flex !important;
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0a0a0a, #000);
    justify-content: center;
    align-items: center;
    z-index: 10000;
  }

  .warning-box {
    text-align: center;
    padding: 40px 35px;
    border-radius: 20px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6), 0 0 60px rgba(0, 225, 255, 0.3);
    animation: pulseWarning 2.5s infinite ease-in-out;
  }

  .warning-box span {
    color: #00e1ff;
    text-shadow: 0 0 15px #00ffff;
  }
}

/* Glow Pulse */
@keyframes pulseWarning {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 45px rgba(0, 255, 255, 0.8);
  }
}
