/* Intervall-3000 – projektspezifische Anpassungen zu Bootstrap 5 */

:root {
    --it3k-radius: 0.85rem;
    --it3k-shadow: 0 2px 10px rgba(20, 20, 30, 0.08), 0 1px 2px rgba(20, 20, 30, 0.06);
    --it3k-shadow-hover: 0 8px 24px rgba(20, 20, 30, 0.12), 0 2px 6px rgba(20, 20, 30, 0.08);
}

[data-bs-theme="dark"] {
    --it3k-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
    --it3k-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}

body {
    min-height: 100vh;
    /* Als iPhone-Homescreen-App (viewport-fit=cover): links/rechts fuer
       Querformat auf Geraeten mit Notch/Dynamic Island, unten fuer den
       Home-Indicator-Balken. Oben ist bewusst KEIN padding-top noetig -
       apple-mobile-web-app-status-bar-style "black" (siehe layout/base.twig)
       reserviert den Platz fuer die Statusleiste bereits selbst, ein
       zusaetzliches env(safe-area-inset-top) wuerde die Luecke verdoppeln. */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, .navbar-brand {
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------- */
.it3k-navbar {
    background: linear-gradient(135deg, #24304a, #2f4864);
    box-shadow: var(--it3k-shadow);
    position: sticky;
    top: 0;
    z-index: 1030;
}

[data-bs-theme="dark"] .it3k-navbar {
    background: linear-gradient(135deg, #12182a, #16233a);
}

.it3k-navbar .navbar-brand {
    font-weight: 700;
}

.it3k-navbar .nav-link {
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
}

.it3k-navbar .nav-link:hover,
.it3k-navbar .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.08);
}

.it3k-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 600;
}

/* Reihenfolge unabhaengig vom Breakpoint: Logo, Suche, Hamburger (nur
   mobile sichtbar), aufklappbares Menu. */
.it3k-search {
    order: 2;
    min-width: 0;
}

.it3k-search input {
    min-width: 0;
}

.it3k-navbar-toggler {
    order: 3;
    /* Darf nie kleiner werden, egal wie eng es wird. */
    flex-shrink: 0;
}

.it3k-navbar .navbar-collapse {
    order: 4;
}

@media (max-width: 991.98px) {
    /* Eine einzige Zeile auf Mobile: Logo (nur Icon, Projektname-Text
       ausgeblendet - braucht sonst zu viel Platz), Suche, Hamburger.
       "flex: 1 1 0%" statt "auto": die Suche startet bei Breite 0 und
       waechst rein ueber den Grow-Anteil, OHNE sich an der intrinsischen
       Inhaltsbreite des <input> zu orientieren - genau darauf reagiert
       WebKit/Safari in Flex-Containern anders als Chrome (Icon blieb dort
       sonst ausserhalb des sichtbaren Bereichs haengen). */
    .it3k-navbar .navbar-brand {
        flex: 0 0 auto;
        margin-right: 0.5rem;
    }

    .it3k-brand-text {
        display: none;
    }

    .it3k-search {
        flex: 1 1 0%;
    }

    .it3k-navbar-toggler {
        margin-left: 0.6rem;
    }
}

@media (min-width: 992px) {
    /* Auf Desktop ganz nach rechts - order hoeher als die Collapse (4),
       damit die Suche NACH den Menuepunkten/dem Abmelden-Button kommt,
       nicht direkt nach dem Logo (war vorher zu nah an den Menuepunkten). */
    .it3k-search {
        order: 5;
        max-width: 220px;
        margin-left: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    /* Aufgeklapptes Menu auf Mobile zentriert statt linksbuendig - Punkte
       und der Abmelden-Button jeweils als eigene, mittige Zeile. */
    .it3k-navbar .navbar-nav {
        align-items: center;
        text-align: center;
    }

    .it3k-navbar .navbar-collapse form {
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Eigener animierter Hamburger statt Bootstraps statischem Icon - drei
   Striche morphen beim Oeffnen zu einem X. Bootstrap setzt aria-expanded
   selbst (data-bs-toggle="collapse"), kein zusaetzliches JS noetig. */
.it3k-navbar-toggler {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.it3k-navbar-toggler:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    box-shadow: none;
}

.it3k-toggler-bar {
    display: block;
    width: 1.35rem;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.it3k-navbar-toggler[aria-expanded="true"] .it3k-toggler-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.it3k-navbar-toggler[aria-expanded="true"] .it3k-toggler-bar:nth-child(2) {
    opacity: 0;
}

.it3k-navbar-toggler[aria-expanded="true"] .it3k-toggler-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Aufklappmenu auf Mobile sanft einblenden statt abrupt erscheinen zu
   lassen - auf Desktop (immer sichtbar, kein "show") bewusst deaktiviert. */
@media (max-width: 991.98px) {
    .it3k-navbar .navbar-collapse .nav-item {
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .it3k-navbar .navbar-collapse.show .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    .it3k-navbar .navbar-collapse.show .nav-item:nth-child(1) { transition-delay: 0.02s; }
    .it3k-navbar .navbar-collapse.show .nav-item:nth-child(2) { transition-delay: 0.06s; }
    .it3k-navbar .navbar-collapse.show .nav-item:nth-child(3) { transition-delay: 0.10s; }
    .it3k-navbar .navbar-collapse.show .nav-item:nth-child(4) { transition-delay: 0.14s; }
    .it3k-navbar .navbar-collapse.show .nav-item:nth-child(5) { transition-delay: 0.18s; }
}

/* --------------------------------------------------------------------
   Navbar-Suche
   -------------------------------------------------------------------- */
.it3k-search-results {
    display: none;
    width: 100%;
    max-height: 340px;
    overflow-y: auto;
}

.it3k-search-results.show {
    display: block;
}

/* --------------------------------------------------------------------
   Karten & Listen
   -------------------------------------------------------------------- */
.card {
    border: 0;
    border-radius: var(--it3k-radius);
    box-shadow: var(--it3k-shadow);
}

.list-group-item {
    border-radius: 0 !important;
}

.list-group .list-group-item {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.list-group-item.border-danger {
    border-width: 2px;
}

.btn {
    border-radius: 0.6rem;
}

.progress {
    border-radius: 1rem;
    overflow: hidden;
}

/* --------------------------------------------------------------------
   Level/EXP-Anzeige
   -------------------------------------------------------------------- */
.it3k-level-card .progress-bar {
    background: linear-gradient(90deg, #e0a52c, #f4cf5c);
}

/* --------------------------------------------------------------------
   Farbauswahl im Task-Formular (siehe Vorlage: runde, kraeftige Swatches)
   -------------------------------------------------------------------- */
.color-swatch {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease;
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.is-selected {
    box-shadow: 0 0 0 3px var(--bs-body-bg), 0 0 10px 3px rgba(244, 207, 92, 0.9);
}

/* Farbig hinterlegtes Icon vor dem Task-Namen, z.B. in Log/Statistik */
.task-color-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    color: #fff;
    margin-right: 0.35rem;
    flex: none;
}

.task-image-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Groessere, klickbare Bild-Vorschau (z.B. Vollbracht-Bearbeiten-Seite) -
   oeffnet per data-lightbox die Lightbox (siehe initLightbox() in app.js). */
.it3k-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.it3k-image-gallery-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.65rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.it3k-image-gallery-item img:hover {
    transform: scale(1.02);
    box-shadow: var(--it3k-shadow-hover);
}

/* Kleines rundes Icon in Listen, das anzeigt "hier gibt's ein Bild dazu" -
   Klick oeffnet die Lightbox. */
.it3k-thumb-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.it3k-thumb-icon:hover {
    background-color: var(--bs-primary);
    color: #fff;
    transform: scale(1.05);
}

/* --------------------------------------------------------------------
   Login-Seite: kein Navbar, dafuer vertikal zentriert (siehe login.twig)
   -------------------------------------------------------------------- */
.login-wrap {
    min-height: calc(100vh - 3rem);
}

/* --------------------------------------------------------------------
   Notyf-Feintuning: Bootstraps eigene z-index-Skala respektieren
   -------------------------------------------------------------------- */
.notyf {
    z-index: 1090;
}

/* --------------------------------------------------------------------
   Klickbarer Name in Listen (Aufgaben, Pendenzen), der aber nicht wie ein
   Link aussehen soll - keine Unterstreichung, keine Linkfarbe, nur der
   Mauszeiger zeigt an, dass man draufklicken kann.
   -------------------------------------------------------------------- */
.it3k-plain-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.it3k-plain-link:hover,
.it3k-plain-link:focus {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------
   Verwaltung: Karten-Uebersicht
   -------------------------------------------------------------------- */
.it3k-admin-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    color: var(--bs-body-color);
}

.it3k-admin-card:hover {
    box-shadow: var(--it3k-shadow-hover);
    transform: translateY(-2px);
}

.it3k-admin-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 111, 165, 0.15);
    color: #4a6fa5;
    font-size: 1.15rem;
}

[data-bs-theme="dark"] .it3k-admin-card-icon {
    background: rgba(122, 160, 210, 0.18);
    color: #9db8e0;
}

/* --------------------------------------------------------------------
   Pendenzen-Ehrenhalle
   -------------------------------------------------------------------- */
.it3k-hof-card {
    overflow: hidden;
    border-top: 4px solid transparent;
}

.it3k-hof-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

img.it3k-hof-image {
    cursor: pointer;
}

.it3k-hof-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(0, 0, 0, 0.15);
    background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03));
}

[data-bs-theme="dark"] .it3k-hof-image-placeholder {
    color: rgba(255, 255, 255, 0.15);
}

.it3k-hof-tier-badge {
    color: #fff;
    padding: 0.4em 0.8em;
}

.it3k-tier-quick { border-top-color: #6c9a5f; }
.it3k-tier-quick .it3k-hof-tier-badge { background: #6c9a5f; }

.it3k-tier-strong { border-top-color: #3a6ea5; }
.it3k-tier-strong .it3k-hof-tier-badge { background: #3a6ea5; }

.it3k-tier-epic {
    border-top-color: #c9a53d;
    box-shadow: 0 0 0 1px rgba(201, 165, 61, 0.35), var(--it3k-shadow);
}
.it3k-tier-epic .it3k-hof-tier-badge { background: linear-gradient(90deg, #c9a53d, #e0c368); }

.it3k-tier-legendary {
    border-top-color: #a45fd1;
    box-shadow: 0 0 0 1px rgba(164, 95, 209, 0.4), 0 0 24px rgba(164, 95, 209, 0.25), var(--it3k-shadow);
}
.it3k-tier-legendary .it3k-hof-tier-badge {
    background: linear-gradient(90deg, #a45fd1, #e0a52c, #a45fd1);
    background-size: 200% auto;
    animation: it3k-legendary-shine 3s linear infinite;
}

@keyframes it3k-legendary-shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ------------------------------------------------------------------
 * Symbol-Auswahl im Aufgaben-Formular (siehe initIconPicker() in
 * assets/js/app.js): scrollbares Raster mit den echten Icons, darueber
 * ein Suchfeld.
 * ------------------------------------------------------------------ */
.it3k-icon-grid {
    position: relative; /* Bezugspunkt fuers Scrollen zum gewaehlten Symbol */
    max-height: 15rem;
    overflow-y: auto;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
}

.it3k-icon-group + .it3k-icon-group {
    margin-top: 0.75rem;
}

.it3k-icon-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.35rem;
}

.it3k-icon-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.it3k-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.it3k-icon-btn:hover {
    transform: scale(1.08);
    border-color: var(--bs-primary);
}

.it3k-icon-btn.is-selected {
    border-color: #f4cf5c;
    background-color: rgba(244, 207, 92, 0.18);
    box-shadow: 0 0 0 2px rgba(244, 207, 92, 0.55);
}

.it3k-icon-empty {
    padding: 0.5rem 0.25rem;
}
