﻿#qvhEventPublicFormContent {
    padding-right: var(--DefaultMainContainerLeftRightPadding);
    padding-left: var(--DefaultMainContainerLeftRightPadding);
}


/* ================================================================
   Allgemeines Formular
   ================================================================ */

#qvhEventPublicForm {
    width: 100%;
    max-width: 1100px;
}

    #qvhEventPublicForm > .form-group {
        margin-bottom: 24px;
    }

        /* Normale Feldbeschriftungen */
        #qvhEventPublicForm > .form-group > .control-label {
            display: block;
            margin: 0 0 6px;
            color: var(--CSSColor);
            font-size: 14px;
            font-weight: 600;
            line-height: 1.4;
        }

    /* Hilfetexte */
    #qvhEventPublicForm .helpTextSmall {
        margin: 3px 0 7px;
        color: #68737d;
        font-size: 13px;
        line-height: 1.4;
    }

    /* Normale Eingabefelder innerhalb dieses Formulars */
    #qvhEventPublicForm > .form-group > .form-control {
        height: 40px;
    }

    /* Textareas nicht durch die globale Höhe beschränken */
    #qvhEventPublicForm textarea.form-control {
        height: auto;
    }

/* Pflichtstern */
.requiredMarker {
    color: #dc3545;
}

/* Validierungsabstand */
#qvhEventPublicForm .text-danger {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.4;
}


/* ================================================================
   Gemeinsame Boxen für Datum und Kategorien
   ================================================================ */

#eventContainer,
#categoryContainer {
    margin: 24px 0 28px;
    padding: 22px;
    overflow: visible;
    border: 1px solid #d9dee3;
    border-radius: 8px;
    background-color: #f8fafb;
}

.eventDateHeader,
.eventCategoryHeader {
    margin-bottom: 18px;
}

.eventDateTitle,
.eventCategoryTitle {
    color: var(--CSSColor);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.eventDateDescription,
.eventCategoryDescription {
    margin-top: 4px;
    color: #68737d;
    font-size: 13px;
    line-height: 1.45;
}

#eventDateItems,
#categoryItems {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* ================================================================
   Datumszeilen
   ================================================================ */

#eventContainer .QVHEventItem {
    position: relative;
    display: grid;
    grid-template-columns: minmax(145px, 1.25fr) minmax(110px, 0.85fr) minmax(110px, 0.85fr) minmax(145px, 1.25fr) 40px;
    gap: 14px;
    align-items: end;
    width: 100%;
    margin: 0;
    padding: 16px;
    clear: none;
    border: 1px solid #e0e5e9;
    border-radius: 7px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(20, 35, 50, 0.04);
}

    /* Ohne Lösch-Button keine leere Spalte */
    #eventContainer .QVHEventItem.hasNoDeleteButton {
        grid-template-columns: minmax(145px, 1.25fr) minmax(110px, 0.85fr) minmax(110px, 0.85fr) minmax(145px, 1.25fr);
    }

    /* Alte Float-Regeln neutralisieren */
    #eventContainer .QVHEventItem .formColumn {
        float: none;
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

.eventDateField {
    min-width: 0;
}

#eventContainer .QVHEventItem label {
    display: block;
    min-height: 19px;
    margin: 0 0 6px;
    padding: 0;
    color: var(--CSSColor);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

#eventContainer .QVHEventItem .form-control {
    width: 100%;
    height: 40px;
    margin: 0;
}


/* ================================================================
   Kategorienzeilen
   ================================================================ */

#categoryContainer .CategoryItem {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 40px;
    gap: 14px;
    align-items: end;
    width: 100%;
    margin: 0;
    padding: 16px;
    clear: none;
    border: 1px solid #e0e5e9;
    border-radius: 7px;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(20, 35, 50, 0.04);
}

    /* Ohne Lösch-Button keine leere Spalte */
    #categoryContainer .CategoryItem.hasNoDeleteButton {
        grid-template-columns: minmax(220px, 1fr);
    }

    /* Alte Float-Regeln neutralisieren */
    #categoryContainer .CategoryItem .formColumn {
        float: none;
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

.eventCategoryField {
    min-width: 0;
}

#categoryContainer .CategoryItem label {
    display: block;
    min-height: 19px;
    margin: 0 0 6px;
    padding: 0;
    color: var(--CSSColor);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

#categoryContainer .CategoryItem .form-control {
    width: 100%;
    height: 40px;
    margin: 0;
}


/* ================================================================
   Lösch-Buttons
   ================================================================ */

.eventDateActions,
.eventCategoryActions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

#eventContainer .eventDeleteEventButton,
#categoryContainer .eventDeleteCategoryButton {
    display: inline-flex;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 5px;
    background-color: transparent;
    color: #74818c;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    #eventContainer .eventDeleteEventButton:hover,
    #categoryContainer .eventDeleteCategoryButton:hover {
        border-color: #efc7c7;
        background-color: #fff3f3;
        color: #b3261e;
    }

    #eventContainer .eventDeleteEventButton:focus,
    #categoryContainer .eventDeleteCategoryButton:focus {
        outline: none;
        border-color: #b3261e;
        box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
    }


/* ================================================================
   Hinzufügen-Buttons
   ================================================================ */

#addNewEventButtonContainer,
#addNewCategoryButtonContainer {
    margin-top: 14px;
    clear: none;
}

#addNewEventButton,
#addNewCategoryButton {
    display: inline-flex;
    min-height: 38px;
    margin: 0;
    padding: 7px 11px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--LinkColor);
    border-radius: 5px;
    background-color: transparent;
    color: var(--LinkColor);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

    #addNewEventButton:hover,
    #addNewCategoryButton:hover {
        border-color: var(--LinkHoverColor);
        background-color: rgba(76, 134, 165, 0.08);
        color: var(--LinkHoverColor);
        text-decoration: none;
    }

    #addNewEventButton:focus,
    #addNewCategoryButton:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(76, 134, 165, 0.16);
    }

    #addNewEventButton i,
    #addNewCategoryButton i {
        font-size: 13px;
    }


/* ================================================================
   Kurzbeschreibung
   ================================================================ */

.previewContentGroup {
    margin-bottom: 24px;
}

.previewContentTextarea {
    min-height: 120px;
    height: auto;
    resize: vertical;
    line-height: 1.5;
}

.previewContentMeta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-top: 5px;
}

    .previewContentMeta .text-danger {
        flex: 1 1 auto;
        margin: 0;
    }

#previewContentCounter {
    flex: 0 0 auto;
    color: #68737d;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

    #previewContentCounter.isNearLimit {
        color: #a66700;
    }

    #previewContentCounter.isAtLimit {
        color: #dc3545;
        font-weight: 600;
    }

/* ================================================================
   Bild-Upload
   ================================================================ */

.eventImageUploadGroup {
    margin-bottom: 24px;
}

    .eventImageUploadGroup .helpTextSmall {
        margin: 3px 0 7px;
        color: #68737d;
        font-size: 13px;
        line-height: 1.4;
    }

#qvhEventPublicForm .eventImageUpload {
    height: auto;
    min-height: 40px;
    padding: 7px 10px;
    cursor: pointer;
}

.eventImagePreviewContainer {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #d9dee3;
    border-radius: 7px;
    background-color: #f8fafb;
}

.eventImagePreview {
    display: block;
    width: auto;
    max-width: 500px;
    max-height: 320px;
    border-radius: 4px;
}


/* ================================================================
   CKEditor
   ================================================================ */

#qvhEventPublicForm .cke {
    width: 100% !important;
    margin-top: 0;
    border: 1px solid #cccccc;
    border-radius: 4px;
    box-shadow: none;
    overflow: hidden;
}

#qvhEventPublicForm .cke_top {
    padding: 6px 8px;
    border-bottom: 1px solid #d8dde2;
    background-color: #f7f8f9;
    box-shadow: none;
}

#qvhEventPublicForm .cke_bottom {
    border-top: 1px solid #d8dde2;
    background-color: #f7f8f9;
    box-shadow: none;
}

#qvhEventPublicForm .cke_contents {
    min-height: 200px;
}


/* ================================================================
   Select2 Organisation
   ================================================================ */

#qvhEventPublicForm .select2-container {
    display: block;
    width: 100% !important;
}

    #qvhEventPublicForm .select2-container .select2-selection--single {
        height: 40px;
        border: 1px solid #cccccc;
        border-radius: 4px;
    }

#qvhEventPublicForm
.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    height: 38px;
    padding-right: 34px;
    padding-left: 12px;
    color: #555555;
    line-height: 38px;
}

#qvhEventPublicForm
.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    width: 32px;
    height: 38px;
}

#qvhEventPublicForm
.select2-container--default.select2-container--focus
.select2-selection--single,
#qvhEventPublicForm
.select2-container--default.select2-container--open
.select2-selection--single {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}


/* ================================================================
   Validierung
   ================================================================ */

#eventContainer .QVHEventItem .input-validation-error,
#categoryContainer .CategoryItem .input-validation-error,
#qvhEventPublicForm .input-validation-error {
    border-color: #dc3545;
}

    #eventContainer .QVHEventItem .input-validation-error:focus,
    #categoryContainer .CategoryItem .input-validation-error:focus,
    #qvhEventPublicForm .input-validation-error:focus {
        border-color: #dc3545;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(220, 53, 69, 0.12);
    }


/* ================================================================
   Senden
   ================================================================ */

#SendButton {
    min-width: 90px;
    margin-top: 4px;
}


/* ================================================================
   Tablet
   ================================================================ */

@media screen and (max-width: 900px) {

    #eventContainer .QVHEventItem,
    #eventContainer .QVHEventItem.hasNoDeleteButton {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

        #eventContainer .QVHEventItem:not(.hasNoDeleteButton) {
            padding-top: 48px;
        }

        #eventContainer .QVHEventItem.hasNoDeleteButton {
            padding-top: 16px;
        }

        #eventContainer
        .QVHEventItem:not(.hasNoDeleteButton)
        .eventDateActions {
            position: absolute;
            top: 8px;
            right: 8px;
            min-height: auto;
        }
}


/* ================================================================
   Mobile
   ================================================================ */

@media screen and (max-width: 600px) {

    #eventContainer,
    #categoryContainer {
        padding: 16px;
    }

        #eventContainer .QVHEventItem,
        #eventContainer .QVHEventItem.hasNoDeleteButton,
        #categoryContainer .CategoryItem,
        #categoryContainer .CategoryItem.hasNoDeleteButton {
            grid-template-columns: 1fr;
            gap: 12px;
        }

            #eventContainer .QVHEventItem:not(.hasNoDeleteButton),
            #categoryContainer .CategoryItem:not(.hasNoDeleteButton) {
                padding-top: 48px;
            }

            #eventContainer .QVHEventItem.hasNoDeleteButton,
            #categoryContainer .CategoryItem.hasNoDeleteButton {
                padding-top: 16px;
            }

            #eventContainer
            .QVHEventItem:not(.hasNoDeleteButton)
            .eventDateActions,
            #categoryContainer
            .CategoryItem:not(.hasNoDeleteButton)
            .eventCategoryActions {
                position: absolute;
                top: 8px;
                right: 8px;
                min-height: auto;
            }

    .eventDateTitle,
    .eventCategoryTitle {
        font-size: 17px;
    }

    #addNewEventButton,
    #addNewCategoryButton {
        width: 100%;
        justify-content: center;
    }

    .previewContentMeta {
        display: block;
    }

    #previewContentCounter {
        margin-top: 5px;
        text-align: right;
    }
}
