﻿/* ===========================
   Typography & Base
   =========================== */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: 'Nunito Sans', sans-serif;
}

/* ===========================
   Links & Buttons
   =========================== */

a {
    color: #0366d6;
}

    a.navbar-brand {
        white-space: normal;
        text-align: center;
        word-break: break-word;
    }

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* General button tweak on small screens */
@media (max-width: 576px) {
    .btn {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Dark blue button + disabled */
.btn-darkblue,
.btn-darkblue:disabled {
    background-color: #88BB46 !important;
    color: white !important;
    border: none;
    padding: 10px 25px;
}

    .btn-darkblue:disabled {
        color: darkgrey !important;
    }

/* ===========================
   Colors & Theme
   =========================== */

.darkblue {
    color: #00244D !important;
}

.bg-darkblue {
    background-color: #88BB46 !important;
    color: white;
}

/* ===========================
   Inputs & Forms
   =========================== */

.input-box,
.form-control-sm {
    border: 1px solid #00244D !important;
    padding: 10px 25px;
}

input[type=text] {
    width: 250px !important;
}

input[type=button] {
    width: 220px !important;
}

/* ===========================
   Layout, Borders & Spacing
   =========================== */

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

.mainarea-row,
.subarea-row,
.declarationtemplate-row {
    color: black;
    font-size: 13pt;
    font-weight: 300;
    padding: 15px;
}

.declarationtemplate-row {
    border-top: 1px solid whitesmoke;
    margin-top: 25px;
    padding: 25px;
}

/* Footer */

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

/* ===========================
   Print
   =========================== */

@media print {
    .hidden-on-print {
        display: none;
    }
}

/* ===========================
   Loader / Spinner
   =========================== */

.loader,
.spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.5);
}

.loader {
    z-index: 2000;
    display: none;
    cursor: pointer;
}

.loader-hidden {
    display: none;
}

.spinner {
    background-color: black;
    opacity: 0.6;
}

.center-div {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
}

.wheel {
    margin: auto;
    width: 120px;
    height: 120px;
    border: 16px solid #f3f3f3;
    border-radius: 50%;
    border-top: 16px solid #15a0ec;
    border-bottom: 16px solid #15a0ec;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.inner-div {
    background-color: whitesmoke;
    border-radius: 15px;
    margin: auto;
    padding: 2%;
    width: 150px;
}

/* ===========================
   Misc. Helpers
   =========================== */

.mouse-pointer:hover,
.active-pointer:hover,
.active-mouse-item:hover {
    cursor: pointer;
}

.disabled-textarea {
    background-color: whitesmoke;
    border-radius: 5px;
    border: 1px solid lightgray;
}

.statistics-table th:nth-child(n+2) {
    text-align: center !important;
}

.breadcrumb {
    background-color: transparent !important;
    padding: 0 !important;
}

.logo-container {
    position: relative;
    display: inline-block;
}

.delete-logo-button {
    position: absolute;
    top: 0;
    right: 0;
}

.accordion-button {
    font-size: medium;
    font-weight: 500 !important;
    color: black;
}

    .accordion-button:not(.collapsed) {
        background-color: white !important;
    }

.version-info {
    text-align: center;
    font-size: x-small;
    color: lightgray;
}

.highest-radio {
    background-color: lightcyan;
    height: 27px;
    width: 25px;
    border-radius: 20px;
}

#searchbox {
    height: 38px;
}

#searchinput {
    width: 200px;
}

#searchclear {
    position: absolute;
    right: 9px;
    top: 1px;
    bottom: 0;
    margin: auto;
    height: 14px;
    font-size: 14px;
    cursor: pointer;
    color: #ccc;
}

/* ===========================
   Text sizes (declaration)
   =========================== */

/* Tekster i oplæringserklæring */
.level-zero-text .mainarea-text {
    font-size: 14px;
}

.level-one-text .mainarea-text {
    font-size: 14px;
}

.level-two-text .mainarea-text {
    font-size: 14px;
    font-weight: bold;
}

.subarea-text {
    font-size: 13px !important;
    font-weight: normal !important;
}

/* ===========================
   Web Intro Modal
   =========================== */

/* Force modal to be fluid on small screens */
#webIntroModal .modal-dialog.custom-modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Add a bit of margin on ≥576px */
@media (min-width: 576px) {
    #webIntroModal .modal-dialog.custom-modal {
        max-width: 90%;
        margin: 1.75rem auto;
    }
}

/* Desktop widths */
@media (min-width: 992px) {
    #webIntroModal .modal-dialog.custom-modal {
        max-width: 800px;
    }
}

/* ===========================
   Microsoft Login Button
   =========================== */

.microsoft-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

    .microsoft-login-btn img {
        height: 20px;
        width: 20px;
    }

    .microsoft-login-btn:hover {
        background-color: #f3f2f1;
        box-shadow: none;
        text-decoration: none;
        color: #000000;
    }

    .microsoft-login-btn:active {
        background-color: #e1dfdd;
    }

.microsoft-explainer-text {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    color: #6c757d;
    word-wrap: break-word;
}

/* ===========================
   Login Page / Card
   =========================== */

.login-card .form-control {
    width: 100% !important;
}

.login-page-wrapper {
    background: #FFFFFF;
}

.login-card {
    border: 1px solid #e0e0e0;
}

/* ===========================
   Student Photo Frame
   =========================== */

.student-photo-frame {
    display: inline-block;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

    .student-photo-frame img {
        border-radius: 4px;
        display: block;
    }

/* ===========================
   Instructions Box
   =========================== */

/* Desktop/tablet (≥768px) */
#instructionsBox {
    position: fixed;
    max-width: 250px !important;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    #instructionsBox .contents {
        max-height: 250px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #instructionsBox > .bg-darkblue {
        border-radius: 0 0 10px 10px !important;
        padding: 14px 18px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    #instructionsBox h4 {
        font-size: 0.85rem;
        font-weight: 600;
        margin: 0 0 0.25rem;
        color: #ffffff;
        letter-spacing: 0.3px;
    }

    #instructionsBox span.small {
        font-size: 0.8rem;
        line-height: 1.4;
        color: rgba(255, 255, 255, 0.85);
    }

    #instructionsBox > .bg-darkblue:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        transform: translateY(-1px);
    }

    /* Drag header */
    #instructionsBox .drag-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 30px;
        padding: 6px 10px 4px;
        min-width: 250px !important;
        background: #0f1f3a;
        border-radius: 8px 8px 0 0;
    }

    #instructionsBox .drag-handle {
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 3px;
        cursor: grab;
    }

    /* Toggle / collapse */
    #instructionsBox .drag-toggle {
        display: flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.85);
        font-size: 11px;
        line-height: 1;
        user-select: none;
    }

    #instructionsBox .drag-toggle-text {
        font-size: 11px;
    }

    #instructionsBox .drag-collapse {
        border: none;
        background: transparent;
        color: inherit;
        font-size: 11px;
        padding: 0;
        line-height: 1;
    }

    #instructionsBox .drag-toggle:hover {
        color: #ffffff;
    }

    /* Collapsed state */
    #instructionsBox.is-collapsed .contents {
        display: none;
    }

/* Mobile (≤767.98px): full-width bottom bar */
@media (max-width: 767.98px) {
    #instructionsBox {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        width: 100%;
        max-width: none !important;
        min-width: 100%;
        transition: none;
        cursor: default !important;
        border-radius: 0;
    }

        #instructionsBox .drag-header {
            min-width: 0 !important;
            border-radius: 0;
            height: 48px;
            padding: 10px 14px 8px;
        }

        #instructionsBox .drag-handle {
            display: none;
        }

        #instructionsBox .contents {
            max-height: 140px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

    body {
        padding-bottom: 160px;
    }

    #instructionsBox > .bg-darkblue {
        border-radius: 0 !important;
        padding: 12px 16px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    #instructionsBox h4 {
        font-size: 0.8rem;
        margin: 0 0 0.2rem;
    }

    #instructionsBox span.small {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    #instructionsBox > .bg-darkblue:hover {
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
        transform: none;
    }

    html,
    body,
    .app,
    .app-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }
}

/* Hide scroll-to-top button on small screens so it doesn't clash with instructions box */
@media (max-width: 767.98px) {
    .btn-scroll-top {
        display: none !important;
    }
}

/* ===========================
   Responsive Type / Misc
   =========================== */

/* Main area row on narrow screens */
@media screen and (max-width: 600px) {
    .mainarea-row {
        font-size: small;
    }
}

/* ===========================
   Login: Mobile-only Upscale
   =========================== */

/* Make ONLY mobile login view larger */
@media (max-width: 576px) {

    /* makes a control taller on mobile, so it's easier to tap or input into */
    .mobile-large {
        height: 50px !important;
        font-size: x-large !important;
    }

    /* Overall base font size a bit bigger on small screens */
    html,
    body {
        font-size: 17px;
    }

    /* Login wrapper spacing */
    .login-page-wrapper {
        padding-top: 80px !important;
    }

        /* Reduce Bootstrap container gutters for login on mobile */
        .login .container,
        .login-page-wrapper .container {
            padding-left: 8px;
            padding-right: 8px;
        }

        /* Logo a bit larger on mobile */
        .login-page-wrapper img[alt="System logo"] {
            height: 34px !important;
        }

    /* Card: less side padding on small screens */
    .login-card {
        max-width: 100% !important;
        margin: 0;
        padding: 1rem 0.5rem !important;
        font-size: 1.05rem;
    }

        /* Heading */
        .login-card h2,
        .login h2 {
            font-size: 1.8rem;
        }

        /* Inputs */
        .login-card .form-control {
            height: 3rem;
            font-size: 1.05rem;
            padding: 0.65rem 0.9rem;
        }

        /* Primary button */
        .login-card .btn-primary {
            height: 3rem;
            font-size: 1.05rem;
        }

        /* Alt login buttons */
        .login-card .btn-outline-secondary {
            min-height: 2.8rem;
            font-size: 0.95rem;
        }

        /* Small helper text still readable on mobile */
        .login-card .small,
        .login-card small,
        .version-info {
            font-size: 0.9rem;
        }
}
