/****************************
* Base HTML
*****************************/

body {
    min-width: 300px;
}

strong {
    font-weight: 600;
}

@media only screen and (min-width: 0px)  {
    html {
        font-size: 15px;    
    }
}

@media only screen and (min-width: 992px)  {
    html {
        font-size: 16px;    
    }
}

.dropdown-content {
    -webkit-overflow-scrolling: touch;
}

.material-tooltip {
    text-align: left;
    max-width: 250px;
}

#course-logo {
    margin-left: 14px;
    font-size: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 5px;
    width: 33%;
    height: 50px;
}

#course-home-url {
    height: 50px;
    display: inline-flex;
    align-items: center;
}

#course-code {
    min-width: 0;
    overflow:hidden;
    text-overflow: ellipsis;
}

@media(max-width: 555px) {
    #course-code {
        display: none;
    }
}

.course-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: contain;
}

.generic-course-icon {
    width: 46px;
    margin-right: 10px;
    text-align: center;
    color: #999;
    font-size: 30px !important;
}

#page-content {
    padding-top: 30px;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-items {
    display: flex;
    flex: 1;
    width: 33%;
    justify-content: center;
}

nav ul li.active {
    background-color: rgba(0, 0, 0, 0.2);
}

#logout-button {
    justify-content: flex-end;
}

#logout-button button {
    border: none;
    background-color: transparent;
    transition: background-color 0.3s;
    font-size: 1rem;
    color: #fff;
    display: block;
    padding: 0 15px;
    cursor: pointer;
    line-height: 64px;
}

#logout-button button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.center-container-for-button {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.force-scrollbar::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}

.force-scrollbar::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
    -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

/****************************
* Course list page
*****************************/

#current-and-past-classes,
#future-classes {
    flex-grow: 1;
    flex-basis: 0;
    max-width: 500px;
}

.card.course-list {
    width: auto;
    min-width: 300px;
    max-width: 500px;
    margin: 0px 20px 40px;
}

.course-list-info {
    width: calc(100% - 25px);
}

.course-list-info > * {
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-list .collection-item.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    display: flex;
}

#no-enrollment-card {
    text-align: center;
}

#return-to-login-button {
    margin-top: 20px;
}

/****************************
* Class page
*****************************/

.flex-center-container {
    display: flex;
    justify-content: center; 
    flex-flow: row wrap;
    align-items: flex-start;
}

#widgets-container {
    max-width: 450px; 
}

.widget {
    display: inline-block;
    align-self: flex-start;
    flex-shrink: 0;
    width: 360px;
    margin: 0px 20px 30px;
}

#class-ranking {
    list-style: none;
    -webkit-padding-start: 0px;
    padding-left: 0;
}


@media screen and (max-width: 820px) {
    #widgets-container {
        max-width: 100%;
        flex-flow: row;
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start; 
        box-sizing: content-box;
        padding-left: 10px;
    }

    .widget {
        width: 300px;
        min-width: 200px;
        max-width: calc(90vw - 80px);
    }
    
    .widget .card-action {
        max-height: calc(100vh - 400px);
        min-height: 204px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    #widgets-container::after {
        content: "";
        width: 10px;
        height: 1px;
        align-self: flex-start;
        flex-shrink: 0;
    }
}

#class-ranking .empty-list-message {
    text-align: center;
    padding-left: 20px;
}

#class-ranking .ranking-item {
    min-height: auto
}

#class-ranking .ranking-position {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

.markdown td, th {
    padding: 5px 5px;
}

.markdown tr {
    border: none;
}

.markdown thead {
    border-bottom: 1px solid #bbb;
}

.markdown tr:last-child th {
    padding-bottom: 10px;
}
.markdown tr:first-child td{
    padding-top: 10px;
}

.markdown ul:not(.browser-default) {
    padding-left: 40px;
}
.markdown ol:not(.browser-default) {
    padding-left: 22px;
}

.markdown ul li {
    list-style-type: disc !important;
}

.markdown a:hover {
    text-decoration: underline;
}

.card .card-action.markdown a:not(.btn):not(.btn-large):not(.btn-large):not(.btn-floating) {
    text-transform: none;
    margin-right: 0;
}

.card-action.markdown ul {
    padding-left: 20px;
}

#posts {
    flex: 1 0;
    min-width: 300px;
    max-width: 700px;
    margin: 0px 30px 30px;
}

#posts span.badge {
    text-transform: uppercase;   
    font-size: 0.8rem;
    color: #fff;
    border-radius: 2px;
    float: none;
    padding: 3px 6px;
    position: relative;
    top: -1px;
}

.material-tooltip {
    max-width: 300px;
    padding: 16px;
}

.badge-description {
    margin: 0px;
}

.badge-description dt {
    font-size: 21px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.badge-description dt .badge-image {
    flex-shrink: 0;
}

.badge-description dd {
    margin-left: 0;
    word-break: break-word;
}

@media screen and (min-width: 700px) {
    #posts {
        margin-left: 40px;
    }
}

#show-more-ranking {
    display: none;
    text-align: center;
}

@media screen and (max-width: 820px) {
    #class-ranking:not(.expanded):not(:target) .ranking-item:nth-of-type(n+4) {
        display: none;
    }
    
    #class-ranking:not(.expanded):not(:target) #show-more-ranking {
        display: block;
    }
}

#posts article {
    margin-top: 0px;
    margin-bottom: 100px;
}

#posts time {
    color: #888;
}

#posts h4 {
    margin-bottom: 8px;
}

#posts header {
    margin-bottom: 25px;
}


/****************************
* Student page
*****************************/

#student-dropdown-container {
    text-align: center;
    margin-bottom: 40px;
}

/* show students list on click even if javascript is disabled*/
#students-dropdown:target {
    display: block;
    opacity: 1;
    left: 50%;
    transform: translate(-50%, 0);
}

#student-header {
    margin: 0px 20px;
    text-align: center; 
}


#student-icon {
    width: 1.8em;
    height: 1.8em;
    font-size: 1.7em;
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    color: white;
}

#student-info {
    margin-left: 20px;
}

#student-name {
    margin: 0px;
    font-size: 1.5em;
}

#student-total-score {
    margin: 10px 0 0;
    font-size: 1.2em;
    font-weight: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#lives {
    margin-left: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#lives i {
    font-size: 30px;
}

#achievement-list {
    display: inline-flex;
    flex-flow: row wrap;
    justify-content: center;
    width: 1000px;
    max-width: 100%;
    margin-bottom: 0px;
}

#achievement-list > li {
    margin: 0px 5px 10px;
}

.badge-incomplete {
    position: relative;
}

.badge-complete,
.badge-incomplete,
.badge-progress,
.badge-image,
.badge-percentage {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.badge-incomplete .badge-image,
.badge-incomplete .badge-percentage {
    border: 5px solid #ccc;
    transition: opacity 0.5s;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.tooltip-content .badge-image {
    width: 40px;
    height: 40px;
    margin-left: 10px;
}

.badge-incomplete .badge-image {
    filter: grayscale(100%);
    background-color: #ddd;
}

.badge-incomplete .badge-percentage {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
}

.badge-incomplete:hover .badge-percentage {
    opacity: 1;
}

.badge-circle {
    fill: transparent;
    stroke: black;
    stroke-width: 15;
    transform: rotate(270deg);
    transform-origin: 50% 50%;
    cx: 70px;
    cy: 68px;
    r: 64px; /* 2 * pi * 64 = 402 */
    stroke-dasharray: 402px 402px;
    /* compute stroke-dashoffset as 402 * (1 - percentage) */
}

#assignment-list {
    width: 100%;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
}

.card.assignment-list-item {
    width: 300px;
    flex: 1 0 1;
    margin: 20px;
}

.assignment-name,
.assignment-description {
    word-break: break-word;
}

.assignment-score {
    height: 70px;
}

.assignment-score-value {
    position: relative;
}


#assignment-list:target .percentage-switch,
.show-percentage .percentage-switch {
    background-color: #eee;
}
.percentage-label {
    display: none;
}
#assignment-list:target .percentage-label,
.show-percentage .percentage-label {
    display: block;
}

.xp-switch {
    background-color: #eee;
    border-right: 1px solid lightgray;
}
#assignment-list:target .xp-switch,
.show-percentage .xp-switch{
    background-color: rgba(0, 0, 0, 0);
}
#assignment-list:target .xp-label,
.show-percentage .xp-label {
    display: none;
}

.xp-percentage-switch {
    display: flex;
    position: absolute;
    right: 0px;
    top: calc(50% - 11.5px);
    height: 23px;
    border-radius: 2px;
    border: 1px solid lightgray;
    font-size: 12px;
}

.card .card-action a:not(.btn):not(.btn-large):not(.btn-large):not(.btn-floating).score-switch {
    width: 27px;
    color: rgba(0, 0, 0, 0.87) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0px;
    padding: 1px 7px 0px;
}

.change-to-percentage,
.change-to-xp {
    position: absolute;
    margin-left: 7px;
    margin-right: 0px !important; 
    transition: background-color 0.3s !important;
}

.change-to-percentage:hover,
.change-to-xp:hover {
    border-radius: 3px;
}

.assignment-no-points {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.assignment-min-max {
    display: flex;
    justify-content: space-between;
}

.assignment-score-points {
    text-align: center;
    font-weight: 300;
}

.task-list {
    margin-top: 20px;
    margin-left: -3px;
}

.task-list-item {
    display: flex;
    align-items: center;
}

/* optional task item after a non-optional item */
:not(.task-list-item.optional) + .task-list-item.optional {
    margin-top: 7px;
    border-top: 1px solid #ccc;
    padding-top: 5px;
}

.material-icons.no-grade-icon {
    text-align: center;
    font-size: 8px;
    color: #aaa;
    width: 24px;
}

.material-icons.circle-icon {
    font-size: 18px;
    padding-left: 3px;
    padding-right: 2px;
    margin-top: 2px;
}

.task-name {
    padding-top: 3px;
    padding-left: 5px;
    flex: 1;
}

.badge.task-points {
    text-align: right;
    margin-left: auto;
    white-space: nowrap;
    padding-top: 1px;
    padding-right: 0px;
}