/* courses.css — harmonized with Luxury Silver × Gold × Yellow theme */

/* ===== Local tokens mapped to global theme ===== */
:root {
  --card-bg: var(--card, #ffffff);
  --card-bd: var(--silver-300, #d9dde5);
  --panel-bg: var(--silver-200, #eef1f6);

  --ink: var(--text, #0c0f14);
  --muted: var(--muted, #646b78);

  /* Gold accent (use global if present) */
  --accent-fill: var(--accent, linear-gradient(135deg, #b8860b, #c89b1c));
  --accent-solid: var(--accent-solid, #c19213);
  --accent-ink: var(--accent-ink, #0c0f14);
  --accent-glow: var(--accent-glow, rgba(200, 155, 28, .24));

  --radius: var(--radius, 16px);
  --focus: var(--focus, 0 0 0 3px rgba(239, 210, 106, .45));
}

/* ===== Toolbar ===== */
.course-toolbar {
  display: flex;
  gap: 10px;
  margin: 10px 0 18px;
}

.course-toolbar input[type="search"],
.course-toolbar select {
  border: 1px solid var(--card-bd);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.course-toolbar input[type="search"] {
  flex: 1;
}

.course-toolbar input[type="search"]:focus,
.course-toolbar select:focus {
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 3px rgba(239, 210, 106, .25);
  background: #fffdf5;
}

/* ===== Grid of courses ===== */
.courses-grid {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width:1024px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:640px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Card ===== */
.course-card {
  background: var(--card-bg);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(10, 16, 29, .06);
  display: grid;
  grid-template-rows: auto 1fr auto;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
  position: relative;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, #e7edf7, #fff, #f2d27a 60%, #c19213);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
}

.course-card::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 200, .45) 12%, rgba(255, 255, 255, 0) 24%);
  transform: translateX(-120%);
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(16, 24, 40, .12), 0 4px 10px rgba(16, 24, 40, .06);
  border-color: #d8bd62;
  /* matches global card hover */
  background: #ffffff;
}

.course-card:hover::before {
  opacity: 1;
}

.course-card:hover::after {
  transform: translateX(110%);
}

/* ===== Media ===== */
.course-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--card-bd);
}

/* ===== Body ===== */
.course-body {
  padding: 14px 14px 0;
  color: var(--ink);
}

.course-body h3 {
  margin: .2rem 0 .25rem;
  font-size: 1.08rem;
  transition: color .2s ease;
}

.course-card:hover .course-body h3 {
  color: #6f5200;
}

.course-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: .25rem 0 .5rem;
  color: var(--muted);
  font-size: .95rem;
}

.course-desc {
  margin: 0;
  color: var(--muted);
}

/* ===== Actions ===== */
.course-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
}

/* =========================================================================
   BUTTONS — ENHANCED COLORS + HOVER WITH ::BEFORE / ::AFTER (ONLY)
   ========================================================================= */

/* Shared base */
.btn-primary,
.btn-ghost {
  position: relative;
  /* enable ::before/::after */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .1px;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, background .3s ease, border-color .2s ease;
  overflow: hidden;
  /* clip shines to pill */
  border: 1px solid var(--card-bd);
}

/* Primary — brighter luxury gold with white text */
.btn-primary {
  /* brighter golds but still deep enough for white legibility */
  background: linear-gradient(135deg, #d4a017, #f0c83a);
  color: #ffffff;
  border-color: #e0b646;
  box-shadow: 0 10px 22px rgba(212, 160, 23, .32);
}

/* sweeping sheen (front) */
.btn-primary::before,
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: translateX(-110%) rotate(8deg);
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
}

/* bright streak */
.btn-primary::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 55%);
}

/* soft follow streak */
.btn-primary::after {
  background: linear-gradient(120deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 55%);
  transform: translateX(110%) rotate(8deg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #e0b126, #f6d34f);
  box-shadow: 0 14px 28px rgba(212, 160, 23, .38);
  border-color: #d6b052;
  filter: saturate(1.03);
}

.btn-primary:hover::before {
  transform: translateX(120%) rotate(8deg);
}

.btn-primary:hover::after {
  transform: translateX(-120%) rotate(8deg);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(212, 160, 23, .3) inset, 0 6px 14px rgba(212, 160, 23, .2);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 210, 106, .5);
}

/* Ghost — soft silver with subtle gold hover edge */
.btn-ghost {
  background: linear-gradient(180deg, #ffffff, var(--panel-bg));
  color: #1a1a1a;
  border-color: var(--card-bd);
  box-shadow: 0 6px 16px rgba(16, 24, 40, .06);
}

/* silver sweep */
.btn-ghost::before,
.btn-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: translateX(-110%) rotate(8deg);
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
}

.btn-ghost::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 55%);
}

.btn-ghost::after {
  background: linear-gradient(120deg, rgba(0, 0, 0, .06) 0%, rgba(0, 0, 0, 0) 55%);
  transform: translateX(110%) rotate(8deg);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #fdfdfd, #f3f3f3);
  border-color: #d6b052;
  box-shadow: 0 10px 22px rgba(16, 24, 40, .10);
}

.btn-ghost:hover::before {
  transform: translateX(120%) rotate(8deg);
}

.btn-ghost:hover::after {
  transform: translateX(-120%) rotate(8deg);
}

.btn-ghost:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Disabled "View" button until registered */
.btn-ghost[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ===== Registered badge (gold-tinted) ===== */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .8rem;
  background: #fff9e6;
  color: #6f5200;
  border: 1px solid #efd26a;
}

/* ===== Dropdown population (layout align) ===== */
#coursesDropdown .dd-item small {
  color: var(--muted);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
