/*******************************************
    * TCMSoft Popover  *
    *******************************************/

.tcm-popover {
    display: flex;
    flex-direction: column;
}

    .tcm-popover .k-popover-body {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 0; /* Entfernt Standard-Padding um Platz zu sparen */
    }

        /* Stellt sicher, dass der innere Content (BibliothekViewer) die volle Höhe nutzt */
        .tcm-popover .k-popover-body > div {
            height: 100%;
            overflow-y: auto; /* Erlaubt Scrollen im Popover */
            overflow-x: hidden;
        }

/*******************************************
    * TCMSoft Content Wrapper  *
*/

.tcm-content-wrapper {
    padding: 1rem;
    line-height: 1.6;
    color: #333;
}

    .tcm-content-wrapper a[href^="docid://"],
    .tcm-content-wrapper a[href^="recipe://"] {
        color: #0066cc;
        text-decoration: underline;
        cursor: pointer;
    }

        .tcm-content-wrapper a[href^="docid://"]:hover,
        .tcm-content-wrapper a[href^="recipe://"]:hover {
            color: #0052a3;
            background-color: #f0f0f0;
            border-radius: 3px;
            padding: 2px 4px;
            transition: all 0.2s ease;
        }


    /* Media-Links Styling */
    .tcm-content-wrapper a[data-media] {
        display: inline-block;
        cursor: pointer;
        position: relative;
    }

        .tcm-content-wrapper a[data-media]:hover {
            opacity: 0.85;
            transform: scale(1.02);
            transition: all 0.2s ease;
        }

        .tcm-content-wrapper a[data-media] img {
            max-width: 100%;
            height: auto;
            display: block;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }


/********************************
    Media Overlay Container 
    (bleibt innerhalb des bibliothekviewer)
********************************/

/* Wichtig: bibliothekviewer muss position relative sein für absolute positioning */
#bibliothekviewer {
    position: relative;
}

.tcm-media-overlay {
    position: absolute;
    inset: 0; /* Top, Right, Bottom, Left = 0 - füllt das ganze bibliothekviewer */
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    animation: fadeIn 0.2s ease-in forwards;
    overflow: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

.tcm-media-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
    animation: scaleIn 0.2s ease-out;
    flex-shrink: 0;
    padding: 1rem;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}

    .tcm-media-container img,
    .tcm-media-container video,
    .tcm-media-container iframe {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        width: auto;
        height: auto;
        display: block;
    }

.tcm-media-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    color: #333;
}

    .tcm-media-close:hover {
        background: #f0f0f0;
        transform: scale(1.1);
    }

    .tcm-media-close:active {
        transform: scale(0.95);
    }

    .tcm-media-close:focus {
        outline: 2px solid #0066cc;
        outline-offset: 2px;
    }

/* Animationen */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/*******************************************
    * TCMSoft Custom Classes  *
********************************************/
.tcm-container {
    margin: 0 auto;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box
}

.tcm-top-heading {
    width: 100%;
    margin-bottom: 2em;
}

.tcm-image-container {
    float: right;
    display: flow-root;
    gap: 1em;
    flex-flow: row wrap;
    box-sizing: border-box
}

.tcm-image-container > img {
    height: 100px;
}


.tcm-chip-0 {
    border: 1px solid #666666;
    color: #666666;
    background-color: rgba(102, 102, 102, 0.15); /* 15% Deckkraft */
    border-radius: 4px;
    margin-right: 0.5em;
    padding: 0.1em 0.5em;
    display: inline-block;
}

.tcm-chip-1 {
    border: 1px solid #009900;
    color: #009900;
    background-color: rgba(0, 153, 0, 0.15); /* 15% Deckkraft */
    border-radius: 4px;
    margin-right: 0.5em;
    padding: 0.1em 0.5em;
    display: inline-block;
}

.tcm-chip-2 {
    border: 1px solid #ff6600;
    color: #ff6600;
    background-color: rgba(255, 102, 0, 0.15); /* 15% Deckkraft */
    border-radius: 4px;
    margin-right: 0.5em;
    padding: 0.1em 0.5em;
    display: inline-block;
}

.tcm-chip-3 {
    border: 1px solid #ff0000;
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.15); /* 15% Deckkraft */
    border-radius: 4px;
    margin-right: 0.5em;
    padding: 0.1em 0.5em;
    display: inline-block;
}

.tcm-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.tcm-table th,
.tcm-table td {
    padding: 8px; /* Innenabstand für bessere Lesbarkeit */
    text-align: left;
    vertical-align: top;
}

/* Überschriftenzeile */
.tcm-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Abwechselnde Hintergrundfarbe für Zeilen */
.tcm-table tr:nth-child(even) {
    background-color: #f9f9f9; /* Leichtes Grau für gerade Zeilen */
}


.spalte-auto {
    width: min-content; /* So klein wie möglich, basierend auf Inhalt */
    white-space: nowrap; /* Verhindert Umbrüche */
}

/* ─── Dashboard KPI Tiles ─────────────────────────────────────────────────── */

.kpi-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.25rem;
}

.kpi-tile-title {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    line-height: 1.3;
}

.kpi-tile-value {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

