/* ========================================================
   COURSE LISTING DISCOVERY PAGE STYLES (courses.css)
   AI Design shala / Skill Banao
   ======================================================== */

:root {
  --wf-border: #f4e4dd;
  --wf-card-border: #f8eee8;
  --wf-chip-bg: #fcf2ec;
  --wf-chip-text: #FF8000;
  --wf-chip-border: #f9dbd2;
  --skeleton-base: #f9efec;
  --skeleton-highlight: #f5e8db;
}

/* Page Header & Search Banner */
.listing-hero {
  padding: 48px 0 28px;
  background: radial-gradient(circle at 10% 20%, rgba(255, 125, 49, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 128, 0, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #fdf8f6 0%, #fdfbf9 100%);
  border-bottom: 1px solid var(--wf-border);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--orange);
}

.breadcrumbs span.separator {
  color: #b5afc4;
}

.listing-title {
  font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.listing-title span {
  background: linear-gradient(135deg, var(--orange), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.listing-intro {
  font-size: 16px;
  color: #555160;
  max-width: 720px;
  margin: 0 0 28px;
  line-height: 1.55;
}

/* Global Search Bar */
.search-bar-wrap {
  position: relative;
  max-width: 760px;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--wf-border);
  border-radius: 14px;
  padding: 6px 8px 6px 16px;
  box-shadow: 0 10px 28px rgba(108, 49, 255, 0.06);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.search-input-box:focus-within {
  border-color: var(--orange);
  box-shadow: 0 12px 32px rgba(108, 49, 255, 0.16);
}

.search-input-box svg.search-icon {
  color: #8b8599;
  flex-shrink: 0;
  margin-right: 12px;
}

.search-input-box input {
  border: none;
  outline: none;
  font-size: 15px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
}

.search-clear-btn {
  background: #eee8f8;
  border: none;
  color: #666;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  margin-right: 8px;
  transition: background 0.2s;
}

.search-clear-btn:hover {
  background: #ded4f4;
  color: #111;
}

.search-submit-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.search-submit-btn:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
}

/* Quick Category Pill Strip (Desktop & Mobile) */
.quick-pill-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 6px;
  scrollbar-width: none;
}

.quick-pill-strip::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  background: #fff;
  border: 1px solid var(--wf-border);
  color: #4b4857;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-pill:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.quick-pill.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 4px 12px rgba(108, 49, 255, 0.2);
}

/* Discovery Layout Grid */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  padding: 36px 0 80px;
  align-items: start;
}

/* Desktop Sidebar Facets */
.filter-sidebar {
  background: #fff;
  border: 1px solid var(--wf-card-border);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--wf-card-border);
  margin-bottom: 20px;
}

.filter-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
}

.filter-clear-all {
  font-size: 13px;
  color: var(--orange);
  text-decoration: underline;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-weight: 600;
}

.filter-clear-all:hover {
  color: var(--orange-hover);
}

.filter-group {
  margin-bottom: 22px;
  border-bottom: 1px solid #f2edf9;
  padding-bottom: 18px;
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  user-select: none;
}

.filter-group-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3b3749;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #4b4857;
  cursor: pointer;
  transition: color 0.15s;
}

.filter-option:hover {
  color: var(--ink);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--orange);
  cursor: pointer;
}

.filter-option .count-badge {
  margin-left: auto;
  font-size: 11px;
  color: #998b85;
  background: #fbf3ef;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.filter-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Main Content Area & Controls Bar */
.catalog-main {
  min-width: 0;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--wf-card-border);
}

.results-count {
  font-size: 15px;
  color: #555160;
}

.results-count strong {
  color: var(--ink);
  font-weight: 800;
}

.sort-control-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.sort-select {
  background: #fff;
  border: 1.5px solid var(--wf-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(108, 49, 255, 0.12);
}

/* Active Filter Chips */
.active-chips-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wf-chip-bg);
  color: var(--wf-chip-text);
  border: 1px solid var(--wf-chip-border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.active-chip button {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.active-chip button:hover {
  color: #b70000;
}

.clear-all-chips {
  font-size: 12px;
  color: #797387;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  font-weight: 600;
}

.clear-all-chips:hover {
  color: var(--orange);
}

/* Course Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* High Fidelity Reusable Course Card */
.course-card-wf {
  background: #fff;
  border: 1px solid var(--wf-card-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 22px rgba(18, 19, 30, 0.04);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.course-card-wf:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 42px rgba(108, 49, 255, 0.12);
  border-color: #d8ccee;
}

.card-thumb-wf {
  height: 150px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  color: #fff;
  background-size: cover;
}

.card-thumb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-tag {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.discount-badge {
  background: #ff5e1e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(255, 94, 30, 0.35);
}

.card-thumb-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #ede9f6;
  font-weight: 600;
}

.rating-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd32a;
}

.reviews-count {
  color: #dfd8ed;
  font-size: 11px;
  font-weight: 500;
}

.lang-pill {
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #eee9f7;
}

.card-body-wf {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-level-format {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #797387;
  margin-bottom: 8px;
}

.level-pill {
  background: #faf1ed;
  color: var(--orange);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.format-dot {
  color: #ccc;
}

.format-pill {
  color: #555160;
}

.card-title-wf {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.35;
  color: var(--ink);
}

.card-benefit-wf {
  font-size: 12.5px;
  color: #3b2822;
  background: #fcf5f4;
  border-left: 3px solid var(--orange);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin: 0 0 10px;
  line-height: 1.4;
}

.card-desc-wf {
  font-size: 13px;
  color: #666173;
  margin: 0 0 14px;
  line-height: 1.5;
  flex-grow: 1;
}

.card-instructor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f3eff9;
  margin-bottom: 12px;
}

.instructor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #faede6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--orange);
  flex-shrink: 0;
}

.instructor-info {
  font-size: 12px;
  line-height: 1.3;
}

.instructor-name {
  font-weight: 700;
  color: var(--ink);
}

.instructor-role {
  color: #7d788c;
  font-size: 11px;
}

.card-meta-wf {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #7d788c;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-footer-wf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f3eff9;
}

.price-group {
  display: flex;
  flex-direction: column;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-current {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.price-original {
  font-size: 12px;
  color: #8b8599;
  text-decoration: line-through;
}

.card-cta-btn {
  background: #fff3ef;
  color: var(--orange);
  border: 1.5px solid #faded1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.card-cta-btn:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* Pagination / Load More Block */
.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 32px;
  text-align: center;
}

.pagination-progress {
  width: 240px;
  height: 6px;
  background: #e8e2f3;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 33%;
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.load-more-btn {
  background: #fff;
  border: 2px solid var(--orange);
  color: var(--orange);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.load-more-btn:hover {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 49, 255, 0.2);
}

/* Mobile Controls Sticky Bar */
.mobile-controls-bar {
  display: none;
  position: sticky;
  top: 60px;
  background: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-bottom: 1px solid var(--wf-card-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.mobile-btn-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.mobile-filter-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f7f4fd;
  border: 1.5px solid var(--wf-border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.mobile-filter-badge {
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.mobile-sort-select {
  flex: 1;
  background: #f7f4fd;
  border: 1.5px solid var(--wf-border);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

/* Mobile Drawer / Bottom Sheet */
.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 19, 30, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
  display: none;
}

.filter-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.filter-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: #fff;
  border-radius: 24px 24px 0 0;
  z-index: 2001;
  display: none;
  flex-direction: column;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
}

.filter-drawer.open {
  transform: translateY(0);
  visibility: visible;
}

@media (max-width: 960px) {
  .filter-drawer-overlay {
    display: block;
  }

  .filter-drawer {
    display: flex;
  }
}

.drawer-handle {
  width: 44px;
  height: 5px;
  background: #d8d2e4;
  border-radius: 999px;
  margin: 12px auto 8px;
}

.drawer-header {
  padding: 10px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0ecf6;
}

.drawer-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0ecf6;
  display: flex;
  gap: 12px;
  background: #fff;
}

.drawer-footer .btn-clear {
  flex: 1;
  padding: 12px;
  background: #f1edfa;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  color: #555;
  cursor: pointer;
}

.drawer-footer .btn-apply {
  flex: 2;
  padding: 12px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* Skeleton Loading Shimmer */
.skeleton-card {
  background: #fff;
  border: 1px solid #edeaf4;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-thumb {
  height: 150px;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  margin-bottom: 12px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Empty & Error State Panels */
.state-panel {
  display: none;
  background: #fff;
  border: 1.5px dashed var(--wf-border);
  border-radius: 20px;
  padding: 64px 24px;
  text-align: center;
  margin: 20px 0;
}

.state-panel.active {
  display: block;
}

.state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.state-icon.empty {
  background: #f2edfc;
  color: var(--orange);
}

.state-icon.error {
  background: #fdf0ed;
  color: #e53935;
}

.state-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
}

.state-desc {
  color: #666173;
  max-width: 480px;
  margin: 0 auto 20px;
  font-size: 15px;
  line-height: 1.5;
}

.state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Media Queries */
@media (max-width: 960px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 16px;
  }

  .filter-sidebar {
    display: none;
  }

  .mobile-controls-bar {
    display: block;
  }

  .controls-bar .sort-control-wrap {
    display: none;
  }

  .listing-hero {
    padding: 28px 0 20px;
  }
}