/* General Body Styles */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #eef2f7;
  /* Softer, modern background */
  color: white;
  /* Darker text */
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

/* Navbar Styles */
.navbar {
  background-color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* Soft shadow for a floating effect */
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .nav-links {
  display: flex;
  gap: 20px;
}

#theme-toggle {
  width: 5em;
  position: relative;
  height: 3.8em;
  border: 3px ridge #149cea;
  outline: none;
  background-color: transparent;
  color: white;
  transition: 1s;
  border-radius: 0.3em;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: large;
  margin-right: 7px;
}

.navbar a {
  width: 7em;
  position: relative;
  height: 3.5em;
  border: 3px ridge #149cea;
  outline: none;
  background-color: transparent;
  color: white;
  transition: 1s;
  border-radius: 0.3em;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: large;
}

.navbar a:hover::before,
.navbar a:hover::after {
  transform: scale(0);
}

.navbar a:hover {
  box-shadow: inset 0px 0px 25px #1479ea;
}

/* Theme Toggle Alignment Fix */
.theme-toggle {
  margin-left: auto;
  /* Pushes the toggle button to the far right */
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.theme-toggle img {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* Logo */
.navbar .logo img {
  height: 40px;
  width: auto;
}

.content-home {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Content Styles */
.content {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  /* Stronger shadow for modern look */
  transition: background-color 0.3s ease;
  animation: fadeIn 1.2s ease-in-out;
  /* Smooth content load animation */
  margin-bottom: 35px;
  color: black;
}

.content .heading-text {
  font-size: 18px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3,
h4 {
  color: black;
  font-weight: 700;
  /* Bolder titles */
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 30px;
  font-weight: 600;
}

/* Features Section */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  width: 100%;
}

.feature {
  background: linear-gradient(135deg, #fff, #f0f4f8);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; /* Added background transition */
  text-align: center;
  width: 300px;
}

.feature img {
  width: 100px; /* Ensure all images have a uniform size */
  height: auto;
  margin-bottom: 20px;
  object-fit: contain; /* Prevent image distortion */
}

.feature:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  /* Lift on hover */
  background: linear-gradient(
    135deg,
    #e0f7fa,
    #b2ebf2
  ); /* Change background on hover */
}

.feature h3 {
  color: #007bff;
  margin-bottom: 10px;
  transition: color 0.3s ease; /* Added transition for color */
}

.feature:hover h3 {
  color: #ff5733; /* Change title color on hover */
}

.feature p {
  color: #666;
  transition: color 0.3s ease; /* Added transition for paragraph color */
}

.feature:hover p {
  color: #333; /* Darker text on hover */
}

/* Responsive Design for Features */
@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.call-to-action {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.call-to-action h2 {
  margin: 30px 0 10px 0 !important;
}

.call-to-action p {
  margin: 10px 0 10px 0;
}

/* Call-to-Action Button */
.cta-button {
  display: inline-block;
  padding: 14px 36px;
  background-color: #007bff;
  color: white;
  border-radius: 50px;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s;
  margin-top: 20px;
}

.cta-button:hover {
  background-color: #0056b3;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

#generate-question-button {
  padding: 5px 10px;
  background: #dc3545;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}

/* Responsive Editor and Terminal */
#editor-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

#editor {
  width: 100%;
  height: 400px;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  font-size: 16px;
  line-height: 1.6;
}

#terminal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#terminal {
  width: 100%;
  height: 350px;
  background-color: #222;
  color: #f0f0f0;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  font-family: "Roboto Mono", monospace;
}

/* Button Styles */
#run-button,
#clear-button {
  padding: 12px 24px;
  background-color: #007bff;
  color: white;
  border-radius: 6px;
  border: none;
  margin-right: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.progress-wrap {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 20px;
}

.lesson-list a {
  text-decoration: none;
}

.lesson-list a:hover {
  text-decoration: underline;
}

#lesson-reset-btn {
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  color: #fff;
}

#clear-button {
  background-color: #dc3545;
}

#run-button:hover,
#clear-button:hover {
  transform: scale(1.05);
}

#clear-button:hover {
  background-color: #c82333;
}

/* Dark Theme */
body.dark-theme {
  background-color: #1b1b1b;
  /* Darker background */
  color: #e0e0e0;
  /* Light text */
}

body.dark-theme .navbar {
  background-color: #222;
}

body.dark-theme .content {
  background-color: #282828;
  color: #e0e0e0;
}

body.dark-theme .feature {
  background: linear-gradient(135deg, #292929, #353535);
  color: #e0e0e0;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4 {
  color: #e0e0e0;
}

body.dark-theme #editor {
  background-color: #1e1e1e;
  color: #cfcfcf;
}

body.dark-theme #terminal {
  background-color: #1e1e1e;
  color: #cfcfcf;
}

/* Call-to-Action in Dark Theme */
body.dark-theme .cta-button {
  background-color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 1rem;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .learn-container,
  .challenge-container {
    flex-direction: column;
  }

  .lesson-list,
  #challenge-list {
    flex: none;
    width: 100%;
  }

  #editor-container {
    flex-direction: column;
  }

  #editor,
  #terminal-container {
    width: 100%;
  }
}

a.clicked {
  color: #e94560;
  font-weight: bold;
}

/* Add these new styles to your existing styles.css file */

/* Challenge Page Styles */

.progress-container {
  margin-bottom: 1.5rem;
}

.progress-wrap {
  display: flex;
  flex-direction: row;
}

#challenge-reset-btn {
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  color: #fff;
}

.challenge-container {
  display: flex;
  gap: 2rem;
  padding-left: 1.5rem;
  background-color: #ecf0f1;
  border-radius: 8px;
}

#challenge-list {
  flex: 0 0 300px;
  background-color: #ecf0f1;
  padding: 1rem;
}

#challenge-list li {
  margin-bottom: 0.5rem;
}

#challenge-list a {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

#challenge-list a:hover {
  background-color: #3498db;
  color: #fff;
}

#challenge-list i {
  margin-right: 0.5rem;
}

.challenge-description {
  flex: 1;
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* FAQ Page Styles */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.accordion {
  background-color: #f9f9f9;
  color: #333;
  cursor: pointer;
  padding: 1rem;
  width: 100%;
  text-align: left;
  font-size: 1.1rem;
  border: none;
  outline: none;
  transition: 0.4s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.accordion:hover,
.accordion.active {
  background-color: #e0e0e0;
}

.panel {
  padding: 0 1rem;
  background-color: white;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

.panel p {
  margin: 1rem 0;
}

/* Enhance existing styles */
.content h2 {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.content h2 i {
  margin-right: 0.5rem;
  color: #3498db;
}

/* Dark theme adjustments */
body.dark-theme .challenge-description,
body.dark-theme .faq-item,
body.dark-theme .accordion,
body.dark-theme .panel {
  background-color: #2c3e50;
  color: #ecf0f1;
}

body.dark-theme .accordion:hover,
body.dark-theme .accordion.active {
  background-color: #34495e;
}

/* Responsive design for challenge and FAQ pages */
@media (max-width: 768px) {
  .challenge-container {
    flex-direction: column;
  }

  #challenge-list {
    flex: none;
    width: 100%;
  }
}

body.dark-theme .cta-button:hover {
  background-color: #0056b3;
}

#nav-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: #0056b3;
  color: white;
  cursor: pointer;
  padding: 10px;
  border-radius: 70px;
  font-size: 18px;
}

#nav-top:hover {
  background-color: #555;
}

/* Footer section */
footer {
  background: linear-gradient(135deg, #1c1c1c, #333);
  color: #e6e6e6;
  padding: 20px 0;
  position: relative;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.footer-content {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.footer-section {
  flex: 1;
  margin: 15px;
  min-width: 250px;
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.footer-section h3 {
  font-size: 1.7rem;
  margin-bottom: 20px;
  color: #ffffff;
  background: linear-gradient(45deg, #007bff, #ff7bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
}

.footer-section p,
.footer-section ul {
  font-size: 1rem;
  color: #ccc;
}

.footer-section ul {
  list-style-type: none;
  padding: 0;
}

.footer-section ul li {
  margin: 8px 0;
}

.footer-section a {
  letter-spacing: 1px;
  color: #e6e6e6;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease, background 0.3s ease;
}

.footer-section .link-element::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #007bff, #ff7bff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.footer-section a:hover::after {
  transform: scaleX(1);
}

.footer-section a:hover {
  color: #ff7bff;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  background-color: #151515;
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
}

.footer-bottom p {
  margin: 0;
  color: #aaa;
}

.social {
  margin-top: 20px;
}

.social a {
  color: #fff;
  font-size: 1.7rem;
  margin-right: 15px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, color 0.4s ease;
  display: inline-block;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.social i {
  padding: 10px;
}

.social a:hover {
  color: #ff7bff;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 123, 255, 0.7);
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-section {
    margin-bottom: 20px;
  }

  .social a {
    margin-right: 10px;
  }
}