/* Profilbearbeitung und Frontend-Auth
   Gemeinsame Styles für Profilbearbeitung, Login und Passwort-Reset. */


@font-face {
    font-family: 'Merienda Regular';
    font-style: normal;
    font-weight: 400;
    src: local(''),
    url('/fonts/Merienda-Regular.woff') format('woff');
    font-display: swap;
}

@font-face {
    font-family: 'Merienda Bold';
    font-style: normal;
    font-weight: 700;
    src: local(''),
    url('/fonts/Merienda-Bold.woff') format('woff');
    font-display: swap;
}

.bibel {
    font-family: 'Merienda Regular', cursive, sans-serif;
    font-weight: 400;
}

.bibel_f {
    font-family: 'Merienda Bold', cursive, sans-serif;
    font-weight: 700;
}

/* Erfolgsmeldung nach finaler Veröffentlichung sichtbar halten. */
.profile-edit-success-modal {
    display: block;
    z-index: 1060;
}

/* Stepper */
.profile-edit-stepper {
    width: 100%;
}

.profile-edit-stepper-list {
    position: relative;
}

.profile-edit-stepper-item {
    position: relative;
    min-width: 0;
}

.profile-edit-stepper-content {
    position: relative;
    z-index: 2;
}

.profile-edit-stepper-marker {
    width: 38px;
    height: 38px;
    border: 2px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-weight: 700;
    line-height: 1;
    flex: 0 0 38px;
}

.profile-edit-stepper-label {
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
}

.profile-edit-stepper-item.is-completed .profile-edit-stepper-marker {
    border-color: var(--bs-success);
    background-color: var(--bs-success);
    color: var(--bs-white);
}

.profile-edit-stepper-item.is-completed .profile-edit-stepper-label {
    color: var(--bs-success);
    font-weight: 600;
}

.profile-edit-stepper-item.is-current .profile-edit-stepper-marker {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: var(--bs-white);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.18);
}

.profile-edit-stepper-item.is-current .profile-edit-stepper-label {
    color: var(--bs-primary);
    font-weight: 700;
}

/* Verbindungslinie nur Desktop. */
@media (min-width: 768px) {
    .profile-edit-stepper-list::before {
        content: "";
        position: absolute;
        top: 19px;
        left: 7%;
        right: 7%;
        height: 3px;
        border-radius: var(--bs-border-radius-pill);
        background-color: var(--bs-border-color);
        z-index: 1;
    }

    .profile-edit-stepper-item:first-child .profile-edit-stepper-content {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .profile-edit-stepper-item:last-child .profile-edit-stepper-content {
        align-items: flex-end !important;
        text-align: right !important;
    }
}

/* Mobil unter md: vertikal untereinander. */
@media (max-width: 767.98px) {
    .profile-edit-stepper-list {
        padding-left: 0;
    }

    .profile-edit-stepper-item {
        width: 100%;
    }

    .profile-edit-stepper-label {
        white-space: normal;
        font-size: 1rem;
    }
}

/* TinyMCE Editor */
.tinymce-editor {
    width: 100% !important;
    min-height: 200px;
}

.tox-tinymce {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 767.98px) {
    .tinymce-editor {
        min-height: 100px;
    }
}

/* Step 3: Upload */
.upload-zone {
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    padding: 2rem;
    text-align: center;
}

.upload-zone:hover,
.upload-zone.border-primary {
    border-color: var(--bs-primary);
}

.upload-zone.border-primary {
    background-color: var(--bs-light-bg-subtle, var(--bs-light));
}

.profile-edit-upload-zone {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Verfügbare Dateien */
.asset-grid,
.profile-edit-asset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 100%;
    padding: 0.75rem;
}

/* Verfügbare Dateien: Desktop zeigt ca. 6 Karten, danach wird gescrollt. */
.profile-edit-asset-grid-scroll {
    max-height: 680px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 1rem;
}

/* Zwischenüberschrift nach den Profilbildern. */
.profile-edit-optional-settings-heading {
    margin-top: 0.75rem;
}

.profile-edit-optional-settings-heading h4 {
    font-weight: 600;
}

.asset-item,
.profile-edit-asset-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-edit-asset-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.profile-edit-asset-card.is-selected-single {
    border-color: var(--bs-primary);
}

.profile-edit-asset-card.is-selected-gallery {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-success-rgb), 0.18);
}

.profile-edit-asset-card.is-selected-download {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-dark-rgb), 0.12);
}

.profile-edit-asset-card-preview {
    height: 120px;
    background-color: var(--bs-light-bg-subtle, var(--bs-light));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-edit-asset-card-preview img,
.asset-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-edit-file-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 2.5rem;
}

.profile-edit-file-type-icon {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.92);
    border: var(--bs-border-width) solid var(--bs-border-color);
    color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 0.95rem;
}

.asset-info {
    padding: 0.5rem;
    text-align: center;
}

.asset-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-edit-asset-actions {
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.asset-preview {
    margin-top: 0.5rem;
    min-height: 70px;
}

.profile-edit-remove-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
}

.profile-edit-preview-image {
    max-height: 150px;
    width: auto;
}

/* Einzelbild-Auswahl */
.profile-edit-selected-single {
    max-width: 100%;
}

.profile-edit-selected-single img {
    max-width: 100%;
    height: auto;
}

/* Galerie: bestehende Twig-Bilder und neu per JS hinzugefügte Bilder sehen identisch aus. */
.profile-edit-gallery-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 70px;
}

.profile-edit-gallery-item {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    padding: 0.5rem;
    vertical-align: top;
    cursor: move;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
}

.profile-edit-gallery-item:hover {
    border-color: var(--bs-primary);
}

.profile-edit-gallery-image {
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-preview-item.dragging,
.profile-edit-download-item.dragging {
    opacity: 0.5;
}

/* Downloads */
.profile-edit-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 55px;
}

.profile-edit-download-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: move;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    padding: 0.55rem 0.75rem;
}

.profile-edit-download-item:hover {
    border-color: var(--bs-primary);
}

.profile-edit-download-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background-color: var(--bs-light-bg-subtle, var(--bs-light));
    border: var(--bs-border-width) solid var(--bs-border-color);
    color: var(--bs-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.profile-edit-download-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Login / Passwortseiten */
.auth-page {
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-card-login {
    max-width: 400px;
}

.auth-honeypot {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}


/* Mobile Aktionsleisten: unter md einspaltig, ab md wieder wie Bootstrap-Layout definiert. */
.profile-edit-actions {
    width: 100%;
}

.profile-edit-actions .profile-edit-action-button,
.profile-edit-actions .profile-edit-action-form {
    width: 100%;
}

.profile-edit-actions .profile-edit-action-form .profile-edit-action-button {
    width: 100%;
}

.profile-edit-header-action {
    width: 100%;
}

@media (min-width: 768px) {
    .profile-edit-actions .profile-edit-action-button,
    .profile-edit-actions .profile-edit-action-form,
    .profile-edit-actions .profile-edit-action-form .profile-edit-action-button,
    .profile-edit-header-action {
        width: auto;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .asset-grid,
    .profile-edit-asset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .asset-grid,
    .profile-edit-asset-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile zeigt ca. 3 Karten, danach wird gescrollt. */
    .profile-edit-asset-grid-scroll {
        max-height: 980px;
    }

    .asset-item img {
        height: 150px;
    }

    .profile-edit-gallery-list {
        flex-direction: column;
    }

    .profile-edit-gallery-item {
        width: 100%;
        height: auto;
        min-height: 140px;
    }

    .profile-edit-gallery-image {
        max-height: 120px;
    }

    .profile-edit-download-item {
        align-items: flex-start;
    }

    .profile-edit-download-name {
        white-space: normal;
    }
}

/* Profile-Edit Paket 2: klickbarer Stepper, Vorschau-Check und verbesserte Medien-UI. */
.profile-edit-stepper-link {
    color: inherit;
}

.profile-edit-stepper-link:hover .profile-edit-stepper-marker,
.profile-edit-stepper-link:focus .profile-edit-stepper-marker {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.16);
}

.profile-edit-stepper-item.is-open .profile-edit-stepper-marker {
    border-color: var(--bs-warning);
    background-color: var(--bs-warning-bg-subtle, var(--bs-warning));
    color: var(--bs-dark);
}

.profile-edit-stepper-item.is-open .profile-edit-stepper-label {
    color: var(--bs-warning-text-emphasis, var(--bs-warning));
    font-weight: 600;
}

.profile-edit-stepper-item.is-disabled {
    opacity: 0.55;
}

.profile-edit-stepper-item.is-disabled .profile-edit-stepper-content {
    cursor: not-allowed;
}

.profile-edit-check-card {
    border-radius: var(--bs-border-radius-lg);
}

.profile-edit-check-item.is-valid .profile-edit-check-icon {
    color: var(--bs-success);
}

.profile-edit-check-item.is-invalid .profile-edit-check-icon {
    color: var(--bs-warning);
    font-weight: 700;
}

/* Layout-Step: ruhige Mini-Vorschauen wie im Article-Edit. */
.profile-edit-layout-box {
    align-items: center;
    background: #fff;
    border: 1px dashed rgba(0, 0, 0, .25);
    border-radius: .5rem;
    display: flex;
    font-size: .85rem;
    justify-content: center;
    min-height: 3.5rem;
    padding: .5rem;
}

/* Inhaltsverzeichnis-Vorschau: kurze Balken statt beschrifteter Boxen. */
.profile-edit-layout-box-small {
    min-height: .75rem;
    padding: 0;
}

.profile-edit-selection-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-edit-selection-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.75rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
}

.profile-edit-selection-summary-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-edit-selection-summary-item.has-value {
    border-color: rgba(var(--bs-success-rgb), 0.55);
}

.profile-edit-selection-summary-item.is-empty {
    background-color: var(--bs-light-bg-subtle, var(--bs-light));
}

.profile-edit-asset-tools .form-label {
    font-weight: 600;
}

.profile-edit-upload-zone.is-uploading {
    opacity: 0.7;
    cursor: progress;
}

.profile-edit-upload-zone.is-uploading::after {
    content: "Upload läuft …";
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--bs-primary);
}

@media (max-width: 991.98px) {
    .profile-edit-selection-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .profile-edit-selection-summary {
        grid-template-columns: 1fr;
    }
}
