﻿* {
    box-sizing: border-box;
}

:root {
    --error-background: #fce4e4;
    --error-border: #fcc2c3;
    --error-text: #a94442;
    --max-width: 1024px;
    --text-color: #333;

    /* Z indexes */
    --navbar-z-index: 1;
    --mobile-header-z-index: 1;
    --info-text-button-z-index: 2;
    --popup-z-index: 3;
    --toast-z-index: 4;
    --mobile-menu-overlay-z-index: 10;
}

.orange-bg {
    background-color: lightcoral;
}

.groen-bg {
    background-color: lightgreen;
}

.orange-bg pre,
.groen-bg pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.button-help-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* Adjust spacing as needed */
}

html {
    font-size: 16px;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto Regular', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

#app {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

.nav-link {
    border-top: 3px solid transparent;
    margin-bottom: 3px;
    text-decoration: none;
    color: var(--text-color);
}

.nav-link.active {
    color: #1a80b6;
    border-top-color: #1a80b6;
}

input,
textarea,
select {
    border-radius: 6px;
    border: 1px solid #555;
}

input:focus,
input:active {
    color: #121845;
    border: 1px solid #121845;
}

.validation-message {
    font-size: 1rem;
    color: var(--error-text);
}

table {
    border-spacing: 10px;
}

.upper-case-input {
    text-transform: uppercase;
}

.form-control:focus {
    border-color: #121845;
    color: #777777;
    box-shadow: none;
}

input:focus,
input:active {
    color: #121845;
    border: 1px solid #121845;
}

.form-control::placeholder,
::placeholder {
    color: #CCCCCC;
    opacity: 1;
    /* Firefox */
}

.form-control:-ms-input-placeholder,
:-ms-input-placeholder {
    /* Internet Explorer 10-11 */
    color: #CCCCCC;
}

label {
    display: grid;
    grid-template-columns: minmax(140px, 42.5%) 1fr;
    gap: 0.5rem 1rem;
    align-items: center;
    white-space: normal;
}
legend {
    font-size: 1.2rem;
}

.form-check-input {
    width: 1.5em;
    height: 1.5em;
    margin-top: 0.3em;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    margin-left: 0.5em;
}

/* Ensure form controls can shrink and fill the second column */
label .form-control,
label input,
label select,
label textarea {
    width: 100%;
    min-width: 0;
    /* important so flex/grid can shrink the control */
}

/* Small screens: stack vertically */
@media (max-width: 768px) {
    label {
        grid-template-columns: 1fr;
    }

    label .form-control {
        margin-top: 0.25rem;
    }
}

.invalid {
    border-color: var(--error-text);
}

input[type="radio"] {
    display: none;
    /* Hide the radio input */
}

input[type="radio"]+span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

input[type="radio"]:checked+span {
    border-color: #666;
    color: #222;
    background-color: #e6e6e6;
}

.form-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-radio-label {
    display: block;
    transition: all 0.3s ease;
    margin: 0;
}

.form-radio-label:hover {
    background-color: #e6e6e6;
    border-color: #999;
}

.form-radio-wrapper {
    display: flex;
    gap: 0.5rem;
    max-width: fit-content;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

/* Fonts */

@font-face {
    font-family: "Roboto Regular";
    src: url("../fonts/roboto/Roboto-Regular.ttf");
    font-display: swap;
}

.xml-node {
    margin-left: 20px;
    font-family: monospace;
    white-space: pre;
}

.xml-node>.toggle {
    cursor: pointer;
    margin-right: 5px;
    color: #007acc;
    user-select: none;
}

.indent {
    margin-left: 1.5em;
}


.form-section-content {
    display: grid;
    row-gap: 0.5rem;
}

.ivi-form {
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .ivi-form {
        padding: 0;
    }
}

/* Toast styles */
.cs-toast {
    display: none;
    padding: 1.5rem;
    color: #fff;
    position: absolute;
    width: 25rem;
    top: 2rem;
    border-radius: 1rem;
    right: 2rem;
    z-index: var(--toast-z-index);
}

@media (max-width: 600px) {
    .cs-toast {
        width: 90%;
        right: 5%;
        top: 1rem;
    }
}

.cs-toast-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-left: 1rem;
}

.cs-toast-body p {
    margin-bottom: 0;
}

.cs-toast-visible {
    display: flex;
    flex-direction: row;
    animation: fadein .5s;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.file-upload {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 600px) {
    .file-upload {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Checkbox label styling - overrides default label grid */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    grid-template-columns: unset; /* Reset the default label grid */
}

.checkbox-label input[type="checkbox"] {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #1a80b6;
}

.checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-label span {
    white-space: nowrap;
}