﻿/* ============================
   KitchenCloud – Global Theme
   ============================
   Hauptfarben:
   - Sage Ivory (#F4F6EC) → Hintergrund (ruhiger, augenfreundlicher Ersatz für das frühere Neon-Lime)
   - Olive Ink (#2F3A1D) → Primärfarbe (Texte, Icons, Tiles)
   - Warm Lime (#B7D98C, gedämpft) → Akzentfarbe für Badges/Hover, nicht mehr als Flächenfarbe
*/

/* Farben + Bootstrap Overrides */
:root {
    /* KitchenCloud Farben */
    --kc-primary: #2F3A1D;
    --kc-primary-light: #4a5a33;
    --kc-secondary: #00cec9;
    --kc-bg: #F4F6EC;
    --kc-bg-soft: #E9EEDD;
    --kc-accent: #B7D98C;
    --kc-text: #2d3436;
    --kc-danger: #d63031;
    --kc-success: #00b894;
    /* Warme Zweitfarben fürs Dashboard - Terracotta/Senf statt reinem Salbei/Oliv,
       angelehnt an typische Rezept-Plattformen (warme, erdige, appetitliche Töne). */
    --kc-terracotta: #E0784F;
    --kc-terracotta-dark: #9c4a29;
    --kc-terracotta-light: #F3A47A;
    --kc-mustard: #E8A93D;
    --kc-mustard-dark: #8a5a12;
    --kc-mustard-light: #F5C876;
    /* Bootstrap überschreiben → verhindert blaue Schrift */
    --bs-primary: #2F3A1D;
    --bs-link-color: #2F3A1D;
    --bs-link-hover-color: #4a5a33;
    --bs-navbar-color: #2F3A1D;
    --bs-nav-link-color: #2F3A1D;
    --bs-nav-link-hover-color: #4a5a33;

    .navbar-light .navbar-brand,
    .navbar-light .navbar-nav .nav-link,
    .navbar-light .navbar-nav .nav-link.active,
    .navbar-light .navbar-nav .show > .nav-link,
    .dropdown-toggle {
        color: var(--kc-primary) !important;
    }
    /* Hamburger Icon ebenfalls überschreiben */
    .navbar-light .navbar-toggler-icon {
        filter: brightness(0) saturate(100%) invert(16%) sepia(12%) saturate(900%) hue-rotate(50deg) brightness(95%) contrast(90%);
    }
    /* Body */
    body {
        background-color: var(--kc-bg);
        color: var(--kc-text);
        font-family: 'Inter', sans-serif;
        margin-bottom: 60px;
    }
    /* Navigation – explizit überschreiben */
    .navbar-brand,
    .nav-link,
    .dropdown-toggle {
        color: var(--kc-primary) !important;
    }
    /* Buttons */
    .btn-kc {
        background-color: var(--kc-primary);
        border-color: var(--kc-primary);
        color: white;
        transition: 0.2s;
    }

        .btn-kc:hover {
            background-color: var(--kc-primary-light);
            border-color: var(--kc-primary-light);
        }
    /* Input-Felder */
    .form-control, .form-select {
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    /* Karten */
    .kc-card {
        background: white;
        border-radius: 12px;
        padding: 2rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    /* Login/Registrierung: siehe kc-auth.css (eigenes Themen-File) */
    .btn-kc-outline {
        border: 2px solid var(--kc-primary);
        color: var(--kc-primary);
        background: transparent;
        border-radius: 8px;
        transition: 0.2s;
    }

        .btn-kc-outline:hover {
            background: var(--kc-primary-light);
            color: white;
        }
    /* Tabellen */
    .table-fixed {
        table-layout: fixed;
        width: 100%;
        border-collapse: collapse;
    }

        .table-fixed th,
        .table-fixed td {
            text-align: center;
            vertical-align: middle;
            padding: 0.75rem;
            /* Lange, nicht trennbare Inhalte (z.B. Email-Adressen ohne Leerzeichen)
               innerhalb der Spalte umbrechen statt in die Nachbarspalte überlaufen zu lassen. */
            overflow-wrap: break-word;
            word-break: break-word;
        }

        .table-fixed th {
            background-color: var(--kc-primary);
            color: white;
            font-weight: 600;
        }

        .table-fixed td input,
        .table-fixed td select {
            width: 100%;
        }
    /* Dashboard-Kacheln - display:flex + height:100% sorgt dafür, dass alle Kacheln einer
       Zeile gleich hoch sind (Bootstraps .row streckt die Spalten dank align-items:stretch
       ohnehin auf die höchste Zeile, hier wird nur der Link-Inhalt selbst mitgestreckt),
       unabhängig davon wie lang Titel/Beschreibung sind oder wie viele Kacheln in der
       Zeile stehen (z.B. 3 vs. 4 vs. 5 je nach Rolle/Breakpoint). */
    .kc-tile-link {
        display: flex;
        flex-direction: column;
        height: 100%;
        text-decoration: none;
        color: inherit;
        background: white;
        border: 2px solid #dcdcdc;
        border-radius: 16px;
        padding: 1.8rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.06);
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
    }

        .kc-tile-link:hover {
            transform: translateY(-6px);
            box-shadow: 0 10px 22px rgba(0,0,0,0.12);
            border-color: var(--kc-primary);
            background-color: var(--kc-bg-soft);
        }

        .kc-tile-link h4 {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 0.4rem;
            color: var(--kc-primary);
            /* Lange (zusammengesetzte) Wörter wie "Einkaufsliste" oder "bearbeiten" sind
               bei schmalen Spalten (2 Kacheln pro Zeile auf Mobile) breiter als die
               verfügbaren ~86px und ragten sonst aus der Kachel heraus. hyphens:auto
               (mit lang="de" auf <html>, siehe _Layout.cshtml) trennt an sinnvollen
               Silbenstellen mit echtem Trennstrich statt eines rohen Zeichenabbruchs;
               overflow-wrap bleibt als Fallback für Wörter, die die Hyphenation-Engine
               nicht kennt (z.B. Fremdwörter). */
            hyphens: auto;
            overflow-wrap: break-word;
        }

        .kc-tile-link p {
            font-size: 0.95rem;
            color: #555;
            margin: 0;
            /* Gleicher Grund wie bei .kc-tile-link h4 - lange Wörter in der
               Kachel-Beschreibung (z.B. "zusammenstellen") ragten sonst heraus. */
            hyphens: auto;
            overflow-wrap: break-word;
        }

    /* Icon als runde Badge statt freischwebendem Emoji - wirkt aufgeräumter/moderner */
    .kc-tile-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        margin-bottom: 1rem;
        border-radius: 50%;
        background: var(--kc-bg-soft);
        font-size: 1.6rem;
        color: var(--kc-primary);
    }

    /* Kachel mit Ungelesen-Badge (z.B. Postkorb) */
    .kc-tile-link--relative {
        position: relative;
    }

    /* Noch nicht anklickbare Kachel (z.B. Feature "bald verfügbar") - optisch gedimmt,
       kein Hover-Hub, damit klar ist, dass hier (noch) nichts passiert. */
    .kc-tile-link--soon {
        position: relative;
        cursor: default;
        opacity: 0.65;
    }

        .kc-tile-link--soon:hover {
            transform: none;
            box-shadow: 0 4px 10px rgba(0,0,0,0.06);
            border-color: #dcdcdc;
            background-color: white;
        }

    .kc-tile-soon-badge {
        position: absolute;
        top: 0.9rem;
        right: 0.9rem;
        padding: 0.25rem 0.6rem;
        border-radius: 999px;
        background: var(--kc-bg-soft);
        color: var(--kc-primary);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    /* Dezentes "Neu"-Tag für einzelne Zeilen/Karten in Listen (Benutzer, Rezepte, Logs,
       Postkorb, Passwortanfragen) - im Gegensatz zu .kc-badge-unread (kräftiges Rot auf
       Kacheln) hier bewusst zurückhaltend: heller roter Hintergrund, keine harten Farben. */
    .kc-neu-tag {
        display: inline-block;
        background: #fdecec;
        color: #c0392b;
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding: 0.1rem 0.45rem;
        border-radius: 999px;
        margin-left: 0.5rem;
        vertical-align: middle;
    }

    .kc-badge-unread {
        position: absolute;
        top: 0.9rem;
        right: 0.9rem;
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: 999px;
        background: #c0392b;
        color: white;
        font-size: 0.75rem;
        font-weight: 700;
        line-height: 22px;
        text-align: center;
    }
    /* Buttons Success/Danger */
    .btn-kc-success {
        background-color: var(--kc-success) !important;
        border-color: var(--kc-success) !important;
        color: white !important;
        transition: 0.2s;
    }

        .btn-kc-success:hover {
            background-color: #009f78 !important;
            border-color: #009f78 !important;
        }

    .btn-kc-danger {
        background-color: var(--kc-danger) !important;
        border-color: var(--kc-danger) !important;
        color: white !important;
        transition: 0.2s;
    }

        .btn-kc-danger:hover {
            background-color: #b02225 !important;
            border-color: #b02225 !important;
        }
    /* Icons */
    .kc-user-icon {
        font-size: 1.15rem;
        color: var(--kc-primary);
    }

    .kc-sort-icon {
        font-size: 0.8rem;
        opacity: 0.5;
    }

    /* Einheitliches Layout für Tabellen-Header (Icon, Label, Sortierpfeile).
       Ohne diesen Wrapper ordnet der Browser die einzelnen <span>-Elemente je nach
       verfügbarer Spaltenbreite unterschiedlich an (mal Icon über dem Text, mal daneben,
       Pfeile mal darunter, mal dahinter) - deshalb hier bewusst als fixe Flex-Zeile.
       flex-wrap: wrap statt nowrap, damit bei schmalen Spalten Icon/Text/Pfeile als
       GANZE Einheit auf eine zweite Zeile umbrechen, statt in die Nachbarspalte
       überzulaufen - so bleibt das Verhalten über alle Spalten hinweg konsistent. */
    .kc-th-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        row-gap: 0;
    }

    /* Auf schmalen Bildschirmen (2-3 Tabellenspalten passen nebeneinander)
       reicht bei kurzen Spaltentiteln (z.B. "Rolle") der Platz noch fuer
       Icon+Text in einer Zeile, waehrend laengere (z.B. "Email") schon
       umbrechen - das sah uneinheitlich aus (mal Icon links, mal oben).
       Deshalb hier fest erzwungen: Icon IMMER oberhalb des Texts. */
    @media (max-width: 576px) {
        .kc-th-content {
            flex-direction: column;
            gap: 0.15rem;
        }
    }

    th {
        cursor: pointer;
    }
    /* Pagination */
    .kc-pagination {
        display: flex;
        gap: 8px;
        margin-top: 20px;
    }

    .kc-page-btn {
        display: inline-block;
        padding: 6px 14px;
        border-radius: 8px;
        background: white;
        border: 2px solid var(--kc-primary);
        color: var(--kc-primary);
        text-decoration: none;
        cursor: pointer;
        transition: 0.2s;
    }

        .kc-page-btn:hover {
            background: var(--kc-primary-light);
            color: white;
        }

    .kc-page-btn-active {
        background: var(--kc-primary);
        color: white;
        border-color: var(--kc-primary);
    }

    /* "..." zwischen abgekürzten Seitenzahlen (siehe getPageNumbers in kc-users.js/kc-roles.js/kc-logs.js) */
    .kc-page-ellipsis {
        display: flex;
        align-items: center;
        padding: 6px 4px;
        color: var(--kc-primary);
        opacity: 0.6;
        user-select: none;
    }
    /* ============================
   Bootstrap Overrides (ehemals site.css)
   ============================ */
    /* Schriftgrößen für HTML */
    html {
        font-size: 14px;
        position: relative;
        min-height: 100%;
    }

    @media (min-width: 768px) {
        html {
            font-size: 16px;
        }
    }
    /* Fokus-Styling */
    .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 var(--kc-primary);
    }
    /* Placeholder-Styling */
    .form-floating > .form-control-plaintext::placeholder,
    .form-floating > .form-control::placeholder {
        color: var(--kc-text);
        text-align: end;
    }

    .form-floating > .form-control-plaintext:focus::placeholder,
    .form-floating > .form-control:focus::placeholder {
        text-align: start;
    }
    /* Modernes Body-Styling */
    .kc-body {
        background-color: var(--kc-bg);
        color: var(--kc-text);
        font-family: 'Inter', sans-serif;
    }
    /* Navigation - reduziert auf Logo + Profil, seit die Seiten-Links als Kacheln unter
       dem Karussell auf der Startseite leben (siehe kc-dashboard.css .kc-quick-actions).
       Sticky + dezenter Blur-Effekt für ein moderneres, "schwebendes" Gefühl. */
    .kc-navbar {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(8px);
        padding: 1rem 0;
        border-bottom: 1px solid rgba(47,58,29,0.08); /* Olive Ink leicht */
        z-index: 1030;
    }

    .kc-navbar-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .kc-brand {
        font-size: 1.6rem;
        color: var(--kc-primary) !important;
        letter-spacing: 0.5px;
    }

    /* Profil-Dropdown */
    .kc-profile-toggle {
        color: var(--kc-primary) !important;
        padding: 0.5rem 0.9rem;
        border-radius: 999px;
        transition: background-color 0.2s;
    }

        .kc-profile-toggle:hover {
            background-color: var(--kc-bg-soft);
        }

    /* Fester Home-Button in der Navbar (siehe _Layout.cshtml) - kreisförmiger
       Icon-Button, analog zu .kc-profile-toggle aber ohne Text, damit er auf
       jeder Seite unübersehbar als "zurück zur Startseite" erkennbar ist. */
    .kc-home-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        color: var(--kc-primary) !important;
        transition: background-color 0.2s, color 0.2s;
    }

        .kc-home-btn:hover {
            background-color: var(--kc-bg-soft);
            color: var(--kc-terracotta) !important;
        }

    .kc-dropdown {
        border-radius: 12px;
        padding: 0.5rem;
    }

    .kc-logout:hover {
        background-color: rgba(214,48,49,0.1);
    }
    /* Hauptinhalt */
    .kc-main {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
}
