﻿.layout-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Abstand zwischen Items */
    margin-bottom: 30px; /* Abstand unterhalb des Containers */
}

.layout-container-item {
    /*flex: 1 1 calc(33.33% - 20px);*/  /* 3 Items pro Reihe, mit Abstand */
    flex: 1 1 calc(20% - 20px);         /* 5 Items pro Reihe, mit Abstand */
    box-sizing: border-box;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

@media (max-width: 1100px) {
    .layout-container-item {
        flex: 1 1 calc(100% - 20px); /* 1 Item pro Reihe auf kleinen Bildschirmen */
    }
}

.overview-container {
    display: flex;
    border-bottom: 1px solid #ccc; /* Trennlinie unterhalb */
    margin-bottom: 1rem;
}

.overview-container:last-child {
    border-bottom: none;
}

.overview-item {
    flex: 1 1 33.3333%;
    padding: 1rem;
    box-sizing: border-box;
    /*border-right: 1px solid #ccc;*/ /* Trennlinie rechts */
}

ul.custom-list {
    padding-left: 0;
    list-style-position: inside;
}

h5.custom-size {
    font-size: 1.05rem;
}




html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.btn-primary {
    color: #fff;
    background-color: #A40C16;
    border-color: #A40C16;
}

    .btn-primary:hover {
        color: #fff;
        background-color: #C0101B;
        border-color: #C0101B;
    }

    .btn-primary:focus,
    .btn-primary:active:focus {
        box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #C0101B;
    }

.btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

    .btn-success:hover {
        color: #fff;
        background-color: #157347;
        border-color: #157347;
    }


    .btn-success:focus,
    .btn-success:active:focus {
        box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #157347;
    }

a {
    color: #A40C16;
}

    a:hover {
        color: #C0101B;
    }

.footer {
    display: flex;
    margin: 0 auto;
}

    .footer .container {
        display: flex;
        width: 50%;
    }


header .mb-3 {
    margin-bottom: 0px !important;
}

h5 a {
    text-decoration: none;
    color: black;
    font-size: 18px;
}

/****************************Sidebar**************************************/

.page-layout {
    min-height: 700px;
}

.sidebar {
    width: 240px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    position: relative;
    text-align: center;
}

.icon-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    color: #212529;
    border: 2px solid;
    text-align: center;
    flex-shrink: 0;
}

.border-success {
    border-color: green !important;
}

.border-danger {
    border-color: #A40C16 !important;
}


.nav-link {
    color: black;
}

    .nav-link:hover {
        color: black;
    }

/************************************************/
/************************************************/

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 1rem 0.5rem;
    }

        .sidebar .sidebar-content {
            display: none;
        }

        .sidebar.sidebar-expanded .sidebar-content {
            display: block;
        }

        .sidebar .nav-link .link-text {
            display: none;
        }

        .sidebar.sidebar-expanded .nav-link .link-text {
            display: inline;
            margin-left: 0.5rem;
        }

        .sidebar .nav-link {
            justify-content: center;
        }

        .sidebar.sidebar-expanded .nav-link {
            justify-content: flex-start;
        }

        .sidebar .icon-circle {
            margin: 0 auto;
        }


    .footer-left {
        display: none
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 1rem 0.5rem;
    }

    /* Nur Icons zeigen */
    .link-text {
        display: none !important;
    }

    /* Sidebar-Inhalte ein-/ausklappbar */
    .sidebar-dropdown {
        display: none;
    }

    .sidebar.show-dropdown .sidebar-dropdown {
        display: block;
        margin-top: 1rem;
        position: absolute;
        left: 80px;
        background-color: white;
        border: solid 1px gray;
        padding: 10px;
        width: 250px;
        top: 0px;
        border-radius: 0.375rem; /* z.B. 6px, entspricht Bootstrap Standard */
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); /* optional: schöner Schatten */
    }

    .sidebar .icon-circle {
        margin: 0 auto;
    }

    .nav-link {
        justify-content: center;
    }

    .sidebar.show-dropdown .nav-link {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .sidebar .nav-link {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
    }

    .sidebar .icon-circle {
        margin: 0 auto !important;
    }

    .sidebar .nav-link .link-text {
        display: none;
    }
}

/****************************Sidebar**************************************/
/*******************************Toggle-Button*****************************/

/* Container für Button + Text, zentriert vertikal */
.toggle-container {
    display: inline-flex;
    align-items: center; /* vertikal zentrieren */
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 16px; /* Schriftgröße */
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px; /* kleiner als vorher */
    height: 22px; /* kleiner als vorher */
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #A40C16;
    border-radius: 22px;
    transition: background-color 0.4s;
}

    .slider::before {
        position: absolute;
        content: "";
        height: 18px; /* kleiner als vorher */
        width: 18px; /* kleiner als vorher */
        left: 2px;
        bottom: 2px;
        background-color: white;
        border-radius: 50%;
        transition: transform 0.4s;
    }

input:checked + .slider {
    background-color: green;
}

    input:checked + .slider::before {
        transform: translateX(18px);
    }

.status-text {
    margin-left: 12px; /* Abstand zwischen Button und Text */
    user-select: none;
}

.status-active {
    color: green;
}

.status-inactive {
    color: #A40C16;
}

/*******************************Toggle-Button**********************************/
/*******************************Bio-Container**********************************/

.outer-container {
    margin-top: 20px; /* Abstand zum oberen Rand */
    padding: 20px;
    border: 1px solid #ccc;
    display: flex;
    gap: 20px; /* Abstand zwischen den beiden Containern */
    flex-wrap: wrap; /* Erlaubt Umbruch */


    overflow: hidden; /* <--- Verhindert Scrollbar */
    max-width: 100%; /* Verhindert, dass es über 100% geht */
    box-sizing: border-box; /* Sicherstellen */
}

.inner-container {
    padding: 15px;
    box-sizing: border-box; /* Damit Padding nicht die Breite erhöht */
    min-width: 0; /* Damit Flex Shrink korrekt funktioniert */
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    flex: 1 1 300px; /* erlaubt Schrumpfen UND Wachstum */
    min-width: 0; /* ganz wichtig bei Flex */
}

    .inner-container p {
        text-align: center;
        margin: 0px; /* Überschrift direkt oben */
    }

    .inner-container.grid {
        display: grid;
    }

    .inner-container.center {
        display: flex;
        align-items: center; /* wird ignoriert -> beeinflusst grösse des buttons */
        justify-content: space-between;
    }

    .inner-container.description {
        background-color: white;
    }

@media (max-width: 1000px) {
    .inner-container {
        flex: 0 0 100%; /* volle Breite */
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .outer-container {
        border: 0px solid #ccc;
    }
}

/*******************************Start**********************************/

.instruments {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 10px;
    gap: 0px;
}

@media (max-width: 768px) {
    .instruments {
        display: block;
    }

    .start .wide-textbox {
        width: 100%
    }
}

/*******************************Bio-Container*******************************/
/*******************************Management**********************************/

.drag-button {
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Abstand zwischen den Artikeln */
    padding-top: 20px; /* Abstand zum oberen Rand */
}

    .article-list a {
        text-decoration: none;
        color: black;
        background-color: #f8f9fa; /* Heller Hintergrund für Artikel */
        padding: 15px;
        display: block;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

        .article-list a:hover {
            color: #A40C16;
            background-color: #e2e6ea; /* Etwas dunklerer Hintergrund beim Hover */
        }


    .article-list .sortable-placeholder {
        background: #f0f0f0;
        border: 2px dashed #ccc;
        height: 2em;
        margin: 5px 0;
    }

/*******************************Management**********************************/
/*******************************Custom Checkbox*****************************/

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #157347;
    background-color: white;
    cursor: pointer;
    display: inline-block;
    position: relative;
    border-radius: 3px;
}

    .custom-checkbox:checked {
        background-color: #157347;
    }

        .custom-checkbox:checked::after {
            content: "✓";
            color: white;
            font-size: 14px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

/*******************************Custom Checkbox*******************************/
/*******************************Start*****************************************/

.form-row-flex {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.wide-textbox {
    width: 250px;
}

.wide-textbox-l {
    width: 250px;
}

@media (max-width: 768px) {
    .wide-textbox-l {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .wide-textbox {
        width: 50%;
    }
}

/*******************************Wide Textbox**********************************/
/*******************************Events****************************************/

.events .outer-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    /*font-family: Arial, sans-serif;*/
}

.events .inner-container {
    padding: 20px;
    background: #fafafa;
    width: 380px;
}

    .events .inner-container p {
        text-align: center;
    }

.events table {
    width: 100%;
    border-collapse: collapse;
}

    .events table td {
        padding: 10px 8px;
        vertical-align: middle;
        font-size: 0.9rem;
    }

    .events table tr + tr td {
        padding-top: 15px;
    }

.events input[type="datetime-local"],
.events input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.events input[type="radio"] {
    transform: scale(1.1);
    margin-right: 8px;
    vertical-align: middle;
}

.events td[colspan="4"] {
    font-weight: normal;
    font-size: 1rem;
    padding: 12px 0 6px 0;
}

.events td:nth-child(3) {
    padding-left: 40px;
    font-weight: normal;
    font-size: 0.9rem;
    vertical-align: middle;
}

/*******************************Events****************************************/

@media (max-width: 600px) {
    .p-4 {
        padding: 1.5rem 0rem !important
    }
}

/*****************************************************************************/
/*******************************Analytics*************************************/

.chart-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.analytics-chart,
.device-bar-chart {
    max-width: 800px;
    margin: 2rem auto;
    width: 100% !important;
    display: block;
}

select.custom-dropdown {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    font-size: 1rem;
    color: #212529;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px; /* Abstand zwischen den Spalten */
    text-align: center;
    width: 100%;
}

.metric .label {
    font-weight: bold;
    margin-bottom: 5px;
}

.metric .value {
    color: black;
}


canvas {
    width: 100% !important;
    height: auto;
    display: block;
}

.outer-container {
    overflow-x: hidden;
    max-width: 100%;
}

.inner-container {
    overflow-x: auto;
}

@media (max-width: 768px) {
    .metrics-grid {
        display:block;
    }

}

