/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.courses-section {
  padding: 60px 20px;
  background-color: #fff; /* White background for the section */
}

.courses-container {
  max-width: 1300px;
  margin: 0 auto;
}

.courses-section h2 {
  font-size: 2.5em;
  color: #e74c3c; /* Red color for the section heading */
  margin-bottom: 40px;
  text-align: center;
}

.courses-filter-search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-dropdown {
  margin-bottom: 15px;
}

.filter-select {
  padding: 10px 50px;
  border: none;
  border-bottom: 1px solid #e74c3c; /* Red border for the dropdown */
  font-size: 1em;
  box-sizing: border-box;
  border-radius: 1px;
}

.search-bar {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

#search-input {
  padding: 10px;
  border: none;
  border-bottom: 1px solid #e74c3c; /* Red border for the search input */
  font-size: 1em;
  width: 500px;
  box-sizing: border-box;
}

#search-btn {
  padding: 10px 15px;
  background-color: #e74c3c; /* Red background for the search button */
  color: #fff;
  border: none;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  font-size: 1em;
}

#search-btn:hover {
  background-color: #c0392b; /* Darker red for hover effect */
}

.filter-select:focus,
#search-input:focus {
  outline: none;
  border-bottom: 2px solid #e74c3c; /* Red border on focus */
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.course-card {
  position: relative;
  background-color: #fff; /* White background for course cards */
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.course-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
}

.course-info {
  position: relative;
}

.course-info h3 {
  font-size: 1.5em;
  color: #e74c3c; /* Red color for course titles */
  margin-bottom: 10px;
}

.course-info p {
  color: #333;
  font-size: 0.9em;
  margin-bottom: 10px;
}

.course-type,
.course-level {
  display: inline-block;
  background-color: #e74c3c; /* Red background for course type/level tags */
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  margin-right: 5px;
}

.course-hover-details {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(
    231,
    76,
    60,
    0.9
  ); /* Red background with transparency */
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.course-card:hover .course-hover-details {
  opacity: 1;
}

.course-hover-details h3 {
  font-size: 1.8em;
  margin-bottom: 15px;
}

.course-hover-details p {
  font-size: 1em;
  margin-bottom: 20px;
}

.course-link {
  display: inline-block;
  padding: 10px 15px;
  background-color: #e74c3c; /* Red background for course links */
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
  font-size: 1em;
}

.course-link:hover {
  background-color: #c0392b; /* Darker red for hover effect */
}

hr {
  width: 80%;
  margin: 25px auto;
  border: 1px solid #e74c3c; /* Red color for horizontal rule */
}

/* Responsive Styles */
@media (max-width: 768px) {
  .courses-section h2 {
    font-size: 2em;
    width: 100%;
  }

  .filter-select,
  #search-input {
    width: 100%;
  }

  #search-btn {
    width: 100%;
  }

  .course-hover-details h3 {
    font-size: 1.5em;
  }

  .course-hover-details p {
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .courses-section h2 {
    font-size: 1.8em;
  }

  .course-card h3 {
    font-size: 1.3em;
  }

  .course-info p,
  .course-hover-details p {
    font-size: 0.8em;
  }

  .course-link {
    font-size: 0.9em;
  }
}

.courses-toggle-menu {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.toggle-button {
  background-color: #ffd700;
  border: none;
  color: #333;
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 5px;
  flex: 1 1 18%;
  max-width: 18%;
}

.toggle-button.active {
  background-color: #333;
  color: #ffd700;
}

@media (max-width: 600px) {
  .toggle-button {
    flex: 1 1 30%;
    max-width: 30%;
  }
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.course-card {
  position: relative;
  width: 300px;
  padding: 10px;
  border: 1px solid #ccc;
  margin: 10px;
  cursor: pointer;
}

.short-course-list {
  margin-top: 10px;
  padding: 0;
  list-style: none;
  display: none; /* Hidden by default */
  border-top: 1px solid #ddd;
}

.short-course-list li {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

/* Class to display the list when active */
.short-course-list.visible {
  display: block;
}

/* Import Google Fonts for better typography */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

/* Root Variables for Consistent Styling */
:root {
  --sidebar-width: 800px;
  --sidebar-bg-color: #f9f9f9;
  --sidebar-text-color: #333333;
  --primary-color: #c0392b;
  --secondary-color: #ffffff;
  --border-color: #e0e0e0;
  --box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  --transition-speed: 0.3s;
  --font-family: "Roboto", sans-serif;
}

/* Sidebar Styles */
.course-sidebar {
  position: fixed;
  top: 0;
  right: -800px; /* Updated width */
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--sidebar-bg-color);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  transition: right var(--transition-speed) ease;
  z-index: 1000;
  overflow-y: auto;
  scroll-behavior: smooth;
  font-family: var(--font-family);
}

.course-sidebar.active {
  right: 0;
}

.sidebar-content {
  padding: 30px;
}

.close-btn {
  cursor: pointer;
  font-size: 28px;
  font-weight: 700;
  color: var(--sidebar-text-color);
  float: right;
  transition: color var(--transition-speed) ease;
}

.close-btn:hover {
  color: var(--primary-color);
}

#sidebar-course-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.sidebar-course-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

#sidebar-course-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--sidebar-text-color);
  margin-bottom: 25px;
}

/* Additional Details Styling */
.course-details p {
  margin: 12px 0;
  font-size: 16px;
  color: var(--sidebar-text-color);
}

.course-details strong {
  color: var(--primary-color);
}

.course-curriculum ul {
  list-style-type: disc;
  padding-left: 25px;
  margin-top: 10px;
}

.course-curriculum li {
  margin-bottom: 8px;
  color: var(--sidebar-text-color);
}

.course-instructor {
  margin-top: 20px;
}

#sidebar-course-instructor-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--primary-color);
}

#sidebar-course-instructor-bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--sidebar-text-color);
  margin-top: 5px;
}

/* Registration Form Styles */
#registration-form .form-group {
  margin-bottom: 15px;
}

#registration-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--primary-color);
}

#registration-form input,
#registration-form textarea,
#registration-form select {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  margin-bottom: 10px;
  transition: border-color var(--transition-speed) ease;
}

#registration-form input:focus,
#registration-form textarea:focus,
#registration-form select:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Form row styling */
.form-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

.submit-button {
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.submit-button:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-button {
  padding: 10px 20px;
  background-color: #6c757d;
  color: var(--secondary-color);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.back-button:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Overlay Styles */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease;
  z-index: 900;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 900px) {
  .course-sidebar {
    width: 90%;
    right: -100%;
  }

  .course-sidebar.active {
    right: 0;
  }
}

/* Scrollbar Styling (Optional) */
.course-sidebar::-webkit-scrollbar {
  width: 8px;
}

.course-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.course-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
  border: 2px solid #f1f1f1;
}

.main-card {
  border: 1px solid #ccc;
  padding: 20px;
  border-radius: 10px;
}

.card-header {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.card-content {
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.6;
}

.mini-cards {
  display: none;
  margin-top: 20px;
}

.mini-card {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  transition: background 0.3s ease;
}

.mini-card:hover {
  background: #ececec;
}

.mini-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.mini-card p {
  font-size: 0.9rem;
}

#toggleQualificationsBtn {
  background-color: #333;
  color: white;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 20px;
}

#toggleQualificationsBtn:hover {
  background-color: #555;
}

.find-out-more {
  display: inline-block;
  margin-top: 10px;
  background-color: #FFD700;
  color: #333;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
}

.find-out-more:hover {
  background-color: #FFB700;
}