:root {
    --sco-max-width: 1200px;
    --sco-color-background: rgb(242, 242, 238);
    --sco-color-box-ok-bg: rgb(198, 255, 171);
    --sco-color-box-error-bg: rgb(253, 248, 201);
    --sco-color-box-error-fg: rgb(219, 0, 0);
    --sco-color-info-bg: rgb(255, 247, 138, 0.85);
    --sco-color-link: #007BFF;
    --sco-mini-photo-ens-size: 90px
}

body {
    background-color: var(--sco-color-background);
    font-family: "Domine", Georgia, Times, "Times New Roman", serif;
    font-size: 14pt;
    margin: 0;
    padding: 0;
}

.app-container {
    max-width: var(--sco-max-width);
    background-color: white;
    margin: 0 auto;
    position: relative;
}

header {
    display: grid;
    justify-content: center;
    margin-bottom: 16px;
}

div.autosco-content {
    max-width: var(--sco-max-width);
}

div.titre1 {
    margin-top: 16px;
    margin-bottom: 12px;
    font-size: 1.5em;
    font-weight: bold;
}

header.app-header {
    max-width: var(--sco-max-width);
    margin: 0 auto 0 0;
    position: relative;
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background-color: white;
}

div.app-logos img {
    height: 80px;
}

.logo-univ {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.logo-autosco {
    margin: 0 auto;
}

.user-info {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    white-space: nowrap;
}

.user-info .user-name {
    margin-bottom: 5px;
}

.logged .user-name {
    font-weight: bold;
}

.user-name a,
.user-name a:visited {
    color: red;
    text-decoration: dotted;
}

.logged a {
    text-decoration: underline;
    font-size: 80%;
}

.app-link,
.app-link:visited {
    color: var(--sco-color-link);
}

.app-link:hover {
    text-decoration: underline;
    color: red;
}

.logout-link {
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}


.app-content {
    padding: 0 8px 12px 8px;
}

footer.app-footer {
    font-size: 80%;
    margin-top: 32px;
    margin-left: 8px;
    padding-bottom: 8px;
}

footer.app-footer span:first-child {
    margin-right: 8px;
}

footer.app-footer a.app-link,
footer.app-footer a.app-link:visited {
    color: black;
}

footer.app-footer a.app-link:hover {
    text-decoration: underline;
    color: red;
}

/* Mobile layout */
@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        align-items: center;
        position: static;
        width: 100%;
    }

    div.app-logos img {
        height: 50px;
    }

    div.app-logos {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        position: static;
        width: 100%;
        gap: 2rem;
        /* space between the logos */
    }

    .logo-univ,
    .user-info {
        position: static;
        transform: none;
        margin-top: 10px;
    }


    .logo-autosco {
        margin-top: 10px;
    }

    .user-info {
        align-items: center;
        text-align: center;
    }
}

.centered-description {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.25rem;
}

.centered-description>* {
    max-width: 100%;
    /* prevent child from overflowing */
    word-break: break-word;
}


/* Affichage des cours pour listes, avec photo à gauche */
.sem-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    /* spacing between image and content */
}

div.sem-container div.mini-photo-ens {
    width: var(--sco-mini-photo-ens-size);
    height: var(--sco-mini-photo-ens-size);
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: 8px;
    border-radius: 8px;
}

div.sem-container div.mini-photo-ens img {
    width: var(--sco-mini-photo-ens-size);
    height: var(--sco-mini-photo-ens-size);
    object-fit: cover;
}

div.sem {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
}

div.sem {
    margin-top: 8px;
}

div.sem-container.ouvert {
    background-color: var(--sco-color-box-ok-bg);
}

div.sem-container.ferme {
    background-color: rgb(208, 208, 208);
}

div.sem-container.demande {
    background-color: rgb(204, 240, 255);
}

div.sem-container.wip {
    background-color: rgb(255, 255, 108);
}

div.sem-container.wip div.wip {
    font-style: italic;
    font-size: 80%;
    color: red;
}

div.boite-inscription div {
    margin-top: 8px;
}

div.boite-inscription.sem.ferme {
    color: white;
    background-color: rgb(228, 60, 60);
}

.sem a {
    text-decoration: underline dotted;

}

.sem a:hover {
    text-decoration: underline solid;
    color: red;
}

div.titre {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 12px;
}

div.titre a,
div.titre a:visited {
    color: var(--sco-color-link);
    text-decoration: none;
}

div.titre a:hover {
    text-decoration: underline;
    color: red;
}

div.responsable {
    font-style: italic;
    margin-top: 16px;
    margin-bottom: 16px;
}

.photo-ens img {
    height: 200px;
    margin-top: 8px;
    margin-bottom: 8px;
    max-width: 100%;
}

div.formbox {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 8px;
    background-color: var(--sco-color-box-ok-bg);
}

div.formbox form div {
    margin-top: 12px;
}

div.formbox a,
div.formbox a:visited {
    text-decoration: underline dotted;
    color: #025AA7;
}

div.formbox.error-msg {
    border: 1px solid var(--sco-color-box-error-fg);
    background-color: var(--sco-color-box-error-bg);
    color: var(--sco-color-box-error-fg);
    margin-top: 12px;
    margin-bottom: 12px;
}

div.formbox.error-msg>div {
    margin-bottom: 12px;
}

div.info-message {
    border: 1px solid #ccc;
    background-color: var(--sco-color-info-bg);
    padding: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
}

span.numero {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3em;
    font-weight: bold;
    color: #5a02a7;
}

div.flashed-messages {
    position: fixed;
    width: 100%;
    max-width: 600px;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--sco-color-info-bg);
    color: green;
    border: 1px solid darkblue;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 1000;
    /* stay on top of everything */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 1.3em;
    text-align: center;
    animation: fadeOut 5s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    99% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}


.vspaced {
    margin-top: 18px !important;
    margin-bottom: 18px !important;
}

.space-before-8 {
    margin-top: 8px !important;
}

.space-before-18 {
    margin-top: 18px !important;
}

.space-before-24 {
    margin-top: 24px !important;
}

.space-after-24 {
    margin-bottom: 24px !important;
}

div.scobox.maxwidth {
    max-width: none;
}

div.scobox {
    flex: 1 0 0;
    /* Equal width for all boxes */
    max-width: var(--sco-content-max-width);
    /* margin: 5px; Optional: Add margin between boxes */

    background-color: var(--sco-color-box-bg);
    margin-top: 12px;
    margin-bottom: 12px;
    margin-right: 12px;
    padding: 8px;
    border: 1px solid #c5b4b2;
    border-radius: 8px;
}

div.scobox.explanation {
    background-color: var(--sco-color-background);
    border: 1px dashed #333;
}

div.scobox.success div.scobox-title {
    color: white;
    background-color: darkgreen;
}

div.scobox.failure div.scobox-title {
    color: white;
    background-color: #c50000;
}

div.scobox div.scobox-title {
    font-size: 120%;
    font-weight: bold;
    margin-bottom: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
}

div.scobox>div {
    padding-left: 8px;
}

p.warning {
    color: red;
    font-weight: bold;
    font-size: 1.2em;
}

.button a {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007BFF;
    /* Bootstrap-style blue */
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-family: sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button a:hover {
    background-color: #0056b3;
    /* darker blue on hover */
    text-decoration: none;
}