/* Lunasima Font */
@font-face {
    font-family: 'Lunasima';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/lunasima/Lunasima-Regular-EED8zms.ttf") format('truetype');
}

@font-face {
    font-family: 'Lunasima';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/lunasima/Lunasima-Bold-SkoLLeS.ttf") format('truetype');
}

/* Apply Lunasima as default font */
body {
    font-family: 'Lunasima', sans-serif;
}

/* Konfigurierbare Max-Width für Backend-Form-Cards (keine Inline-Styles) */
:root {
    --backend-form-card-max-width: 1600px;
}

.backend-form-card {
    width: 100%;
    max-width: min(96vw, var(--backend-form-card-max-width));
}

.cursor-pointer {
    cursor: pointer;
}

/* Portal: mehr nutzbare Breite auf großen Viewports (Bootstrap-.container endet bei 1320px) */
.app-layout-container {
    max-width: min(96vw, 1680px);
    margin-left: auto;
    margin-right: auto;
}

/* Address Autocomplete Styles */
.address-autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.25rem;
}

.address-autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease-in-out;
}

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

.address-autocomplete-item:hover,
.address-autocomplete-item.active {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.address-autocomplete-item:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.address-autocomplete-item:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Ensure form fields with autocomplete have relative positioning */
.form-group:has([data-address-field]),
.mb-3:has([data-address-field]) {
    position: relative;
}

/* ── Backend-Layout: Sidebar + Content ─────────────────────────── */
.backend-layout {
    min-height: calc(100vh - 58px); /* 58px = Bootstrap navbar height */
}

.backend-sidebar {
    width: 220px;
    min-width: 220px;
    position: sticky;
    top: 0;
    height: calc(100vh - 58px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.backend-sidebar-inner {
    padding: 0.75rem 0 0;
}

.backend-sidebar-section {
    padding: 0.6rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6c757d;
    margin-top: 0.5rem;
}

.backend-nav-link {
    display: block;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.1s ease, color 0.1s ease;
    border-left: 3px solid transparent;
}

.backend-nav-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    text-decoration: none;
}

.backend-nav-link.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 600;
    border-left-color: #0d6efd;
}

.backend-nav-sub {
    padding-left: 0.5rem;
}

.backend-nav-sub .backend-nav-link {
    padding-left: 2.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.backend-nav-sub .backend-nav-link:hover {
    color: #0d6efd;
}

.backend-nav-sub .backend-nav-link.active {
    color: #0d6efd;
    font-weight: 600;
    background-color: #e7f1ff;
    border-left-color: #0d6efd;
}

.backend-content {
    min-width: 0;
}

@media (max-width: 767.98px) {
    .backend-sidebar {
        display: none;
    }
    .backend-content {
        width: 100%;
    }
}

/* ── Tierbuch: Bild-Dropzone */
.image-dropzone {
    cursor: pointer;
    min-height: 10rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.image-dropzone.is-dragover {
    border-style: solid !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.image-upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.image-upload-preview__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--bs-success-border-subtle, #a3cfbb);
    border-radius: 0.75rem;
    background: var(--bs-success-bg-subtle, #d1e7dd);
}

.image-upload-preview__item.is-invalid {
    border-color: var(--bs-danger-border-subtle, #f1aeb5);
    background: var(--bs-danger-bg-subtle, #f8d7da);
}

.image-upload-preview__visual {
    display: grid;
    place-items: center;
    flex: 0 0 4.5rem;
    width: 4.5rem;
    height: 4.5rem;
    overflow: hidden;
    color: var(--bs-danger, #dc3545);
    font-size: 1.75rem;
    font-weight: 700;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.75);
}

.image-upload-preview__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-preview__details {
    min-width: 0;
}

/* ── DataManager ────────────────────────────────────────────────────────── */
.dm-layout {
    min-height: 480px;
    max-height: calc(100vh - 160px);
}

.dm-list-pane {
    width: 35%;
    min-width: 200px;
    max-width: 320px;
}

.dm-detail-pane {
    background: #fff;
}

.dm-list {
    min-height: 0;
}

.dm-list-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    outline: none;
    transition: background-color 0.1s;
}

.dm-list-item:hover {
    background-color: #f8f9fa;
}

.dm-list-item.active {
    background-color: #e7f1ff;
    border-left: 3px solid #0d6efd;
}

.dm-list-primary {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-list-secondary {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .dm-layout {
        flex-direction: column;
        max-height: none;
    }
    .dm-list-pane {
        width: 100%;
        max-width: 100%;
        max-height: 240px;
    }
}

/* Öffentliches Tierbuch: Symbolgrafiken auf der Backend-Übersicht */
.tierbuch-public-visual-card .tierbuch-visual__svg svg {
    width: 4.75rem;
    height: 4.75rem;
}

.tierbuch-public-visual-card .tierbuch-visual {
    border-radius: 0.5rem;
    padding: 0.35rem;
    background-color: var(--bs-secondary-bg);
}
