
/* CSS Variables for theming and consistency */
:root {
  --primary: #0056b3;
  --primary-hover: #004494;
  --secondary: #007bff;
  --bg: #f8f9fa;
  --card-bg: #fff;
  --text: #343a40;
  --border: #dee2e6;
  --shadow: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 6px 12px rgba(0,0,0,0.15);
  --radius: 12px;
  --transition: all 0.2s ease;
  --font: 'Roboto', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', Helvetica, Arial, sans-serif;
  --header-shadow: 0 2px 6px rgba(0,0,0,0.05);
  --card-background: var(--card-bg); /* Alias for FAQ section */
  --border-color: var(--border); /* Alias for FAQ section */
  --primary-color: var(--primary); /* Alias for FAQ section */
}

/* Dark Mode Theme */
html.dark {
  --bg: #121212;
  --card-bg: #1e1e1e;
  --text: #e0e0e0;
  --border: #333;
  --shadow: 0 4px 8px rgba(0,0,0,.3);
  --shadow-hover: 0 6px 12px rgba(0,0,0,.4);
  --header-shadow: 0 2px 6px rgba(0,0,0,0.2);
  --card-background: var(--card-bg);
  --border-color: var(--border);
  --primary-color: var(--primary);
}

/* Global Styles */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.banner-visible { padding-bottom: 80px; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  margin-top: 0;
  line-height: 1.4;
  font-weight: 700; /* BOLD HEADINGS */
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header Section */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--header-shadow);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.logo:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Header Search Bar */
.header-search {
  flex-grow: 1;
  max-width: 500px;
}
.header-search form {
  display: flex;
  position: relative;
  width: 100%;
}
.header-search input {
  width: 100%;
  padding: 10px 45px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}
.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.2);
}
.header-search button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
}
.header-search button:hover {
  color: var(--primary-hover);
}

/* Dark Mode Toggle & Mobile Filter Button */
.dark-mode-toggle, .filter-button-mobile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.dark-mode-toggle:hover {
  background: #e9ecef;
  color: var(--primary);
}
html.dark .dark-mode-toggle:hover {
  background: #333;
  color: #ffc107;
}
.filter-button-mobile {
  display: none;
  background: var(--secondary);
  color: white;
}
.filter-button-mobile:hover { background: #0066cc; }

/* Burger Menu for Mobile */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}
.burger-menu:focus { outline: none; }
.burger-menu div {
    width: 2rem;
    height: 0.25rem;
    background: var(--text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Main Content Area */
main {
  flex: 1;
  padding: 40px 0;
}

/* Course Filtering Section */
.filter-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
html.dark .filter-container { background: #1a1a1a; }
.filter-container:hover {
  box-shadow: var(--shadow-hover);
  background-color: var(--card-bg);
}

.filter-item {
    display: flex;
    flex-direction: column;
}
.filter-item.full-width {
    grid-column: 1 / -1; /* Make search span full width */
}
.filter-item label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 6px;
  display: block;
}
.filter-item select, .filter-item input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  box-sizing: border-box;
  transition: var(--transition);
}
html.dark .filter-item select, html.dark .filter-item input {
    background-color: #2a2a2a;
}
.filter-item select:focus, .filter-item input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.2), 0 2px 5px rgba(0,0,0,0.1);
}
.filter-item select:disabled {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}
html.dark .filter-item select:disabled {
    background: #2a2a2a;
    color: #888;
}

#results-count {
  font-weight: 600;
  color: var(--text);
  margin-top: auto;
  text-align: right;
  padding-top: 10px;
}

/* Course Listing Grid & Card */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.course-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.course-card .card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}
.course-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-content h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
  height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.provider {
  font-size: 0.88rem;
  color: #6c757d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.provider i { color: var(--primary); }
.price-container {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 10px 0 14px;
  color: var(--primary);
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.category-badge, .lang-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.category-badge {
  background: #e9ecef;
  color: var(--text);
}
html.dark .category-badge {
    background: #333;
    color: #e0e0e0;
}
.lang-badge {
  background: var(--primary);
  color: white;
}
.no-results, .loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  font-size: 1.2rem;
}

/* Course Detail Page */
.course-detail {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.course-detail h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.course-meta {
  margin-bottom: 24px;
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.95rem;
}
.highlighted-provider {
  background: #e7f1ff;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  font-weight: 600;
}
html.dark .highlighted-provider {
    background: #003366;
    border-color: #007bff;
    color: #e0e0e0;
}
.highlighted-provider a { color: var(--primary); }
html.dark .highlighted-provider a { color: #add8e6; }
.course-layout {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}
.course-info, .course-description {
  flex: 1;
  min-width: 300px;
}
.course-info img {
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.purchase-box {
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  background: #f8f9fa;
}
html.dark .purchase-box { background: #2a2a2a; }
.purchase-box .price {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}
.cta-button {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--secondary);
  color: white;
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
  transition: background 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  box-sizing: border-box;
}
.cta-button:hover {
  background: var(--primary-hover);
  color: white;
  text-decoration: none;
}
.course-description { flex: 2; }
.course-description h2 { margin-bottom: 16px; }
.course-description p { margin-bottom: 1em; }

/* Related Content Section */
.related-content {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--border);
}
.related-content h2 { margin-bottom: 24px; }

/* Sticky Banner */
.sticky-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1a1a1a;
  color: white;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  gap: 20px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}
.sticky-banner.visible { transform: translateY(0); }
.banner-content {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.banner-content p { margin: 0; font-size: 1.1rem; font-weight: 500; }
.banner-button {
  background: #ffc107;
  color: #1a1a1a;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.banner-button:hover { background: #ffca2c; color: #1a1a1a; }
.banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0 10px;
  line-height: 1;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin: 40px 0;
  gap: 8px;
  list-style: none;
  padding: 0;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: var(--transition);
}
.pagination a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  text-decoration: none;
}
.pagination .current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  cursor: default;
}
.pagination .dots {
  border: none;
  background: none;
  color: var(--text);
  cursor: default;
}

/* Footer */
footer {
  background: #343a40;
  color: #f8f9fa;
  padding: 40px 0;
  margin-top: 60px;
  width: 100%;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}
.footer-links a {
  color: #f8f9fa;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 500;
}
.footer-links a:hover {
  color: #ffc107;
  text-decoration: underline;
}
.footer-notice {
  text-align: center;
  font-size: 0.9rem;
  color: #adb5bd;
}
.footer-notice p { margin: 5px 0; }
.footer-notice a { color: #ffc107; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }
    .header-search { order: 1; }
    .dark-mode-toggle { order: 2; }
    .filter-button-mobile { display: inline-block; order: 3; }
    .burger-menu { display: flex; }
}

@media (max-width: 768px) {
  header .container { flex-wrap: wrap; justify-content: space-between; }
  .logo { flex-grow: 1; }
  .nav-links { top: 75px; } /* Adjust based on header height */
  .filter-container {
    display: none;
    grid-template-columns: 1fr;
    margin-top: 10px;
    padding: 15px;
  }
  .filter-container.active { display: grid; }
  .banner-content { flex-direction: column; gap: 10px; text-align: center; }
  .banner-content p { font-size: 1rem; }
  .course-layout { flex-direction: column; }
  .course-info, .course-description { min-width: 100%; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  .course-detail h1 { font-size: 2rem; }
  .course-meta { gap: 10px; }
}
@media (max-width: 576px) {
  .pagination a { padding: 8px 10px; font-size: 0.9rem; }
}

.course-highlights {
  margin: 24px 0;
  padding: 20px;
  background: #e7f1ff;
  border-radius: var(--radius);
  border-left: 5px solid var(--primary);
}
html.dark .course-highlights {
  background: #003366;
  border-color: #007bff;
}
.course-highlights h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--primary);
}
.course-highlights ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.course-highlights li {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.course-highlights .fa-check-circle {
  color: var(--primary);
  margin-top: 4px;
}

/* FAQ Section Styles */
.faq-section {
  margin: 60px 0;
  padding-top: 40px;
  border-top: 2px solid var(--border);
}
.faq-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
}
.faq-item {
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: var(--card-background);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}
.faq-question {
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  transition: var(--transition);
  color: var(--text);
  padding: 16px 20px;
}
.faq-question:hover { color: var(--primary-color); }
.faq-question i {
  transition: transform 0.3s ease;
  font-size: 0.9rem;
  color: #6c757d;
}
.faq-question.active i { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 20px;
  line-height: 1.7;
  font-size: 0.98rem;
  color: var(--text);
}
.faq-answer.open {
  max-height: 400px;
  padding: 0 20px 20px 20px;
}
.faq-answer p { margin: 0; padding-bottom: 10px; }
