﻿/* Grundstil von CommonTools. In der App in wwwroot/index.html einbinden:
   <link rel="stylesheet" href="_content/CommonTools/commontools.css" />
   Farben über die Variablen unten; eine App kann sie in ihrer eigenen CSS-Datei überschreiben. */
:root {
    --ct-blue: #1e5fbf;
    --ct-blue-dark: #174c99;
    --ct-blue-light: #eaf1fb;
    --ct-green: #2e9d57;
    --ct-red: #c62828;
    --ct-text: #222;
    --ct-muted: #777;
}

/* ===== Knöpfe ===== */
.ct-btn {
    display: inline-block;
    border: 1px solid var(--ct-blue);
    background: white;
    color: var(--ct-blue);
    border-radius: 8px;
    padding: 7px 14px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ct-btn--primary {
    background: var(--ct-blue);
    color: white;
    font-weight: 600;
}

    .ct-btn--primary:hover {
        background: var(--ct-blue-dark);
    }

.ct-btn--danger {
    background: var(--ct-red);
    border-color: var(--ct-red);
    color: white;
}

.ct-hint {
    font-size: 0.8rem;
    color: var(--ct-muted);
}

/* ===== Titel der App (AppTitle): Knopf ohne eigenes Aussehen; :where = Klassen der App haben Vorrang ===== */
:where(.ct-title) {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

/* ===== Sprach-Umschalter (LanguageSwitch): nur die Flagge der anderen Sprache ===== */
.ct-lang {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}

    .ct-lang:hover {
        background: rgba(255, 255, 255, 0.18);
    }

    .ct-lang svg {
        width: 26px;
        height: 14px;
        border: 1px solid rgba(255, 255, 255, 0.6);
        display: block;
    }

/* ===== Fußzeile (AppFooter) ===== */
.ct-footer {
    text-align: right;
    font-size: 0.75rem;
    color: #888;
    padding: 8px 16px;
}

/* ===== Menü-Leiste (MenuBar, MenuBarMenu, Menu…) ===== */
.ct-menubar {
    position: relative;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    background: var(--ct-blue);
    color: white;
    border-radius: 8px;
    padding: 4px 10px;
}

.ct-menubar__title {
    background: none;
    border: none;
    color: white;
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 6px 4px;
    margin-right: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.ct-menubar__item {
    position: relative;
}

.ct-menubar__btn {
    background: transparent;
    border: none;
    color: white;
    font: inherit;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

    .ct-menubar__btn:hover,
    .ct-menubar__btn--open {
        background: rgba(255, 255, 255, 0.18);
    }

.ct-menubar__right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.ct-menubar__backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
}

.ct-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 230px;
    background: white;
    color: var(--ct-text);
    border: 1px solid #ccd;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}

    .ct-menu[hidden] {
        display: none;
    }

.ct-menu__entry {
    display: block;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.9rem;
    color: var(--ct-text);
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

    .ct-menu__entry:hover:not(:disabled) {
        background: var(--ct-blue-light);
    }

    /* Nicht verfügbar */
    .ct-menu__entry:disabled {
        color: #aaa;
        cursor: default;
    }

    .ct-menu__entry input[type=checkbox] {
        margin-right: 6px;
    }

.ct-menu__sub {
    font-weight: 600;
}

.ct-menu__subentries {
    display: flex;
    flex-direction: column;
}

    .ct-menu__subentries .ct-menu__entry {
        padding-left: 30px;
    }

.ct-menu__keep {
    display: flex;
    flex-direction: column;
}

.ct-menu__sep {
    border: 0;
    border-top: 1px solid #eee;
    margin: 4px 0;
    width: 100%;
}

/* ===== Dialog-Fenster (Dialog, AboutDialog, StorageDialog) ===== */
.ct-shade {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.25);
}

.ct-dialog {
    position: fixed;
    z-index: 41;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ct-text);
}

/* Kopf: blauer Verlauf, Titel, Untertitel, ✕ oben rechts */
.ct-dialog__head {
    position: relative;
    background: linear-gradient(135deg, var(--ct-blue), #3d8bfd);
    color: white;
    padding: 18px 48px 16px 22px;
}

    .ct-dialog__head h2 {
        margin: 0;
        font-size: 1.4rem;
    }

.ct-dialog__sub {
    font-size: 0.8rem;
    opacity: 0.85;
}

.ct-dialog__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

    .ct-dialog__close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

.ct-dialog__body {
    padding: 16px 22px 8px;
}

.ct-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 22px 20px;
}

/* Kärtchen im Fenster "Über …" (AboutCard) */
.ct-card {
    position: relative;
    border-radius: 10px;
    padding: 10px 14px 10px 46px;
    margin-bottom: 12px;
}

.ct-card__icon {
    position: absolute;
    left: 13px;
    top: 9px;
    font-size: 1.25rem;
}

.ct-card--blau { background: #eaf1fb; }
.ct-card--gruen { background: #e8f5ec; }
.ct-card--orange { background: #fff4e0; }
.ct-card--lila { background: #efe9fb; }

/* Tabelle im Fenster "Speicherbelegung" (StorageDialog) */
.ct-storage {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

    .ct-storage td {
        padding: 6px 4px;
        border-bottom: 1px solid #eee;
    }

        .ct-storage td:last-child {
            text-align: right;
            font-weight: 600;
            white-space: nowrap;
        }

/* ===== Rückfrage (Confirm) – Aussehen wie bisher in PFlow ===== */
.ct-confirm {
    background: #fdf0ef;
    border: 1px solid #c0392b;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.ct-confirm__btn {
    border: 1px solid #ccc;
    background: white;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    margin-right: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Bestätigen bei Löschen/Verwerfen: rot umrandet */
.ct-confirm__btn--danger {
    border-color: #c0392b;
    color: #c0392b;
}

/* ===== Ziehen und Ablegen (DragSortService, js/dragSort.js) ===== */
.ct-drag-active {
    opacity: 0.5;
    cursor: grabbing;
}

.ct-drag-target {
    outline: 2px dashed var(--ct-blue);
    outline-offset: 2px;
}
