/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
  background-color: #f5f7fa;
}

/* Header styles */
header {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  margin-left: 1.5rem;
}

nav a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover {
  color: #3498db;
}

/* Main container styles */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  gap: 2rem;
}

/* Module navigation styles */
.module-nav {
  flex: 0 0 200px; /* Fixed width of 200px */
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.module-nav h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #2c3e50;
}

.module-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.module-nav li {
  margin-bottom: 0.5rem;
}

.module-nav a {
  display: block;
  padding: 0.5rem;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.module-nav a:hover {
  background-color: #f0f4f8;
}

.module-nav a.active {
  background-color: #3498db;
  color: white;
}

/* Content area styles */
.content-area {
  flex: 1; /* Take up remaining space */
  background-color: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Footer styles */
footer {
  background-color: #2c3e50;
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-section {
  flex: 1;
  min-width: 200px;
  margin-bottom: 1.5rem;
}

.footer-section h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

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

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #a3c2e3;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: white;
}

.copyright {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Module content styles */
.module-container h1 {
  margin-top: 0;
  color: #2c3e50;
}

.module-container h2 {
  color: #3498db;
  margin-top: 2rem;
}

.module-container h3 {
  color: #2c3e50;
}

.module-container p {
  margin-bottom: 1rem;
}

.module-container code {
  background-color: #f0f4f8;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

.module-container pre {
  background-color: #f0f4f8;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
}

/* Video container styles */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin: 2rem 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Error message styles */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 5px;
  margin: 1rem 0;
}

/* Loading message styles */
.loading {
  text-align: center;
  padding: 2rem;
}

/* Module navigation buttons */
.module-navigation {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.module-nav-btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.module-nav-btn:hover {
  background-color: #0069d9;
  text-decoration: none;
  color: white;
}

/* Fixed navigation styles */
.fixed-module-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #343a40;
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.fixed-module-title {
  font-weight: bold;
  font-size: 1.1rem;
}

.fixed-nav-buttons {
  display: flex;
  gap: 1rem;
}

/* Add padding to the bottom of the content to account for fixed navigation */
.content-area {
  padding-bottom: 5rem;
}

/* Interactive Code Styles */
.interactive-code-container {
  margin: 2rem 0;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.code-editor {
  margin-bottom: 1rem;
}

.code-textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #f1f3f5;
  resize: vertical;
}

.code-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.run-code-btn,
.reset-code-btn,
.solution-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.run-code-btn {
  background-color: #28a745;
  color: white;
}

.run-code-btn:hover {
  background-color: #218838;
}

.reset-code-btn {
  background-color: #6c757d;
  color: white;
}

.reset-code-btn:hover {
  background-color: #5a6268;
}

.solution-btn {
  background-color: #17a2b8;
  color: white;
}

.solution-btn:hover {
  background-color: #138496;
}

.code-output {
  padding: 1rem;
  background-color: #212529;
  color: #f8f9fa;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
}

.output-header {
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #adb5bd;
}

.success-message {
  color: #28a745;
}

.error-message {
  color: #dc3545;
}

.loading-output {
  color: #ffc107;
  font-style: italic;
}

/* Responsive styles */
@media (max-width: 991px) {
  .container {
    flex-direction: column;
  }
  
  .module-nav {
    flex: none;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .content-area {
    flex: none;
    width: 100%;
  }
}

/* Make the module sidebar always visible on larger screens */
@media (min-width: 992px) {
  .module-nav {
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 1rem;
    min-width: 200px;
    max-width: 200px; /* Ensure it doesn't grow beyond 200px */
  }
  
  .content-area {
    flex: 1;
    min-width: 0; /* Allow content to shrink if needed */
  }
}
