/* courses.css */
body {
  font-family: sans-serif;
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

/* Intro Text Area */
.intro-text {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.intro-text h1 {
  margin-bottom: 15px;
  font-size: 2.2em;
  color: var(--text-heading);
}

.intro-text p {
  font-size: 1.1em;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Filter Button */
.filter-controls {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-button,
.apply-filter-button,
.clear-filter-button {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1em;
}
.filter-button:hover,
.apply-filter-button:hover,
.clear-filter-button:hover {
  background-color: var(--element-bg-hover);
}

/* --- Enhanced Filter Sidebar --- */
.filter-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-secondary);
  box-shadow: 4px 0 15px var(--shadow-color);
  transition: left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  color: var(--text-secondary);
}

.filter-sidebar.open {
  left: 0;
}

/* --- Sidebar Header --- */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
  background-color: var(--bg-tertiary);
}

.sidebar-header h3 {
  margin: 0;
  color: var(--text-heading);
  font-size: 1.1em;
  font-weight: 600;
}

.sidebar-header h3 i {
  margin-right: 10px;
  color: var(--text-secondary);
}

#filter-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8em;
  line-height: 1;
  padding: 0 5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#filter-close-btn:hover {
  color: var(--text-heading);
}

/* --- Scrollable Category List Area --- */
.category-list-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 20px;
}

/* --- Category List Styling --- */
ul.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

li.category-item {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-secondary);
}
li.category-item:last-child {
  border-bottom: none;
}

summary.category-summary {
  display: flex;
  align-items: center;
  padding: 15px 5px 15px 0;
  cursor: pointer;
  position: relative;
  list-style: none;
  background-color: transparent;
  border-radius: 0;
  transition: background-color 0.15s ease;
}
summary.category-summary:hover {
  background-color: var(--element-bg-hover);
}

summary.category-summary::-webkit-details-marker {
  display: none;
}

input.category-checkbox {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
  background-color: transparent;
  border-color: var(--border-primary);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  border: 1px solid var(--border-primary);
  border-radius: 3px;
}

input.category-checkbox:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

input.category-checkbox:checked::before {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

label.category-label {
  flex-grow: 1;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1em;
}

.toggle-icon i.fa-chevron-up,
.toggle-icon i.fa-chevron-down {
  display: inline-block !important;
}

details[open] > summary .toggle-icon i.fa-chevron-down {
  display: none;
}
details[open] > summary .toggle-icon i.fa-chevron-up {
  display: inline-block;
}
details:not([open]) > summary .toggle-icon i.fa-chevron-down {
  display: inline-block;
}
details:not([open]) > summary .toggle-icon i.fa-chevron-up {
  display: none;
}

ul.subcategory-list {
  list-style: none;
  padding: 10px 0 10px 40px;
  margin: 0;
}

ul.subcategory-list li {
  padding: 8px 0;
  display: flex;
  align-items: center;
}
ul.subcategory-list label.category-label {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* --- Fixed Action Footer --- */
.filter-actions {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  border-top: 1px solid var(--border-primary);
  background-color: var(--bg-tertiary);
  flex-shrink: 0;
}

.clear-filter-button {
  background-color: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  text-decoration: none;
}
.clear-filter-button:hover {
  background-color: var(--element-bg-hover);
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.apply-filter-button {
  background: var(--accent-primary);
  border: none;
  color: white;
}
.apply-filter-button:hover {
  background: var(--accent-primary-hover);
  opacity: 0.9;
  box-shadow: 0 2px 5px var(--shadow-color);
}

/* --- FontAwesome Up/Down Icons --- */
.toggle-icon i.fa-chevron-up {
  display: none;
}

/* Course Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

/* Course Card */
.course-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border: 1px solid var(--border-secondary);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px var(--shadow-color);
}

.course-card img.thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.course-card .course-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.course-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  line-height: 1.4;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 3.1em;
}

.course-card .category,
.course-card .instructor {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-card .meta {
  font-size: 0.9em;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.course-card .rating span {
  color: var(--color-warning);
  margin-right: 5px;
}

/* Course Detail Page */
.course-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
}

.course-detail-main {
  flex: 2;
  min-width: 300px;
}

.course-detail-sidebar {
  flex: 1;
  min-width: 250px;
}

.course-detail-sidebar img.detail-thumbnail {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 15px;
}

.course-detail-sidebar .info-box {
  background-color: var(--bg-secondary);
  padding: 20px;
  border-radius: 5px;
  border: 1px solid var(--border-secondary);
}

.course-detail-sidebar .info-box ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.course-detail-sidebar .info-box li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
.course-detail-sidebar .info-box li i {
  margin-right: 10px;
  color: var(--text-secondary);
  width: 16px;
  text-align: center;
}

.claim-button {
  display: block;
  width: 100%;
  background-color: var(--accent-primary);
  color: white;
  text-align: center;
  padding: 15px;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.claim-button:hover {
  background-color: var(--accent-primary-hover);
}

.course-detail-main h1 {
  margin-top: 0;
  font-size: 2em;
  color: var(--text-heading);
}

.course-detail-main .tagline {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.course-detail-main .section {
  margin-bottom: 25px;
}

.course-detail-main .section h2 {
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 8px;
  margin-bottom: 15px;
  color: var(--text-heading);
}

.course-detail-main .section p,
.course-detail-main .section ul {
  color: var(--text-secondary);
  line-height: 1.6;
}
.course-detail-main .section ul {
  padding-left: 20px;
}

/* Upload Form */
.upload-form {
  max-width: 700px;
  margin: 30px auto;
  padding: 30px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
}

.upload-form h1 {
  text-align: center;
  margin-bottom: 25px;
  color: var(--text-heading);
}

.upload-form .form-group {
  margin-bottom: 15px;
}

.upload-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-weight: bold;
}

.upload-form input[type="text"],
.upload-form input[type="url"],
.upload-form input[type="number"],
.upload-form textarea,
.upload-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 4px;
  box-sizing: border-box;
}

.upload-form textarea {
  min-height: 100px;
  resize: vertical;
}

.upload-form input[type="file"] {
  padding: 5px;
}

.upload-form input[type="checkbox"] {
  margin-right: 5px;
  accent-color: var(--accent-primary);
}
.upload-form .checkbox-group label {
  display: inline-block;
  margin-right: 15px;
}

.upload-form button[type="submit"] {
  display: block;
  width: 100%;
  padding: 12px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1em;
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

.upload-form button[type="submit"]:hover {
  background-color: var(--accent-primary-hover);
}

/* Simple Message Styling */
.message {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-weight: bold;
}
.message.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}
.message.error {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .course-detail-container {
    flex-direction: column;
  }
  header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  header nav ul {
    margin-top: 10px;
  }
  header nav ul li {
    margin-left: 0;
    margin-right: 15px;
  }
}

/* Course Detail Page Layout Adjustment */
.course-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 20px;
}
.course-detail-sidebar {
  flex: 1;
  min-width: 300px;
}
.course-detail-main {
  flex: 2;
  min-width: 350px;
}

/* Main Content Title */
.course-detail-main h1 {
  margin-top: 0;
  font-size: 2em;
  color: var(--text-heading);
  margin-bottom: 25px;
}

/* --- Tab Navigation Styles --- */
.course-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 25px;
}

.tab-link {
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 1.1em;
  margin-right: 10px;
  border-bottom: 3px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.tab-link:hover {
  color: var(--text-heading);
}

.tab-link.active {
  color: var(--accent-primary);
  font-weight: bold;
  border-bottom-color: var(--accent-primary);
}

/* --- Tab Content Styles --- */
.course-tabs-content {
}

.course-tab-content {
  display: none;
  padding-top: 10px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.course-tab-content p,
.course-tab-content ul {
  margin-bottom: 15px;
}
.course-tab-content ul {
  padding-left: 25px;
  list-style: disc;
}
.course-tab-content li {
  margin-bottom: 8px;
}

.course-tab-content.active {
  display: block;
}

/* Responsive adjustments for stacking */
@media (max-width: 768px) {
  .course-detail-container {
    flex-direction: column;
    gap: 30px;
  }
  .course-detail-sidebar,
  .course-detail-main {
    flex-basis: 100%;
  }

  .tab-link {
    font-size: 1em;
    padding: 8px 15px;
  }
}

/* Related Section */
.related-courses-section {
  margin-top: 40px;
  margin-bottom: 20px;
  padding-top: 30px;
  border-top: 1px solid var(--border-primary);
  clear: both;
  width: 100%;
}

.related-courses-section h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
}

.related-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  width: 100%;
}

.related-course-item {
  width: 100%;
}

.related-course-item .course-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.related-course-item .course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px var(--shadow-strong-color);
}

.related-course-item .thumbnail {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.related-course-item .course-info {
  padding: 12px;
  flex-grow: 1;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
}

.related-course-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-course-item .instructor {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.related-course-item .meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: auto;
}

@media (max-width: 992px) {
  .related-courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .related-courses-grid {
    grid-template-columns: 1fr;
  }
}

/* Pagination Styles */
.pagination-container {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.pagination-link,
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination-link:hover,
.pagination-btn:hover {
  background-color: var(--element-bg-hover);
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px var(--shadow-color);
}

.pagination-link.current {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  font-weight: 600;
}

.pagination-btn {
  min-width: 4.5rem;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-btn i {
  margin: 0 0.25rem;
}

.pagination-ellipsis {
  margin: 0 0.25rem;
  color: var(--text-disabled);
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pagination-info span {
  font-weight: 600;
  color: var(--text-primary);
}

/* Add animation for page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.course-grid {
  animation: fadeIn 0.4s ease-out;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination {
    flex-wrap: wrap;
  }

  .pagination-link {
    margin-bottom: 0.5rem;
  }
}

/* Breadcrumbs CSS */
.breadcrumbs-container {
  width: 100%;
  padding: 10px 0;
  background-color: var(--bg-tertiary);
  color: var(--text-heading);
  margin-bottom: 20px;
}

.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  font-size: 14px;
}

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

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs li + li:before {
  content: "/";
  margin: 0 8px;
  color: var(--text-disabled);
}

.breadcrumbs a {
  color: var(--accent-primary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs li:last-child {
  color: var(--text-heading);
}

/* Value Proposition Section Styling for Dark Theme */
.value-proposition {
  background-color: var(--bg-secondary);
  border-radius: 10px;
  padding: 40px 30px;
  margin: 30px 0;
  box-shadow: 0 3px 10px var(--shadow-color);
}

.value-proposition h2 {
  text-align: center;
  color: var(--text-heading);
  font-size: 28px;
  margin-bottom: 30px;
  font-weight: 600;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature {
  text-align: center;
  padding: 25px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: var(--bg-tertiary);
  box-shadow: 0 4px 6px var(--shadow-color);
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px var(--shadow-strong-color);
}

.feature i {
  font-size: 36px;
  color: var(--accent-primary);
  margin-bottom: 15px;
  display: block;
}

.feature h3 {
  font-size: 20px;
  color: var(--text-heading);
  margin-bottom: 12px;
  font-weight: 600;
}

.feature p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

/* Hide the entire value proposition section on mobile devices */
@media (max-width: 768px) {
  .value-proposition {
    display: none;
  }
}

/* ================================== */
/* FAQ Section Styles - Dark Mode     */
/* ================================== */

.faq-section {
  margin: 50px 0;
  padding: 30px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-heading);
  font-size: 28px;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-container details {
  margin-bottom: 15px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-tertiary);
  transition: all 0.3s ease;
}

.faq-container summary {
  padding: 15px 20px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  outline: none;
  color: var(--text-heading);
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-container summary::after {
  content: "+";
  font-size: 20px;
  font-weight: bold;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.faq-container details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-container details p {
  padding: 15px 20px;
  margin: 0;
  border-top: 1px solid var(--border-primary);
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-container details[open] {
  background-color: var(--bg-secondary);
}

/* Footer Styles */
.site-footer {
  background-color: var(--bg-tertiary);
  color: var(--text-heading);
  padding: 50px 0 20px;
  margin-top: 50px;
  font-size: 15px;
}

.site-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 30px;
  padding: 0 15px;
}

.footer-section h3 {
  color: var(--text-heading);
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: var(--accent-primary);
}

.footer-section.about p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.social-icons a {
  display: inline-block;
  width: 35px;
  height: 35px;
  background-color: var(--bg-primary);
  border-radius: 50%;
  text-align: center;
  line-height: 35px;
  color: var(--text-heading);
  margin-right: 10px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background-color: var(--accent-primary);
  transform: translateY(-3px);
}

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

.footer-section.links ul li {
  margin-bottom: 10px;
}

.footer-section.links ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
}

.footer-section.links ul li a:hover {
  color: var(--accent-primary);
  padding-left: 5px;
}

.footer-section.contact p {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.footer-section.contact p i {
  margin-right: 10px;
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
  font-size: 14px;
  color: var(--text-disabled);
}

.footer-bottom p {
  margin-bottom: 10px;
}

.disclaimer {
  font-size: 12px;
  color: var(--text-disabled);
}

/* Responsive Footer */
@media screen and (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }

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

