/*
 * Styles for /courses/{slug} bundle/module detail pages (template-parts/course-detail/*.php).
 * Ported verbatim from the Laravel app's public/css/custom.css (the proven,
 * already-live design for these same pages at /portal/...), so this WP
 * rebuild matches pixel-for-pixel rather than reinventing the layout. Kept
 * fully self-contained (not layered on assets/css/course-bundles.css) since
 * that legacy stylesheet defines several of the same class names (.course-card,
 * .course-actions, .course-details-content, etc) with different, conflicting
 * rules from an older flex-based layout.
 */

/* Hero + brochure banner, ported from course-bundles.css so this file has no
   dependency on that legacy stylesheet. */
.course-page .page-thumbnail {
  aspect-ratio: 3/2;
  object-fit: cover;
}

.black-text {
  color: #000;
}

.green-text {
  color: #50991f;
}

.course-page .download-button {
  background: var(--color-green-mid);
  text-transform: uppercase;
}
.course-page .download-button:hover {
  color: var(--color-green-darkest);
  background-color: var(--color-white);
  border-color: var(--color-green-darkest);
  text-decoration: none;
}

.brochure-container {
  background-color: #50991f;
  padding: 10px 0;
}

.brochure-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.brochure-text {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 75px;
  letter-spacing: 0.8px;
  text-align: left;
}

.brochure-text .dark-text {
  color: #1d3e07;
}

.brochure-text .white-text {
  color: #fff;
}

.download-button {
  background-color: #1d3e07;
  color: #fff;
  padding: 8px 20px;
  border-radius: 33px;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}

.text-accent {
  color: var(--color-green-brand, #50991f) !important;
}

.course-code {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.course-meta {
  margin-bottom: 0.5rem;
}

.course-level-credits {
  font-size: 0.85rem;
  opacity: 0.75;
}

.bundle-date-list,
.course-date-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.bundle-date-list li,
.course-date-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.bundle-date-list label,
.course-date-list label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

/* =============================================
   Booking - available date cards
   (bundle-show / course-show pages)
   ============================================= */
.bundle-date-list,
.course-date-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-card {
  position: relative;
  background-color: #f8f9fb;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.date-card label {
  cursor: pointer;
}

.date-card input[type="checkbox"] {
  accent-color: var(--color-green-brand, #50991f);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.date-card:has(input:checked),
.date-card.expanded {
  border: 2px solid var(--color-green-brand, #50991f);
  background-color: #f8fdf5;
  box-shadow: 0 4px 12px rgba(80, 153, 31, 0.2);
}

.date-card:hover {
  border: 2px solid var(--color-green-brand, #50991f);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Top summary row - date, time, location only (no price / no checkbox).
   Clicking it expands/collapses the full schedule below. */
.date-card-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 15px;
  cursor: pointer;
}

.date-card-time-info {
  display: flex;
  align-items: center;
}

.date-card-date {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.date-card-time {
  font-size: 12px;
  color: #666;
  margin-left: 10px;
  padding-left: 10px;
  position: relative;
}

.date-card-time::before {
  content: "";
  height: 12px;
  width: 1px;
  background-color: #ddd;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.date-card-location {
  font-size: 12px;
  color: #888;
  text-align: right;
}

.date-card-schedule {
  display: none;
  margin: 0 20px 16px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
}

.date-card.expanded .date-card-schedule {
  display: block;
}

.schedule-heading {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-green-brand, #50991f);
}

.schedule-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.schedule-day-row {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.schedule-day-row:last-child {
  border-bottom: none;
}

.day-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.schedule-day-dates {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-day-date {
  font-size: 14px;
  color: var(--color-blue, #648798);
}

.schedule-day-modules {
  margin: 0 0 0 28px;
  font-weight: 700;
  color: #666;
  font-size: 15px;
  line-height: 20px;
}

/* =============================================
   Course / bundle details - two column layout
   ============================================= */
.course-details-section {
  padding: 3rem 0;
}

.course-details-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .course-details-content {
    grid-template-columns: 1fr;
  }
}

.course-left .course-code {
  margin-bottom: 10px;
}

.course-left .course-meta {
  margin-bottom: 16px;
}

.section-subheading {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-black, #000);
  margin: 24px 0 12px;
}

.course-left .section-subheading:first-child {
  margin-top: 0;
}

.course-requirements ul,
.course-description ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-requirements li {
  position: relative;
  padding: 8px 0 8px 30px;
}

.course-requirements li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background-color: var(--color-green-brand, #50991f);
  color: var(--color-white, #fff);
  font-size: 12px;
}

.course-description ul {
  margin-top: 12px;
  border-top: 1px solid var(--color-green-brand, #50991f);
}

.course-description ul li {
  padding: 10px 4px;
  border-bottom: 1px solid var(--color-green-brand, #50991f);
}

.course-actions {
  border: 1px solid var(--color-grey, #54595f);
  border-radius: 48px;
  padding: 24px;
  position: sticky;
  top: 100px;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wishlist-note {
  color: var(--color-grey, #54595f);
  font-size: 14px;
  margin: 0 0 20px;
}

.dates-hint {
  color: var(--color-grey, #54595f);
  margin: 0 0 16px;
}

.course-actions .buy-now-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: none;
}

.buy-now-btn.is-disabled,
.buy-now-btn:disabled {
  background-color: #d3d3d3;
  color: #8a8a8a;
  cursor: not-allowed;
  pointer-events: none;
}

.buy-now-btn.is-disabled::after,
.buy-now-btn:disabled::after {
  display: none;
}

.group-purchase-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.for-business-note {
  color: var(--color-grey, #54595f);
  font-size: 13px;
  text-transform: uppercase;
}

.buy-multiple-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px 20px;
  border: 2px solid var(--color-green-brand, #50991f);
  border-radius: 100px;
  color: var(--color-green-brand, #50991f);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.buy-multiple-btn:hover {
  background-color: var(--color-green-brand, #50991f);
  color: #fff;
}

.buy-multiple-btn.is-disabled {
  border-color: #d3d3d3;
  background-color: #d3d3d3;
  color: #8a8a8a;
  cursor: not-allowed;
  pointer-events: none;
}

.buy-multiple-btn.is-disabled:hover {
  background-color: #d3d3d3;
  color: #8a8a8a;
}

/* Buy Multiple Seats modal - matched to the portal's checkout login modal
   (colours, fonts, buttons) so the two read as one flow. */
#ifd-buy-multiple-modal .ifd-modal-content {
  max-width: 420px;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  line-height: 1.5;
}

#ifd-buy-multiple-modal .ifd-modal-content h3 {
  margin: 0 0 6px;
  text-transform: uppercase;
  color: var(--color-green-brand, #50991f);
  font-size: 28px;
  line-height: 1.2;
}

#ifd-buy-multiple-modal .ifd-modal-content p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 17px;
  color: var(--color-grey, #54595f);
}

#ifd-buy-multiple-modal #ifd-buy-multiple-summary {
  font-size: 14px;
  margin-bottom: 20px;
}

#ifd-buy-multiple-modal .ifd-modal-content label {
  display: block;
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-black, #000);
}

#ifd-buy-multiple-modal input[type="number"] {
  width: 100px;
  padding: 10px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  font-size: 15px;
  box-sizing: border-box;
  margin-bottom: 4px;
}

#ifd-buy-multiple-modal .ifd-modal-close {
  font-size: 24px;
  color: var(--color-grey, #54595f);
}

#ifd-buy-multiple-modal .book-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 100px;
  background-color: var(--color-green-brand, #50991f);
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

#ifd-buy-multiple-modal .book-now-btn:hover {
  background-color: var(--color-green-darkest, #386c17);
  color: #fff;
}

.course-curriculum-section {
  padding: 0 0 3rem;
}

.course-curriculum-section .bundle-heading {
  margin-bottom: 16px;
}

.course-full-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.course-item {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eaeaea;
}

.course-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.course-card {
  display: flex;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.card-image {
  flex: 0 0 50%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
}

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

.card-content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.course-level {
  display: inline-block;
  background-color: var(--color-green-brand, #50991f);
  color: #fff;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.card-title {
  display: block;
  color: #000;
  font-size: 28px;
  font-weight: 800;
  line-height: 34px;
  margin: 0 0 10px;
  text-transform: uppercase;
  text-decoration: none;
}

a.card-title:hover {
  color: var(--color-green-brand, #50991f);
}

.course-subtitle {
  margin: 0 0 15px;
}

.course-subtitle .level-credits {
  color: var(--color-green-brand, #50991f);
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 600;
}

.card-description {
  font-size: 16px;
  line-height: 1.5;
  color: #555;
}

.card-content .course-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-content .course-cost {
  display: flex;
  align-items: center;
  background-color: var(--color-green-brand, #50991f);
  border-radius: 100px;
  color: #fff;
  padding: 10px 20px;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 700;
}

.card-content .book-now-btn {
  margin-left: auto;
}

.course-curriculum-detail {
  padding: 30px 0;
  background-color: #fff;
  border-radius: 10px;
  margin-top: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.curriculum-header {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background-color: var(--color-green-brand, #50991f);
  padding: 8px 25px;
  border-radius: 30px;
  margin-bottom: 25px;
  margin-left: 30px;
  text-transform: uppercase;
}

.curriculum-accordion {
  padding: 0 30px;
}

.curriculum-accordion .accordion-item.learning-outcome {
  border-bottom: 1px solid #e5e5e5;
  position: relative;
  background-color: #fff;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.curriculum-accordion .accordion-item.learning-outcome:last-child {
  margin-bottom: 0;
}

.curriculum-accordion .accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 15px;
  background: #fff;
}

.curriculum-accordion .outcome-text {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #333;
  padding-right: 15px;
}

@media (max-width: 768px) {
  .course-card {
    flex-direction: column;
  }

  .card-image {
    flex: 0 0 200px;
    width: 100%;
    aspect-ratio: auto;
  }

  .card-content {
    padding: 15px;
  }

  .card-title {
    font-size: 20px;
    line-height: 26px;
  }

  .curriculum-accordion,
  .course-curriculum-detail .card-content {
    padding: 0 15px;
  }
}

/* =============================================
   "More Information" modal (shown instead of checkout while online
   purchasing is disabled)
   ============================================= */
.ifd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ifd-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

.ifd-modal-content {
  position: relative;
  background-color: #fff;
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

.ifd-modal-content a {
  color: var(--color-green-brand, #50991f);
}

.ifd-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
}

.ifd-modal-close:hover {
  color: #000;
}
