/* ==========================================
   GLOBAL TYPOGRAPHY SYSTEM
   Apply to non-Elementor content only
   ========================================== */

/* Target LearnDash, WooCommerce, and general content areas */
.learndash h1,
.woocommerce h1,
.site-main h1:not(.elementor-heading-title),
article h1:not(.elementor-heading-title) {
  font-family: "Outfit", Sans-serif;
  font-size: 60px;
  font-weight: 600;
  line-height: 1.2em;
  color: #002060;
  margin-bottom: 20px;
}

.learndash h2,
.woocommerce h2,
.site-main h2:not(.elementor-heading-title),
article h2:not(.elementor-heading-title) {
  font-family: "Outfit", Sans-serif;
  font-size: 42px;
  font-weight: 600;
  line-height: 1.2em;
  color: #002060;
  margin-bottom: 18px;
}

.learndash h3,
.woocommerce h3,
.site-main h3:not(.elementor-heading-title):not(.entry-title),
article h3:not(.elementor-heading-title):not(.entry-title) {
  font-family: "Source Sans Pro", Sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3em;
  color: #24282E;
  margin-bottom: 16px;
}

.learndash h4,
.woocommerce h4,
.site-main h4:not(.elementor-heading-title),
article h4:not(.elementor-heading-title) {
  font-family: "Source Sans Pro", Sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3em;
  color: #24282E;
  margin-bottom: 14px;
}

.learndash h5,
.woocommerce h5,
.site-main h5:not(.elementor-heading-title),
article h5:not(.elementor-heading-title) {
  font-family: "Source Sans Pro", Sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4em;
  color: #24282E;
  margin-bottom: 12px;
}

.learndash h6,
.woocommerce h6,
.site-main h6:not(.elementor-heading-title),
article h6:not(.elementor-heading-title) {
  font-family: "Source Sans Pro", Sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4em;
  color: #24282E;
  margin-bottom: 10px;
}

/* Tablet (481px - 767px) */
@media only screen and (max-width: 767px) and (min-width: 481px) {
  .learndash h1,
  .woocommerce h1,
  .site-main h1:not(.elementor-heading-title),
  article h1:not(.elementor-heading-title) {
    font-size: 48px;
  }
  
  .learndash h2,
  .woocommerce h2,
  .site-main h2:not(.elementor-heading-title),
  article h2:not(.elementor-heading-title) {
    font-size: 36px;
  }
  
  .learndash h3,
  .woocommerce h3,
  .site-main h3:not(.elementor-heading-title):not(.entry-title),
  article h3:not(.elementor-heading-title):not(.entry-title) {
    font-size: 24px;
  }
  
  .learndash h4,
  .woocommerce h4,
  .site-main h4:not(.elementor-heading-title),
  article h4:not(.elementor-heading-title) {
    font-size: 20px;
  }
  
  .learndash h5,
  .woocommerce h5,
  .site-main h5:not(.elementor-heading-title),
  article h5:not(.elementor-heading-title) {
    font-size: 17px;
  }
}

/* Mobile (480px and below) */
@media only screen and (max-width: 480px) {
  .learndash h1,
  .woocommerce h1,
  .site-main h1:not(.elementor-heading-title),
  article h1:not(.elementor-heading-title) {
    font-size: 36px;
  }
  
  .learndash h2,
  .woocommerce h2,
  .site-main h2:not(.elementor-heading-title),
  article h2:not(.elementor-heading-title) {
    font-size: 28px;
  }
  
  .learndash h3,
  .woocommerce h3,
  .site-main h3:not(.elementor-heading-title):not(.entry-title),
  article h3:not(.elementor-heading-title):not(.entry-title) {
    font-size: 22px;
  }
  
  .learndash h4,
  .woocommerce h4,
  .site-main h4:not(.elementor-heading-title),
  article h4:not(.elementor-heading-title) {
    font-size: 18px;
  }
  
  .learndash h5,
  .woocommerce h5,
  .site-main h5:not(.elementor-heading-title),
  article h5:not(.elementor-heading-title) {
    font-size: 16px;
  }
  
  .learndash h6,
  .woocommerce h6,
  .site-main h6:not(.elementor-heading-title),
  article h6:not(.elementor-heading-title) {
    font-size: 15px;
  }
}

/* ==========================================
   GLOBAL CONTAINER ALIGNMENT
   ========================================== */

/* Ensure all content sections align with Elementor containers */
.site-main,
.learndash-wrapper,
.enrichcpe-breadcrumbs,
.woocommerce-account main.site-main > *:not(.woocommerce),
.single-sfwd-lessons .ld-content,
.single-sfwd-quiz .ld-content {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive container widths to match Elementor */
@media only screen and (max-width: 1299px) {
  .site-main,
  .learndash-wrapper,
  .enrichcpe-breadcrumbs,
  .woocommerce-account main.site-main > *:not(.woocommerce),
  .single-sfwd-lessons .ld-content,
  .single-sfwd-quiz .ld-content {
    max-width: 95.45% !important;
  }
}

/* ==========================================
   GLOBAL SPACING SYSTEM
   ========================================== */

/* Standard page top/bottom padding */
body:not(.elementor-page) .site-main {
  padding-top: 60px;
  padding-bottom: 60px;
}

/* Reduce padding on mobile */
@media only screen and (max-width: 767px) {
  body:not(.elementor-page) .site-main {
    padding-top: 30px;
    padding-bottom: 30px;
  }
}

/* Element spacing - apply to content areas only */
.learndash-wrapper p,
.woocommerce p,
article:not(.elementor) p {
  margin-bottom: 20px;
  line-height: 1.6em;
}

.learndash-wrapper ul,
.learndash-wrapper ol,
.woocommerce ul,
.woocommerce ol,
article:not(.elementor) ul,
article:not(.elementor) ol {
  margin-bottom: 20px;
  padding-left: 25px;
}

.learndash-wrapper li,
.woocommerce li,
article:not(.elementor) li {
  margin-bottom: 8px;
  line-height: 1.5em;
}

/* ==========================================
   GLOBAL BUTTON STANDARDIZATION
   ========================================== */

/* WooCommerce and LearnDash buttons only - don't override Elementor buttons */
.woocommerce button.button:not(.elementor-button),
.woocommerce a.button:not(.elementor-button),
.woocommerce input.button,
.learndash .ld-button,
.add_to_cart_button,
.single_add_to_cart_button,
.checkout-button,
form:not(.elementor-form) input[type="submit"],
form:not(.elementor-form) button[type="submit"] {
  font-family: "Source Sans Pro", Sans-serif !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 0 !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  line-height: 1.4em !important;
}

/* Primary button style (default) */
.woocommerce button.button:not(.elementor-button):not(.alt),
.woocommerce a.button:not(.elementor-button):not(.alt),
.learndash .ld-button:not(.alt),
.add_to_cart_button,
.single_add_to_cart_button {
  background-color: #002060 !important;
  color: #ffffff !important;
  border-color: #002060 !important;
}

.woocommerce button.button:not(.elementor-button):not(.alt):hover,
.woocommerce a.button:not(.elementor-button):not(.alt):hover,
.learndash .ld-button:not(.alt):hover,
.add_to_cart_button:hover,
.single_add_to_cart_button:hover {
  background-color: #D45A00 !important;
  border-color: #D45A00 !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.3) !important;
}

/* Secondary/Alt button style */
.woocommerce button.button.alt:not(.elementor-button),
.woocommerce a.button.alt:not(.elementor-button),
.woocommerce input.button.alt,
.checkout-button {
  background-color: #D45A00 !important;
  color: #ffffff !important;
  border-color: #D45A00 !important;
}

.woocommerce button.button.alt:not(.elementor-button):hover,
.woocommerce a.button.alt:not(.elementor-button):hover,
.checkout-button:hover {
  background-color: #ffffff !important;
  color: #D45A00 !important;
  border-color: #D45A00 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(212, 90, 0, 0.3) !important;
}

/* Disabled button state */
.woocommerce button.button:disabled,
.learndash .ld-button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.woocommerce button.button:disabled:hover,
.learndash .ld-button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Mobile button adjustments */
@media only screen and (max-width: 767px) {
  .woocommerce button.button:not(.elementor-button),
  .woocommerce a.button:not(.elementor-button),
  .learndash .ld-button,
  .add_to_cart_button,
  .single_add_to_cart_button {
    font-size: 16px !important;
    padding: 10px 20px !important;
  }
}

/* ==========================================
   PRINT BUTTON STYLING
   ========================================== */

/* Print Test button - use secondary color (orange) */
.enrichcpe-print-quiz-btn {
  background-color: #D45A00 !important;
  color: #ffffff !important;
  border: 2px solid #D45A00 !important;
  font-family: "Source Sans Pro", Sans-serif !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  line-height: 1.4em !important;
}

.enrichcpe-print-quiz-btn:hover {
  background-color: #ffffff !important;
  color: #D45A00 !important;
  border-color: #D45A00 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(212, 90, 0, 0.3) !important;
}

.enrichcpe-print-quiz-btn:focus {
  outline: 2px solid #D45A00 !important;
  outline-offset: 2px !important;
}

/* Mobile print button adjustments */
@media only screen and (max-width: 767px) {
  .enrichcpe-print-quiz-btn {
    font-size: 16px !important;
    padding: 10px 20px !important;
  }
}

/* ==========================================
   QUIZ IMPROVEMENTS - Question & Answer Numbering
   ========================================== */

/* Number questions */
.wpProQuiz_list > .wpProQuiz_listItem {
  counter-increment: question-counter;
  position: relative;
}

.wpProQuiz_list > .wpProQuiz_listItem .wpProQuiz_question_text:before {
  content: counter(question-counter) ". ";
  font-weight: 700;
  margin-right: 8px;
  color: #002060;
}

.wpProQuiz_list {
  counter-reset: question-counter;
}

/* Add letter labels to multiple choice answers */
.wpProQuiz_question_page .wpProQuiz_questionListItem {
  counter-increment: answer-counter;
  position: relative;
  padding-left: 35px !important;
}

.wpProQuiz_question_page .wpProQuiz_questionListItem:before {
  content: counter(answer-counter, upper-alpha) ". ";
  position: absolute;
  left: 10px;
  font-weight: 600;
  color: #24282E;
}

.wpProQuiz_question {
  counter-reset: answer-counter;
}


/* ==========================================
   PRINT STYLES FOR QUIZZES
   ========================================== */

@media print {
  /* Hide unnecessary elements when printing */
  header,
  footer,
  .site-header,
  .site-footer,
  nav,
  .enrichcpe-breadcrumbs,
  .enrichcpe-quiz-print-wrapper,
  .ld-button,
  .wpProQuiz_button,
  .wpProQuiz_button2,
  .wpProQuiz_button_restartQuiz,
  .wpProQuiz_button_reShowQuestion,
  .elementor-location-header,
  .elementor-location-footer,
  .learndash .ld-breadcrumbs,
  .learndash .ld-course-navigation,
  #learndash_mark_complete_button,
  .wpProQuiz_toplistButton {
    display: none !important;
  }

  /* Make quiz content full width */
  .learndash-wrapper,
  .wpProQuiz_content,
  .ld-quiz-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
  }

  /* Ensure questions are numbered and clear */
  .wpProQuiz_list > .wpProQuiz_listItem {
    page-break-inside: avoid;
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 20px;
  }

  /* Make sure answer options print clearly */
  .wpProQuiz_questionListItem {
    padding: 8px 0;
    page-break-inside: avoid;
  }

  /* Print quiz title */
  .ld-quiz-title,
  .wpProQuiz_header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  /* Print results clearly */
  .wpProQuiz_results {
    page-break-before: always;
    margin-top: 40px;
  }

  /* Results summary box */
  .wpProQuiz_catOverview,
  .wpProQuiz_time_limit,
  .wpProQuiz_points {
    border: 2px solid #000 !important;
    background: #f5f5f5 !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  /* Correct answers - add checkmark */
  .wpProQuiz_reviewQuestionSolved,
  .wpProQuiz_correct {
    background: #e8f5e9 !important;
    border-left: 4px solid #4caf50 !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
  }

  .wpProQuiz_reviewQuestionSolved:before {
    content: "✓ CORRECT: ";
    font-weight: bold;
    color: #000 !important;
  }

  /* Incorrect answers - add X mark */
  .wpProQuiz_reviewQuestionIncorrect,
  .wpProQuiz_incorrect {
    background: #ffebee !important;
    border-left: 4px solid #f44336 !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
  }

  .wpProQuiz_reviewQuestionIncorrect:before {
    content: "✗ INCORRECT: ";
    font-weight: bold;
    color: #000 !important;
  }

  /* User's answer vs correct answer display */
  .wpProQuiz_response {
    margin-top: 10px !important;
    padding: 10px !important;
    background: #fff3cd !important;
    border: 1px solid #856404 !important;
  }

  .wpProQuiz_response:before {
    content: "Your Answer: ";
    font-weight: bold;
    color: #000 !important;
  }

  /* Correct answer indicator */
  .wpProQuiz_AnswerCorrect,
  .wpProQuiz_answerCorrect {
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    padding: 8px !important;
    margin: 5px 0 !important;
  }

  .wpProQuiz_AnswerCorrect:after {
    content: " ✓";
    color: #000 !important;
    font-weight: bold;
  }

  /* Incorrect answer indicator */
  .wpProQuiz_AnswerIncorrect,
  .wpProQuiz_answerIncorrect {
    background: #f8d7da !important;
    border: 2px solid #dc3545 !important;
    padding: 8px !important;
    margin: 5px 0 !important;
  }

  .wpProQuiz_AnswerIncorrect:after {
    content: " ✗";
    color: #000 !important;
    font-weight: bold;
  }

  /* Question review list */
  .wpProQuiz_reviewQuestion li {
    padding: 5px !important;
    margin: 5px 0 !important;
    border-bottom: 1px solid #ddd !important;
  }

  /* Points display */
  .wpProQuiz_points {
    font-size: 16pt !important;
    font-weight: bold !important;
    text-align: center !important;
  }

  /* Make sure all text is black on white */
  body,
  .wpProQuiz_content,
  .wpProQuiz_results,
  .wpProQuiz_reviewQuestion {
    color: #000 !important;
    background: #fff !important;
  }

  /* Remove any background colors that might interfere */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ==========================================
   WOOCOMMERCE CHECKOUT & CART CUSTOMIZATIONS
   ========================================== */

/* Update cart button - use secondary color */
.woocommerce button[name="update_cart"],
.woocommerce input[name="update_cart"] {
  background-color: #D45A00 !important;
  color: #ffffff !important;
  border-color: #D45A00 !important;
}

.woocommerce button[name="update_cart"]:hover,
.woocommerce input[name="update_cart"]:hover {
  background-color: #ffffff !important;
  color: #D45A00 !important;
  border-color: #D45A00 !important;
}

/* Hide Stripe "Pay with Link" button */
#payment-request-button,
.wc-stripe-payment-request-button-separator,
.wc-stripe-payment-request-button-wrapper {
  display: none !important;
}

/* Better styling for course name links in cart and checkout */
.woocommerce-cart .product-name a,
.woocommerce-checkout .product-name a,
.woocommerce table.shop_table .product-name a {
  font-weight: 600 !important;
  color: #002060 !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}

.woocommerce-cart .product-name a:hover,
.woocommerce-checkout .product-name a:hover,
.woocommerce table.shop_table .product-name a:hover {
  color: #D45A00 !important;
  text-decoration: underline !important;
}

/* ==========================================
   LEARNDASH LESSON COMPLETE CHECKMARK
   ========================================== */

/* Ensure checkmark appears when lesson is marked complete */
.learndash .ld-item-list-item.ld-is-complete .ld-status-icon.ld-status-complete {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.learndash .ld-item-list-item.ld-is-complete .ld-status-icon.ld-status-complete .ld-icon-checkmark {
  display: inline-block !important;
  font-size: 16px;
}

/* Ensure the complete status styling is visible */
.learndash .ld-item-list-item.ld-is-complete .ld-item-list-item-preview {
  opacity: 0.7;
}

.learndash .ld-item-list-item.ld-is-complete .ld-item-name {
  text-decoration: line-through;
  opacity: 0.8;
}


/* Hide lesson content header row in course navigation */
.ld-table-list-header.ld-primary-background {
    display: none !important;
}

/* ==========================================
   QUIZ NUMBERING & LETTERING FIXES
   ========================================== */

/* Hide "Question" text after number */
.wpProQuiz_header {
    display: none !important;
}

/* Show question numbers in legend */
.wpProQuiz_question_text::before {
    content: attr(data-question-number) ". ";
    font-weight: 600;
    margin-right: 5px;
}

/* Ensure answer letters show (A, B, C, D) */
.wpProQuiz_list > .wpProQuiz_listItem::before {
    display: inline-block !important;
    margin-right: 8px;
    font-weight: 600;
}

/* Hide LearnDash's default breadcrumbs (we have our own) */
.single-sfwd-quiz .ld-breadcrumbs {
    display: none !important;
}

/* Hide duplicate quiz print buttons (keep only first set) */
.enrichcpe-quiz-print-wrapper:nth-of-type(2) {
    display: none !important;
}

/* ==========================================
   COURSE CONTENT - HIDE QUIZ UNTIL LESSON COMPLETE
   ========================================== */

/* Hide quiz by default */
.ld-item-list-item-quiz {
    display: none !important;
}

/* Show quiz when lesson is complete (using adjacent sibling combinator) */
.learndash-complete ~ .ld-item-list-item-quiz {
    display: block !important;
}

/* ==========================================
   QUIZ - HIDE QUESTION OVERVIEW GRID
   ========================================== */

/* Hide the question number grid/overview */
.wpProQuiz_reviewDiv {
    display: none !important;
}
