.tx-goals {
  margin-bottom:15px;
}

/** Flash Messages **/
.course-layout-wrapper .goals-flash-message {
  padding: 1em 1.5em;
  margin-bottom: 1em;
  border-radius: 0.5em;
  border: 1px solid transparent;
  font-size: 1rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.course-layout-wrapper .goals-flash-message strong {
  display: block;
  margin-bottom: 0.25em;
  font-weight: 600;
}

.course-layout-wrapper .goals-flash-message.notice {
  background-color: #eef6fc;
  border-color: #b6e0fe;
  color: #084298;
}

.course-layout-wrapper .goals-flash-message.info {
  background-color: #e7f5ff;
  border-color: #a5d8ff;
  color: #1c7ed6;
}

.course-layout-wrapper .goals-flash-message.ok {
  background-color: #e6fcf5;
  border-color: #96f2d7;
  color: #0f5132;
}

.course-layout-wrapper .goals-flash-message.warning {
  background-color: #fff3cd;
  border-color: #ffe69c;
  color: #664d03;
}

.course-layout-wrapper .goals-flash-message.error {
  background-color: #f8d7da;
  border-color: #f5c2c7;
  color: #842029;
}


.tx-goals .layout-coursecard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.tx-goals .layout-coursecard .course-item-wrapper {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    max-width:450px;
    justify-content: space-between;
}

/* Add spacing inside the card */
.tx-goals .layout-coursecard .course-item-wrapper > * {
    padding: 0 1rem;
}

/* Image wrapper shouldn't have side padding */
.tx-goals .layout-coursecard .course-image-wrapper {
    padding: 0;
}

/* Image fills card width */
.tx-goals .layout-coursecard .course-item-wrapper .course-list-image {
    width: 100%;
    height: auto;
    display: block;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    margin-bottom:15px;
}

/* Optional: tighter title line-height */
.tx-goals .layout-coursecard .course-item-wrapper .course-list-title {
    line-height: 1;
    margin-bottom:15px;
}

/* Hover effect */
.tx-goals .layout-coursecard .course-item-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tx-goals .layout-coursecard .course-footer-content {
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.tx-goals .layout-coursecard .course-footer-content .course-price {

}

.tx-goals .layout-coursecard .course-footer-content .course-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    width: 100%;
}

.tx-goals .layout-courserow {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
}

.tx-goals .layout-courserow .registration-item-wrapper {
  display: flex;
  align-items: center;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 1rem;
  gap: 1.5rem;
}

.tx-goals .layout-courserow .registration-image-wrapper {
  flex: 0 0 120px;
  height: 80px;
  background: #eee;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-goals .layout-courserow .registration-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
}

.tx-goals .layout-courserow .registration-list-title {
  flex-grow: 1;
  font-size: 1.2rem;
  margin: 0;
  color: #333;
}

.tx-goals .layout-courserow .registration-footer-content {
  flex-shrink: 0;
}

.tx-goals .layout-courserow .registration-footer-content a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #007acc;
  color: white;
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background 0.3s ease;
}

.tx-goals .layout-courserow .registration-footer-content a:hover {
  background: #005fa3;
}


.tx-goals ul.typo3-messages{
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.tx-goals .typo3-messages p {
  margin-bottom:0px;
}

/* FROM WITHIN THE COURSE! */

.course-layout-wrapper {
    display: flex;
    flex-direction: row;
    gap:15px;
}

.course-nav {
  min-width: 250px;
  max-width: 325px;
  width:25%;
  padding: 1rem;
  background-color: #f5f5f5;
  font-family: sans-serif;
}

.course-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.course-nav li {
  position: relative;
  margin: 0;
}

.course-nav > ul > li {
  border-bottom: 1px solid #ddd;
  padding: 0.5rem 0;
}

.course-nav a {
  text-decoration: none;
  color: #333;
  display: block;
  padding: 0.5rem;
  transition: background 0.2s ease;
}

.course-nav a:hover {
  background-color: #eaeaea;
}

/* Hide nested <ul> by default */
.course-nav li ul {
  display: none;
  padding-left: 1rem;
  background: #f0f0f0;
}

/* When parent is active (e.g. via JS toggle or :target), show submenu */
.course-nav li.open > ul {
  display: block;
}

/* Optional: indicator for submenu */
.course-nav li > a::after {
  content: '▸';
  float: right;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.course-nav li.open > a::after {
  transform: rotate(90deg);
}

.course-nav li.active > a {
  font-weight: bold;
  background-color: #ddd;
  color: #000;
}

.goals-header {
  display:flex;
  align-items: center;
  border:1px solid grey;
  border-radius:10px;
  padding:15px;
  margin-top:15px;
  margin-bottom:15px;
  line-height:1;
  background-color:#ddd;
}

.goals-header .goals-header-details {
  padding:15px;
}
/* ================================
   General Layout for Questions
================================= */
.question-wrapper {
  margin-bottom: 2rem;
}

.question-prompt {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ================================
   Text Field (User Input)
================================= */
.question-options-user-input input[type="text"] {
  font-size: 1rem;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 2px solid #ccc;
  background: transparent;
  transition: border-color 0.3s ease;
  outline: none;
  width: 350px;
  max-width: 100%;
}

.question-options-user-input input[type="text"]:focus {
  border-color: #007acc;
}

/* ================================
   Shared Label Styling
================================= */
.question-options-radio label,
.question-options-checkbox label {
  display: inline-flex;
  align-items: center;
  margin-right: 1.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.3s ease;
  user-select: none;
  position: relative;
  padding-left: 32px;
}

/* Hide native inputs */
.question-options-radio label input[type="radio"],
.question-options-checkbox label input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

/* Custom indicator box */
.question-options-radio label::before,
.question-options-checkbox label::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  position: absolute;
  left: 0;
  top: 0;
  border: 2px solid #007acc;
  background: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Radio is a circle */
.question-options-radio label::before {
  border-radius: 50%;
}

/* Checkbox is a square */
.question-options-checkbox label::before {
  border-radius: 4px;
}

/* Checked State — Uses :has() for modern browsers */
.question-options-radio label:has(input[type="radio"]:checked)::before {
  background-color: #007acc;
  box-shadow: inset 0 0 0 4px #fff;
}

/* Checkbox checked: show checkmark */
.question-options-checkbox label:has(input[type="checkbox"]:checked)::before {
  background-color: #007acc;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><path d='M7.629 13.294l-3.823-3.823-1.414 1.414L7.63 16.121l10.607-10.607-1.414-1.414z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

/* Hover + Focus */
.question-options-radio label:hover::before,
.question-options-checkbox label:hover::before {
  border-color: #005f99;
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2);
}

.question-options-radio label input[type="radio"]:focus + span,
.question-options-checkbox label input[type="checkbox"]:focus + span {
  outline: 2px solid #005f99;
  outline-offset: 4px;
}

.exam-submit-wrapper {
  margin-top: 2rem;
  /*text-align: center;*/
}

.exam-submit-button {
  background-color: #007acc;
  color: white;
  font-size: 1.125rem;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exam-submit-button:hover {
  background-color: #005f99;
  transform: translateY(-1px);
}

.exam-submit-button:active {
  transform: scale(0.98);
  background-color: #004c7a;
}

.exam-submit-button:focus {
  outline: 3px solid rgba(0, 122, 204, 0.5);
  outline-offset: 2px;
}

/* ================================
   Course Progress Bar
================================= */

.course-progress-bar {
  width: 100%;
  height: 16px;
  background-color: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.course-progress-fill {
  height: 100%;
  background-color: #4caf50; /* Green */
  transition: width 0.4s ease-in-out;
}

.course-progress-label {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
  text-align:center;
  font-weight:600;
  width: 100%;
  margin-bottom: 15px;
}


/* ================================
   Exam Results
================================= */
.results-container {
  margin-top: 2rem;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  font-family: sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results-header,
.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 80px;
  padding: 0.75rem 1rem;
  align-items: center;
}

.results-header {
  background-color: #f5f5f5;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
}

.result-row:nth-child(even) {
  background-color: #fafafa;
}

.result-row.correct {
  background-color: #e8f9ee;
}

.result-row.incorrect {
  background-color: #fdecea;
}

.result-col {
  padding: 0.25rem 0.5rem;
  overflow-wrap: anywhere;
}

.status-icon {
  font-size: 1.25rem;
  font-weight: bold;
}

.correct-icon {
  color: #27ae60;
}

.incorrect-icon {
  color: #e74c3c;
}

/* Responsive fallback for narrow screens */
@media (max-width: 460px) {
    .tx-goals .layout-coursecard {
        grid-template-columns: 1fr;
    }

    .tx-goals .course-item-wrapper {
        max-width: 100%;
    }
}