@import '../mixins/focus';

/* common */
.site-message {
  position: relative;
}
.site-message .icon {
  position: absolute;
  top: 19px;
}
.site-message .message {
  margin-left: 27px;
}
.label, .icon {
    margin-right: 0.2em;
}
.icon {
    margin-left: 5px;
}
dl > dt {
    margin-top: 0.5em;
}
.dl-horizontal dt {
    float: left;
    clear: left;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0;
    margin-right: 0.5em;
    width: 150px;
}
iframe {
    border: none;
}
.pre {
    white-space: pre;
}
.unread {
    font-weight: bold;
}
.panel-title .float-end {
    margin-left: 0.5em;
}
.nav .navbar-btn {
    margin-top: 10px;
    margin-bottom: 0;
}
.modal-dialog .modal-progress {
  padding: 40px 60px 20px;
}
#exercise-page-content blockquote {
  font-size:100%;
}
.unselectable {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* alerts */
.sticky-alert {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    overflow: hidden;
    z-index: 100;
}

.alert-default {
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    font-weight: bold;

    /* only used once and should be moved if .alert is re-implemented */
    .button-container {
        display: flex;
        flex-wrap: wrap;

        .aplus-button--secondary {
            margin-right: 4px;
        }
    }

    .language-icon {
        float: left;
        height: 2em;
        margin-right: 10px;
    }
}

/* Menu groups */
/*.navbar-nav > li.menu-groups {
	> a.dropdown-toggle {
		background: rgba(255, 0, 0, 0.3);
		&:hover {
			background: rgba(255, 0, 0, 0.4);
		}
	}
	&.open{
		> a.dropdown-toggle {
			background: rgba(255, 0, 0, 0.4);
		}
	}
}*/ // TODO: CHECK FOR REMOVAL #1442

/* dropdown menu */
.dropdown-menu > li button {
	display: block;
	border: none;
	background: transparent;
	padding: 3px 20px;
	clear: both;
	font-weight: 400;
	line-height: 1.42857143;
	/*color: #333;*/
	white-space: nowrap;
	text-align: left;
	width: 100%;

	/*&:hover {
		background: #eee;
	}*/
}

/* Skip links */

.skip-link { /* This one is equally applicable to all skip links */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    display: block;
}

.skip-link:focus {
	@include focus-with-background-and-color;
    position: absolute;
    z-index: 2000;
    width: auto;
    min-height: 50px;
    height: auto;
    overflow: visible;
    clip: auto;
    padding: 15px;
    display: flex;
    justify-content: left;
}

.page-skip-link:focus {
	@include focus-with-background-and-color;
    min-height: 24px;
}

/* menus */
.course-menu .nav>li>a {
	@include focus-with-background-and-color;
    padding: 2px 6px;
}
/* Make sidebar expand/collapse buttons keyboard-focusable */
.course-menu .aplus-button--secondary, #bs-navbar-collapse .aplus-button--secondary {
	@include focus-with-background-and-color;
}
@media (min-width: 768px) {
    #bs-navbar-collapse {
        display: block;
        position: fixed;
        top: 60px;
        bottom: 50px;
        max-height: 100%;
        width: 16vw;
        max-width: 16vw;
        overflow: auto;
        .minimised {
            width: 44px;
            margin-left: -10px;
        }
        a.nav-link {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }
    }
}
#bs-navbar-collapse.minimised a.nav-link {
    text-overflow: clip;
}
.course-menu .advert-thumbnail {
    margin-top: 4em;
    background-color: var(--bs-info-bg-subtle, #d9edf7);
    border-color: var(--bs-info-border-subtle, #bce8f1);
    border-radius: var(--bs-alert-border-radius, 6px);
    border: var(--bs-alert-border, 1px solid var(--bs-info-border-subtle, $gray-500));
    padding: 0.5em;
}
/*[data-bs-theme="dark"] {
    .course-menu .advert-thumbnail {
        background-color: var(--bs-info-bg-subtle, black);
        border-color: var(--bs-info-border-subtle, #333);
    }
}*/ // TODO: CHECK FOR REMOVAL #1442
.course-menu .advert-thumbnail h4 {
    margin-top: 0;
}
.course-menu .nav>li {
    max-width: 100%;
}
.siblings>.btn {
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-exercise, .menu-submission {
    max-width: 50%;
    text-overflow: ellipsis;
}
/* TODO: This should be moved from main to a proper place */
.exercise-nav {
    align-items: center;
}
/*@media (min-width: 768px) {
    .col-md-2 .nav a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}*/ // TODO: CHECK FOR REMOVAL #1442
.toc li {
    list-style: none;
}
#course-content a{
	@include focus-with-background-and-color;
}
@media (min-width: 768px) {
	#course-content {
        padding-left: 16vw;
        &.sidebar-collapsed {
            padding-left: 48px;
        }
	}
}
#main-course-menu li.header {
    padding-top: 0.5rem;
}

/* panels */
.module-panel .panel-heading {
    display: block;
    overflow: auto;
}
.module-panel .panel-title .caret {
    margin-right: 0.5em;
}
.collapsed .caret {
    border-left: 4px dashed;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}
.module-panel table {
    margin: 0;
}
@media (max-width: $screen-xs-max) {
    .module-panel .panel-heading {
        padding-bottom: 5px;
    }
    .module-panel .panel-title .badge {
        text-wrap: wrap;
        margin-bottom: 5px;
    }
    .module-panel .panel-title .module-name {
        display: inline-block;
    }
}

#modulesAccordion .accordion-button {
    @include focus-with-background-and-color;
    background-color: var(--bs-primary);
}
#modulesAccordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
#modulesAccordion .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Fix borders with vertically spaced accordion */
div.spaced-accordion > .accordion-item {
    border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
    border-radius: var(--bs-accordion-border-radius);
    margin-top: 1rem;
}
div.spaced-accordion > .accordion-item  > .accordion-header > .accordion-button:not(.collapsed) {
    border-top-left-radius: var(--bs-accordion-inner-border-radius);
    border-top-right-radius: var(--bs-accordion-inner-border-radius);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
div.spaced-accordion > .accordion-item  > .accordion-header > .accordion-button.collapsed {
    border-radius: var(--bs-accordion-inner-border-radius);
}

/* point progress */
.progress {
    position: relative;
}
/* TODO: Move defining the stickiness to a single
file for all the components */
.sticky-progress {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    overflow: hidden;
    z-index: 100;
}
.progress .required-points {
    position: absolute;
    height: 100%;
    border-left: 2px solid black;
}
.icon.red {
  color: #ff7070;
}
/*.panel-primary>.panel-heading .badge-danger,
.panel-primary>.panel-heading .badge-warning,
.panel-primary>.panel-heading .badge-info,
.panel-primary>.panel-heading .badge-success {
    border: 1px solid #fff;
    padding: 2px 6px;
}*/ // TODO: CHECK FOR REMOVAL #1442
.unconfirmed-points {
  opacity: 0.6;
}
td.submissions-dropdown {
    text-align:center;
}

td.submissions-dropdown .btn {
    padding: 0px;
}

/* exercise wells */
[data-aplus-exercise] {
    /*border: 1px solid #bce8f1;/*grey #e3e3e3;*/
    border: 1px solid var(--bs-border-color-translucent, #e3e3e3);
    border-radius: 4px;
    -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05);
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
    margin-bottom: 10px;
    min-height: 150px;
}
.navbar-nav>li>a.file-modal {
    display: inline;
    padding: 0;
    text-decoration: underline;
}
.exercise-response {
  padding: 1em 1em 1em 1em;
}
[data-aplus-no-summary] .exercise-summary {
    display: none;
}
.form-inline .form-group div {
    display: inline-block;
}

/* results table */
table.results-table tbody tr:last-child td {
    border-bottom: none;
    border-bottom-left-radius: var(--bs-accordion-inner-border-radius);
    border-bottom-right-radius: var(--bs-accordion-inner-border-radius);
}
table.results-table .category-row {
    font-weight: bold;
}

div.rst-tabs div.html-box {
	padding: 1em;
    border: 1px solid var(--bs-border-color, #dee2e6);
}
