.joubel-create-document {
  --header-height: calc(var(--h5p-theme-spacing-s) * 3.5);
  --header-padding: var(--h5p-theme-spacing-xxs);
  --header-bottom-width: 1px;
}

.h5p-document-export-page .export-description {
  padding: var(--h5p-theme-spacing-s) 0em;
}

/* --------------------------- Required inputs not filled ------------------- */
.h5p-document-export-page .export-error-message {
  display: none;
  padding: var(--h5p-theme-spacing-xs);
  color: var(--h5p-theme-feedback-incorrect-main);
  border:solid 1px var(--h5p-theme-feedback-incorrect-third);
  background-color: var(--h5p-theme-feedback-incorrect-secondary);
  margin-bottom: var(--h5p-theme-spacing-xs);
  border-radius: var(--h5p-theme-border-radius-medium);
}

.h5p-document-export-page .export-error-message > ul:first-child {
  margin-top: var(--h5p-theme-spacing-xxs);
}

.h5p-document-export-page.required-inputs-not-filled .export-error-message {
  display: block;
}

.h5p-document-export-page.required-inputs-not-filled .export-document-button {
  opacity: 0.5;
  cursor: inherit;
  pointer-events: none;
}

/* Override export page styling */

.joubel-exportable-area h2{
  color: var(--h5p-theme-text-primary);
}
.joubel-exportable-area p{
  color: var(--h5p-theme-text-secondary);
}
.joubel-exportable-area span{
  color: var(--h5p-theme-text-third);
}

.joubel-exportable-area .goals-output p.category {
  margin-bottom: 0;
}

.joubel-exportable-area .goals-output ul {
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.textfields-output > p {
  min-height: 1px; /* Include margins for empty p tags */
}

/* ------------------------------ popup main container ---------------------- */
.joubel-create-document {
  position: absolute;
  width: 100%;
  left: 0;
  background: var(--h5p-theme-alternative-base);
  z-index: 3;
  height: 100%;
}

/*popup when inside column*/
.joubel-create-document {
  width: calc(100% - var(--h5p-theme-spacing-m));
  left: calc(var(--h5p-theme-spacing-m)/2);
  background: var(--h5p-theme-alternative-base);
  height: calc(100% - var(--h5p-theme-spacing-m));
}

/* ------------------------------- main elements ---------------------------- */

.joubel-exportable-header {
  color: var(--h5p-theme-text-primary);
  background-color: var(--h5p-theme-ui-base);
  border-bottom: var(--header-bottom-width) solid var(--h5p-theme-stroke-1);
  padding: var(--header-padding);
}

.joubel-exportable-body {
  max-width: 800px;
  margin: auto;
}

.joubel-exportable-header-inner {
  min-height: var(--header-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.joubel-exportable-body {
  --body-padding: var(--h5p-theme-spacing-m);
  --header-extra-height: 2 * var(--header-padding) - var(--header-bottom-width);

  padding-top: var(--body-padding);
  width: 100%;
  height: calc(100% - var(--header-height) - var(--header-extra-height) - 2 * var(--body-padding));
  display: flex;
  flex-direction: column;
}

/* ----------------------------- header elements ---------------------------- */

.joubel-exportable-header-text {
  margin-left: var(--h5p-theme-spacing-s);
  line-height: calc(var(--h5p-theme-font-size-xl)*2);
  font-size: var(--h5p-theme-font-size-xl);
}


/* Buttons */
.joubel-create-document .header-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--h5p-theme-spacing-xxs);
}

.joubel-create-document .header-buttons .joubel-exportable-page-close:before {
  margin-right: 0;
} 

/* ----------------------------- body elements ------------------------------ */

.joubel-exportable-area {
  margin: 0em var(--h5p-theme-spacing-s);
  padding: calc(var(--h5p-theme-spacing-s) * 1.5) calc(var(--h5p-theme-spacing-s) * 2);
  color: var(--h5p-theme-text-third);
  background-color: var(--h5p-theme-ui-base);
  box-shadow: 0 0 5px 1px var(--h5p-theme-alternative-darker);
  overflow: auto;
  box-sizing: border-box;
  max-width: 800px;
  width: calc(100% - calc(2*var(--h5p-theme-spacing-s)));
}
.joubel-exportable-area:focus-visible {
  outline: 2px ridge var(--h5p-theme-contrast-cta-white);
  outline-offset: 2px;
}

.joubel-exportable-success-message {
  margin: 0 var(--h5p-theme-spacing-s) var(--h5p-theme-spacing-s);
  text-align: center;
  background: var(--h5p-theme-feedback-correct-secondary);
  padding: calc(var(--h5p-theme-spacing-s)*0.6);
  color: var(--h5p-theme-feedback-correct-main);
}

.joubel-exportable-success-message.joubel-narrow-view {
  margin-left: 0;
  margin-right: 0;
}

/* ----------------------------- Responsive Design -------------------------- */

.joubel-create-document.responsive {
  background: var(--h5p-theme-ui-base);
}

.joubel-create-document.responsive .joubel-exportable-area {
  box-shadow: none;
  margin: 0;
  width: 100%;
}

.joubel-create-document.responsive .joubel-exportable-body {
  padding: 0;
  height: calc(100% - 3.5em);
}

.joubel-create-document.responsive .joubel-export-page-close {
  margin-right: 0;
}

/* No title threshold */

.joubel-create-document.responsive.no-title {
  .joubel-exportable-header-text {
    display: none;
  }

  .joubel-exportable-header-inner {
    justify-content: flex-end;
  }
}

