html, body {
    height: 97.5%;    
}
body {
    justify-content: center;
}

div.page {
    height: 96%;
    /* width: 99.8%; */
    /* max-width: 1480px; */
    position: relative;
    border-spacing: 1px;
    border-collapse: separate;
    border: solid 2px #795d21c9;
    background-color: #ffffffa0;
}

header {
    margin-top:4px;    
    background: linear-gradient(0.02turn, #ffffffff, #ffffffd0, #ffffff60);
    min-height:45px;
    height:70px;
}

header>div {
    width:100%;
    height:100%;
    text-align: center;
    background-image: url(/images/background.jpg);
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: left;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header table {
    float: right;
}
#logoutLink {
    margin-left: 50px;
}
p {
    margin: 2px 0 2px 0;
}

.samIntro p {
    margin-top: auto;
    padding-top: 10px;
}

header h1, header a, header img {
    display:inline-block;
    text-wrap: auto;
    text-wrap-mode: wrap;
    text-wrap-style: balance;    
}

@media screen and (max-width: 1040px) {
    header img {
        display:none;
    }
}

a.printer {
    cursor: copy,context-menu,pointer;
}

aside, main {
    border: solid 1px #75611edb;
    margin:2px;
}

main {
    padding: 25px;    
    background: linear-gradient(0.25turn, #ffffffa8, #ffffff40);
    height:90%;
}

aside {
    padding: 0px 8px 8px 0px;
    overflow: auto;
    background-color: #fff8f8;
    min-width: 90px;
    width: 130px;
    float: left;
}

@media screen and (min-width: 1000px) {
    aside {
        min-width: 158px;
    }
}

aside ol,  aside ul {
    padding-inline-start: 0px;
}
aside p {
    margin-top: 10px;
    text-align: center;
}
aside li {
    display: block;
    border-bottom: 1px solid #ddd;    
}
aside li a {
    text-decoration: none;
    display: block;
    color: #000;
    padding: 3px 3px;
}
@media screen and (min-width: 1100px) {
    aside li a {
        padding: 5px 16px 2px 10px;
    }
}
@media screen and (min-width: 1450px) {
    main scrollable {
        padding: 0 12px 10px 12px;
    }
}

aside li a:hover {
    background : #5092DB url(/images/linkarrow.gif) no-repeat right center;/* #4688D1 #3574BA*/
    color: #fff;
    text-decoration: none;
}

li.selected {
    background-color:#FFE5CC; 
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  /*border-bottom: 1px dotted brown; /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #87d;
  color: #fff;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  font-size:1.2em;

  /* Position the tooltip text */
  position: absolute;
  z-index: 1;
  top: 125%;
  left: 25%;
  margin-left: -60px;

  /* Fade in tooltip */
  opacity: 0;
  transition: opacity 1.8s;
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #555 transparent;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 0.96;
}

.scrollable {
  height: 96%;
  overflow: auto;
  padding: 8px;
  box-sizing: border-box;
}

.flexRow {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: fit-content;
    text-align: center;
}

article ol.column>li {
    list-style-type: none;
}

article ol.row>li {
    display: inline-block; 
    margin-right: 10px;
    list-style-type: none;
}

/*                 Master wallpaper     */

#balloon {
    width: 32px;
    height: 25px;
    background-color: #ffcc00;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 4px;
    position: absolute;
    bottom: 10px;
    right: 10px;
    cursor: move;
  }
  #menu {
    display: none;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 10px;
    position: absolute;
  }
  .image-option {
    display: flex;
    align-items: center;
    margin: 5px 0;
  }

/* --- Updated for scrollable height logic --- */

html, body {
    height: 99.8%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body > .page {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
}


.scrollable {
    flex: 1;
    overflow: auto;
    padding: 25px;
    box-sizing: border-box;
}

/* --- Flex row layout for aside + main --- */
.row {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.row aside {
    flex: 0 0 130px;
    height: 100%;
    overflow-y: auto;
    background-color: #fff8f8;
}

.leftMenu {
  display: flex;
  flex-direction: column;
  height: 100vh; /* or any fixed height */
  padding: 1em;
  box-sizing: border-box; /* ensures padding is included in height */
  overflow: hidden; /* optional: prevent overflow */
}

.leftMenu ol {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.bottom-link {
  margin-top: auto;
  padding-top: 1.8em;
  line-height: 1.4;
  text-align: left;
}

.bottomLink {
  margin-top: auto;
  padding-top: 1.8em;
  text-align: left;
}

.row main {
    flex: 1;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

article.task h1 {
    font-size: 1.32em;
}

article.task .id {
    color: burlywood;
    float:right;
    margin: 0 4px;
}
nav.weeks {margin-left:20px}
/* Add styles for the progress bar */
.progress-container {
    width: 100%;
    background-color: #f3f3f3;
    border: 2px solid green;
    border-radius: 5px;
    position: relative;
    height: 30px;
    margin: 1px;
    display: flex;
}
.progress-bar {
    height: 100%;
    background-color: green;
    width: 0%;
    text-align: center;
    color: white;
    line-height: 30px;
    transition: width 0.5s; /* Smooth transition */
}
.progress-label {
    position: relative;
    top: 6px;
}
.arrow-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 35px;
    padding-left: 5px; 
}

.rConditions {
  position:absolute;
  transform: translate(-47%, -58%);
  white-space: nowrap;
  font-size: 80%;
  margin-bottom: 2px;
  text-align: center;
  background-color: #ffffff87; 
}

.condition {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 92%;
    margin-top: -1.5em;
    position: relative;
    white-space: nowrap;
    bottom: 26px;
    height: 39px;
}
.condition span {
    white-space: nowrap;
    position: relative;
    top: 12px;
    padding: 0 15px;
}
.condition.short span {
    padding: 0 11px;
}

.condition::after {
    content: '';
    display: block;
    width: 100%;
    height: 13px;
    background: url('data:image/svg+xml;utf8,<svg width="40" height="9" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="4.5" x2="30" y2="4.5" stroke="black" stroke-width="1" /><polygon points="30,2 40,4.5 30,7" fill="black" /></svg>') no-repeat;
    background-size: contain;
    margin-top: 0.5em; /* Space between text and arrow */
    background-position: center;
}

.condition.short::after {
    background: url('data:image/svg+xml;utf8,<svg width="25" height="9" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="4.5" x2="17" y2="4.5" stroke="black" stroke-width="1" /><polygon points="17,2 25,4.5 17,7" fill="black" /></svg>') no-repeat;
    background-size: contain;    
}

.condition.long::after {
    background: url('data:image/svg+xml;utf8,<svg width="100" height="9" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="4.5" x2="90" y2="4.5" stroke="black" stroke-width="1" /><polygon points="90,2 100,4.5 90,7" fill="black" /></svg>') no-repeat;
    background-size: contain;    
}

.condition.long2::after {
    background: url('data:image/svg+xml;utf8,<svg width="200" height="9" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="4.5" x2="190" y2="4.5" stroke="black" stroke-width="1" /><polygon points="190,2 200,4.5 190,7" fill="black" /></svg>') no-repeat;
    background-size: contain;    
}

.lessonContent {
  display: flex;
  flex-direction: column;
  height: 100%;
}

div.errorMsg {
    color: salmon;
}

div.panel {
    display:flex
}        
.descriptionPane {
    padding:8px;
}        
br {
    content: "";
    margin: 2em;
    display: block;
    font-size: 24%;
}
hr {
    width: 98%;
    margin-top: 22px;
}
h2.section_practise {
    border-bottom: 1px dashed brown;
    padding-bottom: 15px;
    margin: 6px;
}        
.ui-widget-overlay{transition: backdrop-filter 3s;}