/* Add to your existing style.css file */

.courses-page-content {
  flex: 1; /* Allows content to push footer down */
  padding: 40px 0;
  background-color: #f8fbfd; /* Lighter background for courses page */
}

.courses-page-content .page-title {
  font-family: "Montserrat", sans-serif;
  font-size: 2.8em;
  color: #0d47a1;
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  padding-bottom: 15px;
}

.courses-page-content .page-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #1a73e8;
  border-radius: 2px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.course-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-decoration: none; /* Remove underline from link */
  color: inherit; /* Inherit text color */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for consistent image size */
  overflow: hidden;
  background-color: #e0e0e0; /* Placeholder background */
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover the area, crop if necessary */
  transition: transform 0.3s ease;
}

.course-card:hover .card-image-wrapper img {
  transform: scale(1.05); /* Slight zoom on hover */
}

.card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Allow content to grow and push button to bottom */
}

.card-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6em;
  color: #0d47a1;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-description {
  font-size: 0.95em;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1; /* Allows description to take up available space */
}

.card-meta {
  display: flex;
  flex-wrap: wrap; /* Allow meta items to wrap */
  gap: 15px;
  font-size: 0.85em;
  color: #777;
  margin-top: 15px; /* Added margin-top for meta */
  margin-bottom: 20px;
}

.card-meta span {
  display: flex;
  align-items: center;
}

.card-meta span i {
  margin-right: 8px;
  color: #1a73e8;
}

/* Buttons for cards */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9em;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease,
    box-shadow 0.3s ease;
  border: none;
  margin-top: auto; /* Push button to the bottom of the card content */
}

.btn-primary {
  background-color: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 10px rgba(26, 115, 232, 0.2);
}

.btn-primary:hover {
  background-color: #0d47a1;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #0d47a1;
  border: 1px solid #d0d0d0;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  background-color: #ddd;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Style for 'Coming Soon' card */
.course-card.coming-soon {
  opacity: 0.8;
  cursor: default;
  background-color: #f5f5f5;
}

.course-card.coming-soon:hover {
  transform: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); /* Keep original shadow */
}

.course-card.coming-soon .card-title {
  color: #555;
}
.course-card.coming-soon .card-description {
  color: #777;
}

/* Adjustments for Mobile Navigation (from previous CSS, ensure these are compatible) */
/* The main-nav.active class for mobile menu display */
@media (max-width: 992px) {
  .navbar .main-nav.active {
    display: flex; /* Show the nav when active */
    flex-direction: column;
    position: absolute;
    top: 100%; /* Position below navbar */
    left: 0;
    width: 100%;
    background-color: #0d47a1;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .navbar .main-nav.active ul {
    flex-direction: column;
    align-items: center;
  }
  .navbar .main-nav.active ul li {
    margin: 10px 0;
  }
  .navbar .search-bar {
    order: initial; /* Reset order to prevent odd mobile layout */
    width: auto;
    flex-grow: 1; /* Allow search bar to grow */
    margin-left: 15px;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .courses-page-content .page-title {
    font-size: 2em;
    margin-bottom: 30px;
  }

  .course-grid {
    grid-template-columns: 1fr; /* Single column on smaller mobiles */
    gap: 25px;
  }

  .card-content {
    padding: 20px;
  }

  .card-title {
    font-size: 1.4em;
  }

  .card-description {
    font-size: 0.9em;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 20px;
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .courses-page-content .page-title {
    font-size: 1.8em;
  }
  .card-image-wrapper {
    height: 180px;
  }
  .card-content {
    padding: 15px;
  }
  .card-meta {
    font-size: 0.8em;
    gap: 10px;
  }
}

/* Universal Box-Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Basic Body Styling */
body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f7f6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Global Container for Centering Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar Styling */
.navbar {
  background-color: #0d47a1; /* Darker blue */
  color: #fff;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.navbar .logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.8em;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
}

.navbar .main-nav ul {
  list-style: none;
  display: flex;
}

.navbar .main-nav ul li {
  margin-left: 25px;
}

.navbar .main-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.3s ease;
}

.navbar .main-nav ul li a:hover {
  color: #a7d9ff; /* Lighter blue on hover */
}

.navbar .search-bar {
  display: flex;
  align-items: center;
}

.navbar .search-bar input {
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  outline: none;
  font-size: 0.9em;
  width: 180px;
  margin-right: 5px;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.navbar .search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.navbar .search-bar button {
  background-color: #1a73e8; /* Google Blue */
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

.navbar .search-bar button:hover {
  background-color: #0b5ac3;
}

.mobile-nav-toggle {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
}

/* Course Page Layout */
.course-page-wrapper {
  display: flex;
  flex: 1; /* Allows it to grow and fill available space */
  padding: 20px 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-right: 20px;
  flex-shrink: 0; /* Prevent sidebar from shrinking */
  transition: transform 0.3s ease-in-out;
}

.sidebar-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.4em;
  color: #0d47a1;
}

.section-list {
  list-style: none;
}

.section-item {
  margin-bottom: 5px;
}

.section-item .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background-color: #e0f2f7; /* Light blue */
  color: #0d47a1;
  text-decoration: none;
  font-weight: 700;
  border-radius: 5px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  user-select: none; /* Prevent text selection */
}

.section-item .section-title:hover {
  background-color: #cce9f5;
  color: #093c8d;
}

.section-item.active > .section-title {
  background-color: #0d47a1; /* Active section background */
  color: #fff;
}

.section-item.active > .section-title .icon-right {
  transform: rotate(180deg);
}

.section-item .section-title .icon-left {
  margin-right: 10px;
  font-size: 1.1em;
}

.section-item .section-title .icon-right {
  transition: transform 0.3s ease;
}

.lesson-list {
  list-style: none;
  padding-left: 0; /* Remove default padding */
  max-height: 0; /* Hidden by default */
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
  opacity: 0;
}

.section-item.active .lesson-list {
  max-height: 500px; /* Adjust based on max expected lessons */
  opacity: 1;
  transition: max-height 0.6s ease-in, opacity 0.6s ease-in;
}

.lesson-list li a {
  display: block;
  padding: 10px 15px 10px 45px; /* Indent lessons */
  color: #555;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lesson-list li a:hover {
  background-color: #f0f0f0;
  color: #0d47a1;
}

.lesson-list li a.current-lesson {
  background-color: #e6f7ff; /* Lighter blue for active lesson */
  color: #0d47a1;
  font-weight: 600;
  border-left: 4px solid #1a73e8;
}

/* Main Content Area */
.content-area {
  flex: 1; /* Allows content area to take up remaining space */
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lesson-content {
  display: none; /* Hide all lessons by default */
}

.lesson-content.active-lesson {
  display: block; /* Show active lesson */
}

.content-area h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 2.2em;
  color: #0d47a1;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 15px;
}

.content-area h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6em;
  color: #1a73e8;
  margin-top: 30px;
  margin-bottom: 15px;
}

.content-area h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.3em;
  color: #333;
  margin-top: 25px;
  margin-bottom: 10px;
}

.content-area p {
  margin-bottom: 15px;
  font-size: 1.05em;
  line-height: 1.7;
}

.content-area ul {
  list-style: disc;
  margin-left: 25px;
  margin-bottom: 15px;
}

.content-area ul li {
  margin-bottom: 8px;
}

.content-area a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.3s ease;
}

.content-area a:hover {
  text-decoration: underline;
  color: #0d47a1;
}

/* Code Blocks */
pre {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-left: 4px solid #1a73e8;
  padding: 15px;
  margin: 20px 0;
  overflow-x: auto;
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
  font-size: 0.95em;
  line-height: 1.4;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
  background-color: #eef;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Image and Text Combinations */
.content-block {
  display: flex;
  align-items: center;
  margin: 30px 0;
  gap: 30px; /* Space between text and image */
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.content-block .text-content {
  flex: 1;
}

.content-block .image-content {
  flex-shrink: 0; /* Prevent image from shrinking */
  text-align: center;
}

.content-block img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.content-block figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 10px;
}

/* Specific alignments for image blocks */
.content-block.image-right {
  flex-direction: row;
}

.content-block.image-left {
  flex-direction: row-reverse; /* Reverse order for image on left */
}

/* Full-width image */
.content-area .content-image-full {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 25px auto; /* Center the image */
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.content-area figcaption {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
  margin-bottom: 20px;
}

/* Lesson Navigation */
.lesson-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.lesson-navigation .nav-button {
  background-color: #1a73e8;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
}

.lesson-navigation .nav-button:hover {
  background-color: #0b5ac3;
  transform: translateY(-2px);
}

.lesson-navigation .nav-button i {
  margin: 0 8px;
}

.lesson-navigation .nav-button.prev-lesson {
  margin-right: auto; /* Push to left */
}

.lesson-navigation .nav-button.next-lesson {
  margin-left: auto; /* Push to right */
}

/* Footer Styling */
.footer {
  background-color: #333;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  margin-top: auto; /* Pushes footer to the bottom */
}

.footer .social-links {
  margin-top: 10px;
}

.footer .social-links a {
  color: #fff;
  font-size: 1.5em;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.footer .social-links a:hover {
  color: #1a73e8;
}

/* --- Responsive Design (Media Queries) --- */

/* Mobile Navigation Overlay - (CSS structure for an overlay if you implement it with JS) */
.overlay-menu {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  justify-content: center;
  align-items: center;
}

.overlay-menu.active {
  display: flex;
}

.overlay-menu .mobile-nav-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 80%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.overlay-menu .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 2em;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
}

.overlay-menu ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

.overlay-menu ul li {
  margin-bottom: 15px;
}

.overlay-menu ul li a {
  text-decoration: none;
  color: #0d47a1;
  font-size: 1.5em;
  font-weight: 600;
  display: block;
  padding: 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.overlay-menu ul li a:hover {
  background-color: #e0f2f7;
}

/* Tablets and smaller desktops (992px and below) */
@media (max-width: 992px) {
  .navbar .main-nav {
    display: none; /* Hide main nav on smaller screens */
  }

  .navbar .search-bar {
    order: 3; /* Move search below logo/toggle */
    width: 100%;
    margin-top: 15px;
    justify-content: center;
  }

  .navbar .search-bar input {
    width: 70%;
    max-width: 300px;
  }

  .mobile-nav-toggle {
    display: block; /* Show mobile toggle */
  }

  .course-page-wrapper {
    flex-direction: column; /* Stack sidebar and content */
    padding: 20px;
  }

  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
    transform: translateX(0); /* Ensure sidebar is visible */
  }

  .content-area {
    padding: 20px;
  }

  .content-block {
    flex-direction: column !important; /* Stack image and text vertically */
    text-align: center;
  }

  .content-block .text-content,
  .content-block .image-content {
    width: 100%;
  }

  .content-block img {
    margin-top: 20px;
  }
}

/* Mobile phones (768px and below) */
@media (max-width: 768px) {
  .navbar .logo {
    font-size: 1.5em;
  }

  .navbar .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .navbar .search-bar {
    margin-top: 0;
    order: initial; /* Reset order */
    width: auto;
    flex-grow: 1; /* Allow search bar to grow */
    margin-left: 15px;
    justify-content: flex-end;
  }

  .navbar .search-bar input {
    width: 150px; /* Smaller input on mobile */
    padding: 6px 10px;
  }

  .navbar .search-bar button {
    padding: 6px 10px;
  }

  .course-page-wrapper {
    padding: 15px;
  }

  .sidebar {
    padding: 15px;
  }

  .sidebar-header h3 {
    font-size: 1.2em;
  }

  .section-item .section-title {
    font-size: 0.95em;
    padding: 10px 12px;
  }

  .lesson-list li a {
    padding: 8px 12px 8px 35px;
    font-size: 0.9em;
  }

  .content-area {
    padding: 20px;
  }

  .content-area h1 {
    font-size: 1.8em;
  }

  .content-area h2 {
    font-size: 1.4em;
  }

  .content-area h3 {
    font-size: 1.1em;
  }

  .content-area p,
  .content-area ul li,
  .content-area code {
    font-size: 0.95em;
  }

  pre {
    padding: 10px;
    font-size: 0.85em;
  }

  .lesson-navigation {
    flex-direction: column;
    gap: 15px;
  }

  .lesson-navigation .nav-button {
    width: 100%;
    justify-content: center;
  }
}

/* Small mobile phones (480px and below) */
@media (max-width: 480px) {
  .navbar .search-bar {
    display: none; /* Hide search bar on very small screens to save space */
  }

  .navbar .logo {
    font-size: 1.3em;
  }

  .sidebar {
    padding: 10px;
    border-radius: 5px;
  }

  .content-area {
    padding: 15px;
    border-radius: 5px;
  }

  .content-area h1 {
    font-size: 1.6em;
    padding-bottom: 10px;
  }

  .content-area h2 {
    font-size: 1.3em;
    margin-top: 20px;
  }

  .content-block {
    padding: 15px;
    margin: 20px 0;
    gap: 20px;
  }
}
