@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;300;400;600&display=swap');

/* GLOBAL STYLES */
html, body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background-color: white;
    color: #333;
}

/* LAYOUT-CONTAINER UND SEITENABSCHNITTE */
.section {
    padding: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    margin-right: 320px;
}

/* TEXT(-ABSTÄNDE) */
#result {
    min-height: 5rem;
}

p {
    margin-bottom: 1em;
}

ul {
    margin-bottom: 1em;
    padding-left: 3rem;
    list-style: disc;
}

h1 {
    font-size: 2em;
    margin-bottom: 2rem;
    font-weight: 200;
    color: #666;
    letter-spacing: -.01em;
}

h2 {
    font-size: 1.688rem;
    margin: 3rem 0 1rem;
    font-weight: 300;
}

a {
    color: #6294fd;
    text-decoration: underline;
}

.reduced-gap-bottom {
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
}

/* FORMS */
form .form-group {
    background-color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 0.3rem;
    margin-bottom: 2rem;
}

.form-group h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #333;
}

/* INPUTS & SELECTS */
input[type="radio"] {
    accent-color: black;
}

/* NORMAL SELECT DROPDOWNS */
.control .select,
.select select {
    width: 100%;
}

.select.singleselect {
    position: relative;
}

.select.singleselect select {
    appearance: none;
    padding-right: 2rem;
}

/* Caret for Single- & Multiselect */
.dropdown-caret-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 0.8em;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* Rotation */
.singleselect.open .dropdown-caret-icon,
.multiselect-button.open .dropdown-caret-icon {
    transform: translateY(-50%) rotate(180deg);
}

.select.singleselect.open .singleselect-caret {
    transform: translateY(-50%) rotate(180deg);
}

/* disable bulma styles */
.singleselect::after {
    display: none !important;
}

.control .radio + .radio {
    margin-left: 3rem;
}

.control .select.is-multiple,
.select select[multiple] {
    width: 100%;
}

/* CUSTOM MULTISELECT DROPDOWN */
.custom-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-button {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}

.multiselect-button:hover {
    border-color: #b5b5b5;
}

.multiselect-button.open {
    border-color: #3273dc;
}

.selected-items-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.selected-item-inline {
    background: #e8f4f8;
    border: 1px solid #b8daff;
    border-radius: 3px;
    padding: 0.125rem 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.selected-item-inline .item-text {
    color: #31708f;
}

.selected-item-inline .remove-item {
    background: none;
    border: none;
    color: #31708f;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.selected-item-inline .remove-item:hover {
    background-color: #31708f;
    color: white;
}

.multiselect-placeholder {
    color: #999;
    flex: 1;
    min-width: 0;
}

.multiselect-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Legacy styles for backward compatibility */
.selected-items {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-item {
    background: #e8f4f8;
    border: 1px solid #b8daff;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.selected-item .item-text {
    color: #31708f;
}

.remove-item {
    background: none;
    border: none;
    color: #31708f;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.remove-item:hover {
    background-color: #31708f;
    color: white;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dbdbdb;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dropdown-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #f5f5f5;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.dropdown-option label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-weight: normal;
}

/* LABEL: PFLICHTFELDER */
label.required::after {
    content: " *";
    color: #ce4515;
    /* font-size: 1.5rem; */
}

/* EVENT-OVERVIEW */
.event-overview {
    display: none;
    padding: 2rem;
    border: solid 1px #333;
    margin: 2rem 0;
}

.event-overview > h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.event-overview > ol {
    padding: 0;
    margin: 0;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
    gap: 1rem;
}

.event-item:last-child {
    border-bottom: none;
}

.event-item span {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-all;
    hyphens: auto;
}

/* DELETE-BUTTON / TRASH ICON */
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.trash-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.delete-btn:hover .trash-icon {
    filter: brightness(0.5);
}

/* HILFSKLASSEN */
.hidden {
    display: none !important;
}

/* BUTTON-STYLES (Outline/Solid) */
.action-btn {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
    border: 1px solid black;
    gap: 0.5rem;
}

.action-btn span {
    justify-self: center;
    text-align: center;
}

.action-btn img {
    width: 1.25rem;
    height: 1.25rem;
}

.action-btn.outline {
    background: white;
    color: black;
}

.action-btn.solid {
    background: #ce4515;
    color: white;
}

.action-btn.outline:hover {
    background: #f0f0f0;
}

.action-btn.solid:hover {
    background: #a6340e;
}

button.disabled {
    background-color: #ccc !important;
    color: #666 !important;
    border-color: #aaa !important;
}

button.disabled img {
    filter: brightness(0) !important;
}

/* EVENT-HEADER + BADGE */
.event-header {
    margin: 2rem 0 1.5rem;
}

.event-index-label {
    text-align: right;
    font-size: 1.5rem;
    color: #000;
}

.event-header hr {
    margin: 0;
    height: 2px;
    background-color: #ce4515;
    border: none;
}

.form-header-with-badge {
    display: flex;
    justify-content: space-between;    
    align-items: start;
    margin-bottom: 0.5rem;
}

.event-badge {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #ce4515;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* TOOLTIP (Fragezeichen-Hilfe) */
.tooltip-icon {
    display: inline-block;
    position: relative;
    margin-left: 0.4em;
    border: solid 2px #444;
    background-color: #f5f5f5;
    color: black;
    border-radius: 50%;
    width: 1.2rem;
    height: 1.2rem;
    text-align: center;
    font-size: 0.8em;
    cursor: help;
    line-height: 1.3;
}

.tooltip-text {
    visibility: hidden;
    max-width: min(70vw, 42rem);
    width: max-content;
    background-color: #333;
    color: #fff;
    border-radius: 5px;
    padding: 8px 12px;
    position: absolute;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-left: 1rem;
}

/* Tooltip arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
}

.tooltip-text a:hover {
    color: #ffffff;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
}

/* MODAL / DELETE-CONFIRMATION */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(1px);
}

.modal-box {
    position: relative;
    background: white;
    padding: 2rem;
    max-width: 36rem;
    width: 90%;
    z-index: 51;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    text-align: center;
}

.modal-question {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.modal-title {
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    white-space: normal;
    max-width: 100%;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* CHARACTER COUNT */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.char-count {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

/* FIELD ERROR MESSAGES */
.field-error {
    color: #ce4515;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.field-error:empty {
    display: none;
}

/* REQUIRED FIELD HIGHLIGHTING */
.input.field-invalid, 
.textarea.field-invalid,
.select select.field-invalid,
.input.field-required-invalid, 
.textarea.field-required-invalid,
.select select.field-required-invalid,
.input.field-format-invalid, 
.textarea.field-format-invalid,
.select select.field-format-invalid {
    border-color: #ce4515 !important;
}

.custom-multiselect.field-invalid .multiselect-button,
.custom-multiselect.field-required-invalid .multiselect-button,
.custom-multiselect.field-format-invalid .multiselect-button {
    border-color: #ce4515 !important;
}

/* Radio button highlighting - make only the label text red */
.field.field-invalid input[type="radio"],
.field.field-required-invalid input[type="radio"],
.field.field-format-invalid input[type="radio"] {
    accent-color: #ce4515;
}

.field.field-invalid .control,
.field.field-required-invalid .control,
.field.field-format-invalid .control {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.field.field-invalid input[type="radio"],
.field.field-required-invalid input[type="radio"],
.field.field-format-invalid input[type="radio"] {
    border:2px solid white;
    box-shadow:0 0 0 1px #ce4515;
    appearance:none;
    border-radius:50%;
    width:12px;
    height:12px;
    background-color:#fff;
    transition:all ease-in 0.2s;
}

.field.field-invalid label.radio,
.field.field-required-invalid label.radio,
.field.field-format-invalid label.radio {
    color: #ce4515;
}

/* TABLE OF CONTENTS */
.table-of-contents {
    position: fixed;
    top: 0px;
    right: 20px;
    padding: 1rem;
    width: 280px;
    max-width: 280px;
    z-index: 1000;
    font-size: 0.9rem;
}

.table-of-contents h2 {
    margin: 0 0 0.5rem 0;
    font-size: .9rem;
    font-weight: bold;
    color: #444;
}

.table-of-contents a {
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.3rem;
    transition: all 0.2s ease;
}

.table-of-contents a:hover {
    text-decoration: underline;
    color: #000;
}

.table-of-contents a.active {
    color: #6294fd;
}

.table-of-contents a.active:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .container {
        margin-right: 1.5em;
    }
    
    .table-of-contents {
        display: none;
    }
}
