/* Minimale Ergänzungen zum lokal gebauten Tailwind-Stylesheet (static/tailwind.css) für das Admin-Panel */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

input[type="radio"] {
    accent-color: #6366f1;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23d1d5db' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}

textarea,
textarea:focus {
    border-radius: 0 !important;
    -webkit-appearance: none;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Auswahlboxen (static/auswahl.js): Der Knopf trägt die Klassen des
   <select> und sieht geschlossen gleich aus; die Liste ist eine Karte wie
   im restlichen Panel statt der Systemliste. */
.auswahl-quelle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.auswahl-knopf {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    max-width: 20rem;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23d1d5db' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M 2 4 l 4 4 4 -4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auswahl-knopf:hover {
    border-color: rgba(255, 255, 255, 0.2);
}
.auswahl-knopf:focus-visible,
.auswahl-knopf[aria-expanded="true"] {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.auswahl-knopf[aria-expanded="true"] {
    border-color: rgba(129, 140, 248, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23818cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M 2 8 l 4 -4 4 4'/%3E%3C/svg%3E");
}
.auswahl-knopf:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.auswahl-knopf.auswahl-platzhalter .auswahl-wert {
    color: #9ca3af;
}
.auswahl-wert,
.auswahl-mass > span {
    grid-area: 1 / 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.auswahl-mass {
    display: contents;
}
.auswahl-mass > span {
    visibility: hidden;
}
.auswahl-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auswahl-punkt {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.auswahl-liste {
    position: fixed;
    z-index: 60;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    overflow-y: auto;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.55), 0 4px 10px -4px rgba(0, 0, 0, 0.4);
    color: #e5e7eb;
    outline: none;
    animation: auswahl-auf 0.12s ease-out;
}
.auswahl-liste-oben {
    animation-name: auswahl-auf-oben;
}
.auswahl-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem 0.4rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.auswahl-haken {
    flex: none;
    display: inline-flex;
    width: 14px;
    color: #818cf8;
}
.auswahl-option.auswahl-aktiv {
    background: #334155;
    color: #fff;
}
.auswahl-option[aria-selected="true"] {
    color: #a5b4fc;
    font-weight: 500;
}
.auswahl-option[aria-selected="true"].auswahl-aktiv {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}
.auswahl-option[aria-disabled="true"] {
    color: #6b7280;
    cursor: default;
}
@keyframes auswahl-auf {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
@keyframes auswahl-auf-oben {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auswahl-liste { animation: none; }
}

/* Kleine Icon-Knöpfe in Kopfzeilen (Neu laden) und die Lupe darin */
.icon-knopf,
.lupe-ic {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #9ca3af;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.icon-knopf:hover,
.lupe-ic:hover {
    color: #fff;
    background: #334155;
}
.icon-knopf:disabled {
    cursor: default;
}
.icon-knopf:focus-visible,
.lupe-ic:focus-visible,
.lupe-x:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: -2px;
}

/* Lupensuche (static/lupe.js): Maße und Feder-Kurve wie die Lupensuche der GiKS-Suite */
.lupe {
    position: relative;
    display: flex;
    align-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
    transition: width 0.45s cubic-bezier(0.34, 1.3, 0.64, 1), background-color 0.3s, box-shadow 0.3s;
}
.lupe.open {
    width: 280px;
    background: #1e293b;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.lupe.open:focus-within {
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.lupe-ic {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}
.lupe.open .lupe-ic {
    color: #818cf8;
    background: transparent;
}
.lupe input,
.lupe input:focus {
    width: 100%;
    height: 100%;
    padding: 0 30px 0 34px;
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
    font-size: 13px;
    color: #e5e7eb;
    opacity: 0;
    transition: opacity 0.3s;
}
.lupe input::placeholder {
    color: #6b7280;
}
.lupe.open input {
    opacity: 1;
}
.lupe:not(.open) input {
    pointer-events: none;
}
.lupe-x {
    position: absolute;
    right: 5px;
    top: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #9ca3af;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, color 0.15s, background-color 0.15s;
}
.lupe.open .lupe-x {
    opacity: 1;
    pointer-events: auto;
}
.lupe-x:hover {
    color: #fff;
    background: #334155;
}
@media (prefers-reduced-motion: reduce) {
    .lupe, .lupe input, .lupe-x { transition: none; }
}

/* Filterbereich: Filterzeile und darunter die aktiven Filter als Chips */
.filter-bereich > * + * {
    margin-top: 0.75rem;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #e0e7ff;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.filter-chip:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(129, 140, 248, 0.5);
}
.filter-chip-name {
    color: #a5b4fc;
}
.filter-chip svg {
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
.filter-chip:hover svg {
    opacity: 1;
}

tr[onclick] {
    cursor: pointer;
}

code {
    user-select: all;
}

/* Log-Viewer: Syntax-Highlighting für Container-Logs */
.log-line-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.06);
    display: block;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    border-left: 2px solid #ef4444;
}
.log-line-warning {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
    display: block;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    border-left: 2px solid #f59e0b;
}
.log-line-critical {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.08);
    display: block;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    border-left: 2px solid #e11d48;
    font-weight: 600;
}
.log-line-info {
    color: #60a5fa;
    display: block;
}
.log-line-debug {
    color: #6b7280;
    display: block;
}
.log-line-traceback {
    color: #f87171;
    background: rgba(248, 113, 113, 0.04);
    display: block;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
}
.log-line-normal {
    color: #9ca3af;
    display: block;
}

/* Toast-Animationen */
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(1rem); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
.animate-slide-in-right { animation: slide-in-right 0.2s ease-out; }
.animate-fade-out       { animation: fade-out 0.2s ease-out forwards; }

/* Status-Toggle Buttons (Rückfrage / Gelöst) */
.status-toggle {
    cursor: pointer;
}
.status-toggle input[type="radio"] {
    display: none !important;
}
.status-toggle-label {
    display: block;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    transition: all 0.15s ease;
}
.status-toggle:first-child .status-toggle-label {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.status-toggle:hover .status-toggle-label {
    color: #d1d5db;
}
.status-toggle input:checked + .status-toggle-label {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* Refresh-Button Spin: 180°-Schritte */
@keyframes spin-half {
    from { transform: rotate(var(--spin-from)); }
    to   { transform: rotate(var(--spin-to)); }
}
