@font-face {
  font-family: "Ubuntu Condensed";
  src:
    local("Ubuntu Condensed"),
    url("fonts/ubuntu/UbuntuCondensed-Regular.ttf");
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Ubuntu Condensed", Arial, Verdana, sans-serif;
    font-size: 25px;
    text-align: center;
    background-color: #191e35;
}

p, h1, h2, h3, form, a, table, input.submitButton, ul, li {
    color: #ffffff;
}

/* ==========================================================================
   Layout
   ========================================================================== */

#content {
    min-height: 50vh;
    margin: 0 auto;
    padding: 30px;
    max-width: 800px;
}

#content p {
    margin: 0 auto;
    text-align: justify;
}

#content p.alignCenter {
    text-align: center;
}

#header {
    margin: 25px auto 35px;
}

#footer {
    margin: 50px auto 30px;
    width: 90%;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

#notificationTop {
    padding: 5px 0;
    background-color: orange;
    color: black;
}

#contentNotification {
    border: 2px solid #a64f9d;
    padding: 2px 20px;
    margin: 0 auto 20px;
    border-radius: 10px;
    max-width: fit-content;
    color: black;
}

/* ==========================================================================
   Images
   ========================================================================== */

img.logo {
    display: block;
    max-width: 15%;
    margin: 0 auto;
}

img.tableIcon {
    height: 25px;
    max-width: 25px;
}

img.languageFlag {
    width: 60px;
    height: 30px;
}

img.ntnuLogo {
    height: 50px;
    margin: 10px;
}

img.sintefLogo {
    height: 75px;
    margin: 10px;
}

/* ==========================================================================
   Links
   ========================================================================== */

a:hover {
    text-decoration: underline;
}

a.headerLink {
    margin: 40px 20px 30px;
    font-size: 30px;
    font-weight: bolder;
    text-decoration: none;
}

a.redNeedsAttention {
    color: #c62828;
    font-weight: bold;
}

/* ==========================================================================
   Inputs
   ========================================================================== */

input {
    min-height: 25px;
    border-radius: 15px;
    padding: 6px;
    margin-bottom: 15px;
}

input.submitButton, button.submitButton {
    margin-top: 10px;
    font-size: 20px;
    border-radius: 12px;
    min-height: 30px;
    min-width: 100px;
    background-color: #a64f9d;
    padding: 5px 20px;
    border-color: #a64f9d;
    color: white;
}
.submitButton:hover {
    background-color: #2980b9;
}

/* ==========================================================================
   Lists
   ========================================================================== */

li {
    max-width: 95%;
}

/* ==========================================================================
   Tables
   ========================================================================== */

#consented-meters-table {
    margin: 0 auto 35px;
    max-width: 70%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    border: 1px solid #206797;
}

#consented-meters-table thead th {
    font-weight: 600;
    font-size: 0.8em;
    padding: 12px 15px;
    border: none;
    text-align: left;
    background-color: #206797;
    border: none;
}

#consented-meters-table thead th:first-child {
    border-radius: 10px 0 0 0;
}

#consented-meters-table thead th:last-child {
    border-radius: 0 10px 0 0;
}

#consented-meters-table tbody td {
    padding: 15px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #206797;
    vertical-align: middle; /* Key for aligning items in the cell */
}
#consented-meters-table tbody tr:last-child td {
    border-bottom: none;
}




/* ==========================================================================
   Forms
   ========================================================================== */

.formContainer {
    margin: 0;
    padding: 20px;
    background: #222945;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    line-height: 1.2;
    color: #ffffff;

    h1, h2, h3, p, li, div, label {
        color: #ffffff;
    }
    .formGroup {
        margin-bottom: 15px;
        margin-top: 15px;
    }
    .question {
        font-weight: bold;
        margin-bottom: 5px;
    }
    .options {
        margin-left: 20px;
    }
    .nested {
        margin-left: 20px;
        margin-top: 10px;
        padding-left: 20px;
        border-left: 1px solid #ddd;
    }
    label {
        display: block;
        margin-bottom: 5px;
    }
    input[type="text"], textarea {
        max-width: 80%;
        min-width: 50%;
    }
    input[type="number"] {
        max-width: 80%;
    }
    input[type="text"], input[type="number"], textarea {
        padding: 8px;
        margin: 5px;
        border: 1px solid #ddd;
        border-radius: 15px;
    }
    input.narrowInput {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }
    input[type="radio"], input[type="checkbox"] {
        margin-right: 10px;
    }
    button {
        background-color: #a64f9d;
        color: white;
        padding: 10px 15px;
        border: none;
        border-radius: 12px;
        cursor: pointer;
    }
    button:hover {
        background-color: #2980b9;
    }
    .hidden {
        display: none;
    }
    .inputWrapper {
        position: relative;
        display: inline-block;
    }
    .inputWrapper input {
        min-width: 6ch;
        max-width: 75%;
        box-sizing: border-box;
    }
    .inputWrapper input.invalid {
        border: 2px solid #e67e22;
        background-color: #fef5e8;
    }
    .validationBubble {
        display: none;
        position: absolute;
        bottom: calc(100% + 5px);
        left: 50%;
        transform: translateX(-50%);
        background-color: #e67e22;
        color: white;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 10;
    }
    .validationBubble::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: #e67e22;
    }
    .inputWrapper input.invalid + .validationBubble {
        display: block;
    }
    button:disabled {
        background-color: #bdc3c7;
        cursor: not-allowed;
    }

    .statusInfo {
        margin: 3px 0;
        padding: 10px;
        border-radius: 4px;
        font-weight: bold;
        color: #ffffff;
        display: flex;
    }

    .statusInfo[hidden] {
        display: none;
    }

    .statusInfo.error {
        background-color: #ffebee;
        color: #c62828;
        border: 1px solid #ffcdd2;
    }

    .statusInfo.loading {
        align-items: center;
    }

    .spinnerInfo {
        display: inline-block;
    }

    .spinnerInfo.loading {
        align-items: center;
    }

    .spinner {
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255, 255, 255, 0.25);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

    select, option {
        max-width: 90%;
        height: 2.5em;
        color: black;
    }

    #addressSearch {
        align-items: center;
        width: 98%;
    }

    #candidateAddressForm {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* Bruksenhet format switch (radio pair) */
    .bruksenhetFormatSwitch {
        display: flex;
        gap: 15px;
        margin-bottom: 10px;
        margin-left: 10px;
    }
    .bruksenhetFormatSwitch label {
        display: inline-flex;
        align-items: center;
        margin-bottom: 0;
        cursor: pointer;
    }
    .bruksenhetFormatSwitch input[type="radio"] {
        margin-right: 5px;
    }
    .bruksenhetFormatSwitch input[type="radio"]:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    #bruksenhet-search:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    /* Matrikkel dropdown */
    .matrikkelDropdown {
        min-width: 60%;
        max-width: 90%;
    }

    /* Bruksenhet combobox (search + select in a single field) */
    .bruksenhetCombobox {
        position: relative;
        display: inline-block;
        min-width: 50%;
        max-width: 90%;
        margin-left: 10px;
        margin-right: 10px;
        margin-bottom: 10px;
    }
    .bruksenhetCombobox > input[type="text"] {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    #bruksenhetDropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        max-height: 200px;
        overflow-y: auto;
        z-index: 20;
        width: 100%;
    }
    .bruksenhetOption {
        padding: 8px 10px;
        cursor: pointer;
        color: black;
    }
    .bruksenhetOption:hover {
        background-color: #eef2f7;
    }

    /* ==========================================================================
    Tooltips
    ========================================================================== */
    /* Tooltip container */
    .tooltip {
        position: relative;
        display: inline-block;
        text-decoration: underline dotted;
        cursor: pointer;
        width: 100%;
    }

    /* Tooltip text */
    .tooltiptext {
        visibility: hidden; /* Hidden by default */
        min-width: 50%;
        background-color: black;
        color: #ffffff;
        text-align: center;
        padding: 10px 0;
        border-radius: 6px;
        position: absolute;
        z-index: 1; /* Ensure tooltip is displayed above content */
    }

    /* Show the tooltip text on hover */
    .tooltip:hover .tooltiptext {
        visibility: visible;
    }

}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Palette reference: kept intentionally as a colour reference. Not applied
   to any element; do not remove as dead code.
   ========================================================================== */

.sbhub_website_colours {
    background-color: #191e35;
    color: #ffffff;
}

.sbhub_logo_colours {
    color: #05304D;
}

/* ==========================================================================
   Markdown content
   ========================================================================== */

.largeTextFromMarkdown {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 20px;
    line-height: 1.2;
    text-align: justify;
}

.largeTextFromMarkdown h1,
.largeTextFromMarkdown h2,
.largeTextFromMarkdown h3 {
    margin: 1.5em 0 0.8em;
    line-height: 1.3;
    text-align: center;
}

.largeTextFromMarkdown p {
    padding: 10px 0;
    text-align: justify;
}

.largeTextFromMarkdown ul,
.largeTextFromMarkdown ol {
    margin: 1.2em 0;
    padding-left: 1.5em;
    text-align: justify;
}

.largeTextFromMarkdown li {
    line-height: 1.1;
    text-align: justify;
}

.largeTextFromMarkdown a {
    color: #a64f9d;
    text-decoration: underline;
}

.largeTextFromMarkdown a:hover {
    color: #ff6b9d;
}

.largeTextFromMarkdown blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #a64f9d;
    background-color: rgba(166, 79, 157, 0.1);
    font-style: italic;
}

.largeTextFromMarkdown code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.largeTextFromMarkdown pre {
    overflow: auto;
    padding: 1em;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    margin: 1.5em 0;
}

.largeTextFromMarkdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em auto;
    font-size: 16px;
}


.largeTextFromMarkdown table,
.largeTextFromMarkdown tr,
.largeTextFromMarkdown td,
.largeTextFromMarkdown thead,
.largeTextFromMarkdown tbody,
.largeTextFromMarkdown th {
    border: none;
    background-color: #191e35;
}


.largeTextFromMarkdown th,
.largeTextFromMarkdown td {
    padding: 0.8em;
    text-align: left;
    padding-left: 25px;
}

.largeTextFromMarkdown th {
    font-weight: bold;
}

/* ==========================================================================
   Password mismatch bubble
   ========================================================================== */

#userWarningBubble {
    display: inline-block;
    background-color: #c62828;
    color: #ffffff;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 18px;
    margin-top: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .largeTextFromMarkdown {
        padding: 15px;
        font-size: 16px;
    }

    .largeTextFromMarkdown h1 {
        font-size: 1.8em;
    }

    .largeTextFromMarkdown h2 {
        font-size: 1.5em;
    }

    .largeTextFromMarkdown h3 {
        font-size: 1.3em;
    }

    .largeTextFromMarkdown p,
    .largeTextFromMarkdown li {
        font-size: 16px;
        line-height: 1.5;
    }

    .largeTextFromMarkdown table {
        font-size: 14px;
    }

    .largeTextFromMarkdown th,
    .largeTextFromMarkdown td {
        padding: 0.5em;
    }
}

@media (max-width: 480px) {
    .largeTextFromMarkdown {
        padding: 10px;
        font-size: 14px;
    }

    .largeTextFromMarkdown h1 {
        font-size: 1.5em;
    }

    .largeTextFromMarkdown h2 {
        font-size: 1.3em;
    }

    .largeTextFromMarkdown h3 {
        font-size: 1.2em;
    }
}
