/* Reset and Global Styles */

/* https://colorhunt.co/palette/f1efecd4c9be123458030303 */

 *{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  line-height: 1.6;
  color: #333;
  background-color: white;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 25px;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: black;
  color: #e0e0e0;
}

body.dark-mode .content {
  background-color: black;
}

body.dark-mode .tutorial-content {
  background-color: #38444d;
  color: #ddd;
}

body.dark-mode .top-nav {
  background-color: black;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body.dark-mode .theme-toggle {
  color: #ddd;
}

body.dark-mode .sidebar {
  background-color: #38444d;
  color: #ddd;
}

body.dark-mode .sidebar a {
  color: #ddd;
}

body.dark-mode .sidebar a:hover {
  background-color: #4a5a68;
}

body.dark-mode .tutorial-header h1,
body.dark-mode .tutorial-content h2 {
  color: #ddd;
}

body.dark-mode .right-corner a {
  color: #ddd;
}

body.dark-mode .sidebar-toggle {
  color: #ddd;
}

body.dark-mode .footer {
  border-top: 0.5px solid white; 
  background-color: black;
  color: #ddd;
}

body.dark-mode .landing-page-subject-card {
  color: #ddd;
}

body.dark-mode .landing-page-subject-card {
    color: white; /* Pure white for best contrast */
}

body.dark-mode .landing-page-subject-card .subject-card h2 {
    color: white;
}

body.dark-mode .landing-page-subject-card .subject-card p {
    color: #e0e0e0;
}


body.dark-mode .subject-card {
  background-color: #38444d;
  color: #ddd;
}

body.dark-mode .highlight {
    color: white; /* Green highlight for emphasis */
}

/* Ensure links remain visible in dark mode */
body.dark-mode a {
    color: white; /* Green for links */
}

/* body.dark-mode a:hover {
    color: #6fbf73; /* Lighter green on hover */
/* }  */

body.dark-mode .secondary-nav {
  background-color: #38444d;
    border-top: 0.5px solid white; 
    border-bottom: 0.5px solid white; /* Green highlight for emphasis */
}


/* Top Navigation Bar */
.top-nav {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.top-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo img {
  height: 70px;
  vertical-align: middle;
}

/* Right corner navigation */
.right-corner {
  display: flex;
  align-items: center;
}

.right-corner a {
  margin-left: 20px;
  color: black;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
}

.right-corner a:hover {
  color: #123458;
  transform: translateY(-2px);
}

.contact-link,
.mail-link,
.youtube-link {
  display: flex;
  align-items: center;
}

.contact-link::before {
  content: "\f2bb";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 5px;
}

.mail-link::before {
  content: "\f0e0";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 5px;
}

.youtube-link::before {
  content: "\f167";
  font-family: "Font Awesome 6 Brands";
  font-weight: 900;
  margin-right: 5px;
}

.theme-toggle {
  background: none;
  border: none;
  color: black;
  font-size: 18px;
  cursor: pointer;
  margin-left: 20px;
  transition: color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: rotate(30deg);
}

/* Secondary Navigation Bar */
.secondary-nav {
  display: flex;
  background-color: #222222;
  color: white;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.secondary-nav a {
  padding: 8px 15px;
  color: white;
  font-weight: 500;
  font-size: 18px;
  transition: background-color 0.3s;
}

.secondary-nav a:hover {
  background-color: #000;
}

.secondary-nav a.active {
  background-color: #123458;
}

/* Landing Page Styles */
.landing-page-container {
  display: flex;
  justify-content: center;
  padding: 50px 0;
}

.landing-page-subject-card {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: center;
}

.landing-page-subject-card a {
  width: 100%;
  padding: 30px;
  margin: 0 20px;
  border-radius: 10px;
  background-color: #F1EFEC;
  text-align: center;
  transition: transform 0.3s ease;
}

.landing-page-subject-card .subject-card:hover {
  transform: translateY(-5px);
}

.landing-page-subject-card .subject-card h2 {
  margin-bottom: 15px;
  color: black;
}

.landing-page-subject-card .subject-card p {
  color: #050505;
  line-height: 1.6;
}

.highlight {
  font-size: larger;
  font-weight: bold;
}

/* Main Content Area */
.main-content {
  display: flex;
  flex: 1;
}

/* Sidebar Navigation */
.sidebar {
  width: 250px;
  background-color: #f5f5f5;
  padding: 15px 0;
  overflow-y: auto;
  height: 90%;
  position: sticky;
  top: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  margin-right: 10px;
}

.sidebar h3 {
  padding: 0;
  color: inherit;
  margin: 0 auto;
}

.sidebar-menu {
  display: block;
}

.sidebar a {
  display: block;
  padding: 12px 15px;
  color: #333;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar a:hover {
  background-color: #e7e7e7;
}

.sidebar a.active {
  background-color: #123458;
  color: white;
}

/* Content Area */
.content {
  flex: 1;
  padding: 4px;
  transition: background-color 0.3s ease;
}

.tutorial-header h1 {
  font-size: 35px;
  padding-left: 27px;
  color: #333;
  border-bottom: 1px solid #ddd;
  transition: color 0.3s ease;
}

.navigation-buttons {
  display: flex;
  padding: 5px 15px;
  align-items: center;
  justify-content: space-between;
}

.home-btn,
.next-btn,
.back-btn {
  padding: 10px 20px;
  background-color: #123458;
  color: white;
  border-radius: 5px;
  margin-left: 10px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.home-btn:hover,
.next-btn:hover,
.back-btn:hover {
  background-color: #333;
  transform: translateY(-2px);
}

/* .home-btn:focus,
.next-btn:focus {
  outline: 2px solid #038f5d;
  outline-offset: 2px;
} */

/* Tutorial Content */
.tutorial-content {
  background-color: #F1EFEC;
  padding: 15px 30px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tutorial-content h2 {
  font-size: 2.2rem;
  margin: 0;
  transition: color 0.3s ease;
}

.tutorial-content p {
  margin-bottom: 15px;
  font-size: 16px;
  line-height: 1.7;
}

/* Math Content Styles */
.math-content {
  margin: 1.5rem 0;
  line-height: 1.7;
}

.math-heading {
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  color: #333;
  font-weight: 600;
}

.math-text {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}

.equation-block {
  margin: 1.2rem 0;
  padding-left: 1.5rem;
  text-align: left;
  overflow-x: auto;
}

.math-definitions {
  margin: 1.2rem 0 1.2rem 2rem;
  padding-left: 0.8rem;
}

.math-definitions li {
  margin-bottom: 0.8rem;
  list-style-type: "- ";
  padding-left: 0.5rem;
}

.unit-conversion {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.unit-conversion p {
  margin: 0.8rem 0;
}

/* KaTeX specific adjustments */
.katex {
  font-size: 1.12em !important;
  line-height: 1.5 !important;
}

.katex-display {
  margin: 0.8rem 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Styled ordered lists for stress types */
.content-ordered-list {
  margin-left: 30px;
  line-height: 1.6;
}

.content-ordered-list li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.content-ordered-list strong {
  font-weight: 600;
}

.content-unordered-list {
  list-style-type:disc;
  margin-left: 30px;
  line-height: 1.6;
}

.content-unordered-list li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.content-unordered-list strong {
  font-weight: 600;
}

.content-ordered-sub-list {
  margin-left: 30px;
  line-height: 1.6;
  list-style-type:lower-roman;
}

.content-ordered-sub-list li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.content-ordered-sub-list strong {
  font-weight: 600;
}

/* Footer */
.footer {
  background-color: black;
  color: white;
  padding: 30px 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: #123458;
}

.footer-section p {
  margin-bottom: 10px;
}

.footer-links a {
  display: block;
  padding: 8px 0;
  color: #ddd;
  transition: color 0.3s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: #F1EFEC;
  transform: translateX(5px);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
  background-color: #123458;
  transform: translateY(-3px);
}

.social-links i {
  color: white;
  font-size: 18px;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.assets-image{ 
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 600px;
  height: auto;
}

/* Accessibility Focus Styles */
/* a:focus,
button:focus,
input:focus {
  outline: 2px solid #04aa6d;
  outline-offset: 2px;
} */


/* ------------------ Logo color in darkmode ----------------------- */
/* Logo styling - ensures visibility in both modes */
.logo-svg {
    height: 70px;
    transition: filter 0.3s ease;
}

/* Dark mode logo treatment - pure white */
body.dark-mode .logo-svg {
    filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(255,255,255,0.3));
}

/* Optional: Add slight glow on hover */
body.dark-mode .logo-svg:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255,255,255,0.7));
}

/* Responsive Design */
@media screen and (max-width: 992px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-menu {
    display: none;
  }

  .sidebar.expanded .sidebar-menu {
    display: block;
  }

  .tutorial-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-content {
    flex-direction: column;
  }

  .footer-section {
    margin-bottom: 20px;
  }
}

@media screen and (max-width: 768px) {
  .logo img {
    height: 70px;
  }
  .tutorial-content {
    padding: 20px;
  }

  .tutorial-header h1 {
    font-size: 36px;
  }

  .tutorial-content h2 {
    font-size: 30px;
  }
}

@media screen and (max-width: 576px) {
  .secondary-nav {
    justify-content: flex-start;
  }
  .tutorial-content {
    padding: 15px;
  }

  .tutorial-header h1 {
    font-size: 32px;
  }

  .tutorial-content h2 {
    font-size: 28px;
  }

  .home-btn,
  .next-btn {
    padding: 8px 15px;
  }

  .logo img {
    height: 60px;
  }

  .right-corner a {
    margin-left: 10px;
  }

  .theme-toggle {
    margin-left: 10px;
  }

  .contact-link {
    display: none;
  }
}

@media screen and (max-width: 400px) {
  .mail-link {
    display: none;
  }  
}

@media screen and (max-width: 335px) {
  .youtube-link {
    display: none;
  }
}

@media screen and (max-width: 260px) {
    .theme-toggle {
      display: none;
    }
  }
