/* eslint-disable css/no-important */
/* eslint-disable css/use-baseline */
/* ================================================================
   1. VARIABLEN & DESIGN-TOKENS
================================================================ */
:root {
    /* Hintergrund-Farben (Light Mode) */
    --bg-main: #f8f9fa;
    --bg-dark: #1a1a1a;
    --bg-mid: #2d2d2d;
    --bg-light: #404040;
    --bg-hover: #555555;
    --bg-trans: rgba(248, 249, 250, 0.92);

    /* UI-Element Hintergründe */
    --card-bg: #ffffff;
    --card-content-bg: #fafafa;
    --input-bg: #ffffff;
    --table-header-bg: #f1f3f5;
    --disabled-bg: #f1f3f5;
    --progress: #d7d7d7;
    --progress-bg: #e0e0e0;

    /* Text-Farben */
    --text-primary: #212529;
    --text-muted: #3b3e41;
    --text-light: #ffffff;
    --text-dark: #121212;
    --text-silver: #adb5bd;

    /* Status-Farben */
    --success: #28a745;
    --success-bg: #e8f5e9;
    --success-text: #1b5e20;
    --error: #dc3545;
    --error-bg: #ffebee;
    --error-text: #c62828;
    --warning: #ffc107;
    --warning-bg: #ffeeba;
    --warning-light: #fff3cd;
    --warning-text: #856404;
    --accent: #007bff;
    --accent-action: #d32f2f;

    /* Struktur */
    --border-light: #dee2e6;
    --divider-white: rgba(255, 255, 255, 0.1);
    --divider-grey: #dee2e6;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

    --container-width: 900px;
    --header-height: 56px;
}

/* ================================================================
   1.5 OVERRIDE FÜR DARK MODE
================================================================ */
html[data-theme="dark"] {
    /* Hintergründe */
    --bg-main: #121212;
    --bg-dark: #000000;
    --bg-trans: rgba(18, 18, 18, 0.92);

    /* UI-Elemente */
    --card-bg: #1e1e1e;
    --card-content-bg: #181818;
    --input-bg: #2d2d2d;
    --table-header-bg: #2d2d2d;
    --disabled-bg: #222222;
    --progress-bg: #333333;

    /* Text-Farben */
    --text-primary: #e0e0e0;
    --text-muted: #e4e4e4;
    --text-dark: #ffffff;
    --warning-text: #1f1804;

    /* Status-Farben */
    --accent-action: #ff7070;

    /* Rahmen */
    --border-light: #333333;
    --divider-white: #333333;
    --divider-grey: rgba(222, 226, 230, 0.32);

    /* Status-Hintergründe */
    --success-bg: rgba(40, 167, 69, 0.15);
    --success-text: #81c784;
    --error-bg: rgba(220, 53, 69, 0.15);
    --error-text: #e57373;
    --warning-light: #81744e;
    --warning-bg: rgba(255, 255, 255, 0.25);
}

/* ================================================================
   2. BASIS & RESET
================================================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    scroll-behavior: smooth;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

h1, h2, h3, h4 {
    margin: 0.5em 0;
    color: var(--text-muted);
}

/* ================================================================
   3. LAYOUT & GRIDS
================================================================ */
.container { max-width: var(--container-width); margin: 0 auto; padding: 10px 15px; }
.container-narrow { max-width: 800px; margin: 0 auto; }

.main-content {
    padding-top: calc(var(--header-height) + 10px);
    padding-bottom: 120px;
    min-height: 100vh;
}

.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 5px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.grid-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

/* Globale SVG Use-Regel */
svg use {
    pointer-events: none;
}
svg {
    fill: none;
    stroke: currentColor;
}

/* ================================================================
   4. HEADER & NAVIGATION
================================================================ */
header {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--bg-dark); /* Bleibt immer dunkel */
    color: white; /* Text immer weiß */
    height: var(--header-height); 
    z-index: 10000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

header.admin-warning { background-color: var(--error) !important; }
header.header-error-state {
    border-bottom: 2px solid var(--error) !important;
    background: linear-gradient(to right, var(--bg-dark), rgba(220, 53, 69, 0.2), var(--bg-dark)) !important;
}
[data-theme="dark"] header.header-error-state {
    background: linear-gradient(to right, var(--bg-dark), rgba(220, 53, 69, 0.3), var(--bg-dark)) !important;
}

.header-inner {
    max-width: var(--container-width); margin: 0 auto;
    height: 100%; display: flex; align-items: center; padding: 0 15px; gap: 15px;
}

header .page-title { font-weight: 700; font-size: 1.1em; flex-grow: 1; color: white; }

/* Hamburger Button (Immer weiß) */
.menu-toggle { 
    background: none; border: none; color: white; font-size: 24px; cursor: pointer; 
    transition: transform 0.3s ease; 
}
body.menu-open .menu-toggle {
    transform: rotate(90deg);
}

.notification-dot {
    position: absolute; top: 5px; right: -2px;
    width: 10px; height: 10px; border-radius: 50%;
    background-color: var(--warning); 
    border: 2px solid var(--bg-dark); /* Passend zum dauerhaft dunklen Header */
    animation: pulse-dot 2s infinite;
}

/* =========================================
   HEADER ACTIONS (Immer weiß/hell)
   ========================================= */
.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    background: transparent; border: none; color: white; font-size: 1.3rem;
    cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease; user-select: none; opacity: 0.9;
}
.theme-toggle:hover { transform: scale(1.15); }
.theme-toggle:active { transform: scale(0.9); }

/* Language Selector native dropdown styling */
.lang-selector-wrapper { 
    position: relative; 
    display: flex; 
    align-items: center; 
}

.lang-icon {
    position: absolute;
    left: 8px;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none; /* Klicks gehen durch das Icon auf das Select */
}

.lang-selector-wrapper select { 
    appearance: none; 
    -webkit-appearance: none; 
    background: transparent; 
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white; 
    
    padding: 4px 22px 4px 28px; 
    
    border-radius: 4px; 
    font-size: 0.85em; 
    cursor: pointer; 
    font-weight: bold; 
    outline: none; 
    transition: border-color 0.2s;
}

.lang-selector-wrapper select:focus, 
.lang-selector-wrapper select:hover { 
    border-color: white; 
}

.lang-selector-wrapper select option { 
    background: #1a1a1a; 
    color: white; 
}

.lang-selector-arrow { 
    position: absolute; 
    right: 6px; 
    display: flex;
    align-items: center;
    pointer-events: none; 
    color: rgba(255, 255, 255, 0.7); 
}

/* =========================================
   FULLSCREEN MENU OVERLAY
   ========================================= */
body.menu-open { overflow: hidden; }

.fullscreen-menu-overlay { 
    position: fixed; top: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: var(--container-width); 
    height: 100vh; 
    padding-top: var(--header-height); /* Schiebt das Menü unter den fixierten Header */
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); 
    z-index: 9999; /* Bleibt unter dem Header (10000) */
    display: flex; flex-direction: column; opacity: 0; visibility: hidden; transform: translateY(-15px); 
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; box-shadow: 0 0 30px rgba(0,0,0,0.15); 
}

[data-theme="dark"] .fullscreen-menu-overlay { background: rgba(26, 26, 26, 0.95); }

.fullscreen-menu-overlay.active { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-content { padding: 20px; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; }
.menu-section-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 15px; font-weight: 700; }

.mobile-menu-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
}
.menu-tile { 
    /* flex-grow: 1 (erlaubt das Ausdehnen), flex-shrink: 1, flex-basis: exakt 1/3 minus die Gaps */
    flex: 1 1 calc((100% - 20px) / 3); 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: var(--bg-main);
    border: 1px solid var(--border-light); 
    border-radius: 12px; 
    padding: 12px 4px; 
    text-decoration: none; 
    color: var(--text-primary); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); 
    transition: transform 0.1s ease, border-color 0.2s ease; 
}
.menu-tile.active-tile {
    border-color: var(--accent, #007aff);
    background: color-mix(in srgb, var(--accent, #007aff) 8%, transparent);
}
.tile-icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }
.tile-label { font-size: 0.75rem; font-weight: 600; text-align: center; line-height: 1.2; word-break: break-word; padding: 0 2px; }

.menu-tile-small { padding: 10px 4px; } 
.menu-tile-small .tile-icon { font-size: 1.3rem; margin-bottom: 4px; }

.tile-badge { 
    position: absolute; top: -6px; right: -6px; background: #ff3b30; color: white; font-size: 0.7rem; font-weight: bold;
    padding: 2px 5px; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 2; 
}

/* =========================================
   MENU TILE ICONS (SVG)
   ========================================= */
.tile-icon { 
    margin-bottom: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: var(--text-primary); /* SVG erbt diese Farbe */
}

.tile-icon svg {
    width: 26px; 
    height: 26px;
    stroke: currentColor; /* Übernimmt Light/Dark Mode automatisch */
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.menu-tile-small .tile-icon svg {
    width: 22px;
    height: 22px;
}

/* Wenn das Menü aktiv ist, färbt sich das Icon in der Akzentfarbe */
.menu-tile.active-tile .tile-icon {
    color: var(--accent, #007aff);
}

/* ================================================================
   5. UI-KOMPONENTEN (KARTEN, ALERTS, BUTTONS, BADGES)
================================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--border-light);
    padding: 20px;
}

/* Alerts */
.alert { padding: 15px; border-radius: var(--radius-md); margin-bottom: 20px; border-left: 5px solid transparent; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error); }
.alert-warning { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning-bg); }

/* Buttons */
.btn {
    background: var(--bg-mid); color: var(--text-light); border: none; padding: 10px 20px;
    border-radius: var(--radius-md); cursor: pointer; font-weight: 600; transition: all 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
/* .btn:hover { background: var(--bg-hover); transform: translateY(-1px); } */
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--error); }
.btn-success { background: var(--success); }
.btn-info { background: #17a2b8; }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-primary); }

.btn-lang {
    display: flex; align-items: center; padding: 3px 8px; font-size: 0.85em; font-weight: 600;
    cursor: pointer; background: var(--input-bg); color: var(--text-primary);
    border: 1px solid var(--border-light); border-radius: var(--radius-sm); transition: all 0.2s ease-in-out;
    flex-shrink: 0; margin: 0;
}
.btn-lang:hover { border-color: var(--text-muted); background: var(--bg-main); }

/* Badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-admin { background: var(--error-bg); color: var(--error-text); border: 1px solid rgba(198, 40, 40, 0.2); }
.badge-inactive { background: var(--bg-light); color: var(--text-light); border: 1px solid rgba(198, 40, 40, 0.2); }
.badge-user { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(40, 167, 69, 0.2); }
.badge-guest { background: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border-light); }
.badge-pending { background: var(--warning-light); color: #2e2200; border: 1px solid rgba(255, 193, 7, 0.2); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-muted { background: var(--border-light); color: var(--text-muted); }
.badge-outline {
    background: var(--bg-main); border: 1px solid var(--border-light); color: var(--text-primary); font-size: 10px;
    padding: 2px 8px; border-radius: 4px;
}

#lang-select { color: white; background-color: transparent; }
#lang-select option { color: white; background-color: #1a1a1a; }
.lang-selector-arrow { color: white; }

/* Toast Notification Base */
.guest-toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg, #1e1e1e);
    color: var(--text-primary, #ffffff);
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--accent, #007aff);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Leichtes Bouncing */
    pointer-events: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Aktiver Zustand (Sichtbar) */
.guest-toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .guest-toast-container {
        width: 90%;
        white-space: normal; /* Auf dem Handy Zeilenumbruch erlauben */
        border-radius: var(--radius-md, 8px);
        text-align: center;
    }
}

/* =========================================
   FEATURE LIST ICONS (SVGs)
   ========================================= */
.feature-icon {
    display: flex;
    align-items: flex-start;
    color: var(--text-primary); /* Passt sich automatisch dem Hell/Dunkel-Modus an */
    /* Alternativ: color: var(--accent); falls sie farbig hervorgehoben werden sollen */
    margin-top: 2px; /* Gleicht die visuelle Höhe zum danebenstehenden Text aus */
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ================================================================
   6. FORMULARE & INPUTS
================================================================ */
.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9em; color: var(--text-dark); }

.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 16px; background: var(--card-bg); color: var(--text-primary);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,123,255,0.1); }

.checkbox-card {
    display: flex; align-items: center; gap: 10px; background: var(--bg-main);
    padding: 10px 15px; border-radius: var(--radius-md); border: 1px solid var(--border-light);
    cursor: pointer; font-weight: 600; font-size: 0.9em; transition: all 0.2s;
}
.checkbox-card:hover { border-color: var(--bg-hover); }
.checkbox-card input { margin: 0; width: 18px; height: 18px; cursor: pointer; }
.checkbox-card:has(input:checked) { background: var(--success-bg); border-color: var(--success); color: var(--success-text); }

.ios-toggle { position: relative; display: inline-block; width: 32px; height: 18px; flex-shrink: 0; }
.ios-toggle input { opacity: 0; width: 0; height: 0; }
.ios-toggle .slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-light);
    transition: .3s; border-radius: 20px;
}
.ios-toggle .slider:before {
    position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: white; transition: .3s;
    border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ios-toggle input:checked + .slider { background-color: var(--success); }
.ios-toggle input:checked + .slider:before { transform: translateX(14px); }

/* ================================================================
   7. PAGE: POKÉDEX (dex.php)
================================================================ */
.dex-filters { 
    position: -webkit-sticky !important; position: sticky !important; 
    top: var(--header-height) !important; z-index: 1800 !important;
    background: var(--bg-trans); backdrop-filter: blur(10px); 
    margin-top: -15px !important; margin-bottom: -5px !important; padding: 10px 0; 
    display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px; width: 100%; 
}

.variant-flags {
    margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-light);
}
.custom-multiselect {
    position: relative; flex: 1; min-width: 130px; max-width: 180px; 
}
.multiselect-btn {
    background: var(--bg-main); border: 1px solid var(--border-light); border-radius: 4px; padding: 4px 25px 4px 8px; font-size: 0.85em;
    cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; user-select: none; display: flex; align-items: center;
    justify-content: space-between; height: 100%; color: var(--text-primary);
}
.multiselect-btn::after {
    content: '▼'; font-size: 0.8em; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted);
}
.multiselect-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; min-width: 200px; background: var(--bg-main); border: 1px solid var(--border-light);
    border-radius: 6px; z-index: 1000; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); max-height: 450px; overflow-y: auto; display: none;
}
.multiselect-dropdown.show {
    display: block;
}
.multiselect-option {
    display: flex; align-items: center; padding: 10px; cursor: pointer; font-size: 0.85em; border-bottom: 1px solid var(--border-light);
    margin: 0 !important; color: var(--text-primary);
}
.multiselect-option:last-child {
    border-bottom: none;
}
.multiselect-option input {
    margin-right: 10px; cursor: pointer;
}

.card-header { padding: 2px 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.card-content { padding: 12px 15px; border-top: 1px solid var(--border-light); background: var(--card-content-bg); border-radius: 4px;}
.collapsed .card-content { display: none; }

#cards-container.filter-hide-complete .is-complete { display: none !important; }
#cards-container.filter-hide-unreleased .not-released { display: none !important; }

.is-complete { border-left: 6px solid var(--success); background: linear-gradient(to right, var(--success-bg), var(--card-bg)) !important; }
.not-released { background: var(--disabled-bg) !important; opacity: 0.7; }
.needs-action { border-color: var(--accent-action) !important; color: var(--accent-action); font-weight: bold; animation: pulse-border 2s infinite; }

.dex-num { font-family: monospace; font-size: 0.85em; color: var(--text-muted); margin-right: 12px; }
.pokemon-name { font-weight: 700; font-size: 1.05em; color: var(--text-dark); }

.type-icons-wrapper { min-width: 90px; display: inline-flex; gap: 6px; margin-right: 18px; }
.type-pill {
    width: 40px; height: 18px; border-radius: 4px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 10px;
    font-weight: 800; color: #fff; text-transform: uppercase;
}

.type-1 { background: #A8A77A; } .type-2 { background: #E2BF65; }
.type-3 { background: #6F35FC; } .type-4 { background: #96D9D6; }
.type-5 { background: #F7D02C; } .type-6 { background: #D685AD; }
.type-7 { background: #EE8130; } .type-8 { background: #A98FF3; }
.type-9 { background: #B6A136; } .type-10 { background: #735797; }
.type-11 { background: #A33EA1; } .type-12 { background: #A6B91A; }
.type-13 { background: #C22E28; } .type-14 { background: #7AC74C; }
.type-15 { background: #F95587; } .type-16 { background: #B7B7CE; }
.type-17 { background: #705746; } .type-18 { background: #6390F0; }

.flags, .variant-flags { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); 
    gap: 8px; 
    align-items: start;
}

.dexcards label, .variant-flags label { 
    font-size: 12px; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    padding: 6px; 
    background: var(--card-bg); 
    border: 1px solid var(--border-light); 
    border-radius: 6px; 
    cursor: pointer; 
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.dexcards label:has(input:checked), .variant-flags label:has(input:checked) { 
    background: var(--success-bg); 
    border-color: var(--success); 
    color: var(--success-text); 
    font-weight: bold; 
}

.variant-group-box { 
    display: flex; 
    flex-direction: column; 
    gap: 0px; 
    width: 100%; 
}

/* Circular Progress */
.progress-text { font-size: 11px; background: rgba(0,0,0,0.05); padding: 2px 8px; border-radius: 20px; font-weight: 800; color: var(--text-muted); }
.circular-progress { 
    position: relative; width: 38px; height: 38px; border-radius: 50%;
    background: conic-gradient(#4caf50 calc(var(--progress) * 1%), var(--progress-bg) 0); display: flex; 
    align-items: center; justify-content: center; flex-shrink: 0; 
}
.circular-progress::before { content: ""; position: absolute; width: 30px; height: 30px; border-radius: 50%; background-color: var(--bg-main); }
.progress-value { position: relative; font-size: 0.7rem; font-weight: bold; color: var(--text-primary); }

.progress-dropdown-wrapper { position: relative; display: inline-block; }
#global-progress-ring { cursor: pointer; transition: transform 0.2s ease; }
#global-progress-ring:hover { transform: scale(1.05); }

.progress-details {
    position: absolute; top: 100%; left: 0; margin-top: 12px; padding: 12px; width: 240px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius-md); border: 2px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box, linear-gradient(135deg, var(--success), var(--accent)) border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.progress-details::before {
    content: ''; position: absolute; top: -6px; left: 15px; width: 10px; height: 10px; background: var(--card-bg);
    border-top: 2px solid var(--success); border-left: 2px solid var(--success); transform: rotate(45deg);
}
.progress-detail-item {
    display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-primary);
    border-bottom: 1px solid var(--divider-grey); padding-bottom: 4px;
}
.progress-detail-item:last-child { border-bottom: none; padding-bottom: 0; }
.progress-detail-val { font-weight: bold; font-family: monospace; }

/* ================================================================
   9. PAGE: EVENTS (events.php)
================================================================ */
.filter-chips-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.filter-chip {
    padding: 6px 14px; border-radius: 20px; font-size: 0.8em; font-weight: bold; text-transform: uppercase;
    cursor: pointer; border: 1px solid var(--border-light); background: var(--card-bg); color: var(--text-muted);
    transition: all 0.2s; user-select: none; opacity: 0.5; filter: grayscale(100%);
}
.filter-chip.active { background: var(--bg-hover); color: var(--text-light); border-color: var(--bg-hover); opacity: 1; filter: grayscale(0%); }

.event-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.event-item {
    background: var(--bg-main); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 12px 15px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
    gap: 15px; transition: transform 0.2s;
}
.event-item:hover { transform: translateX(4px); }

.event-title-container { flex: 1 1 auto; min-width: 0; }
.event-title { font-size: 1.05em; font-weight: bold; line-height: 1.3; color: var(--text-primary); margin: 0; word-wrap: break-word; }
.event-heading { font-size: 0.85em; color: var(--text-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.event-meta-container { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
.event-badge-row { display: flex; align-items: center; gap: 6px; }

.time-row { display: flex; justify-content: space-between; gap: 10px; }
.live-dot { height: 8px; width: 8px; background-color: var(--error); border-radius: 50%; display: inline-block; animation: pulse-dot 2s infinite; }

/* ================================================================
   10. PAGE: BACKLOG & MODALS (backlog.php)
================================================================ */
.ticket-card { border-left: 4px solid var(--border-light); }
.ticket-card.type-bug { border-left-color: var(--error); }
.ticket-card.type-feature { border-left-color: var(--accent); }

.admin-reply-box { background: var(--bg-main); border-radius: var(--radius-sm); padding: 10px 15px; margin-top: 15px; border: 1px solid var(--border-light); }

.status-group-header { font-size: 1.1em; margin: 25px 0 5px 0; padding-bottom: 5px; border-bottom: 2px solid var(--border-light); color: var(--text-primary); }
.status-group-header:first-of-type { margin-top: 0; }

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--card-bg); padding: 25px; border-radius: var(--radius-lg); width: 90%; max-width: 500px; }

/* ================================================================
   11. PAGE: CHANGELOG (changelog.php)
================================================================ */
.changelog-group { background: var(--bg-main); border: 1px solid var(--border-light); border-radius: var(--radius-md); margin-bottom: 20px; overflow: hidden; }
.changelog-summary {
    padding: 15px 20px; font-size: 1.1em; font-weight: bold; cursor: pointer; background: rgba(0,0,0,0.02); list-style: none;
    display: flex; justify-content: space-between; align-items: center; user-select: none;
}
.changelog-summary::-webkit-details-marker { display: none; }
.changelog-content { padding: 20px; display: flex; flex-direction: column; gap: 20px; border-top: 1px solid var(--border-light); }
.summary-icon { transition: transform 0.3s ease; font-size: 0.9em; color: var(--text-muted); }
.changelog-group[open] .summary-icon { transform: rotate(180deg); }

/* ================================================================
   12. SEARCH & SEARCH STRINGS
================================================================ */
.search-container {
    position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-trans); backdrop-filter: blur(15px); padding: 12px;
    border-top: 1px solid var(--border-light); z-index: 1500;
}
.search-inner { max-width: var(--container-width); margin: 0 auto; display: flex; justify-content: center; align-items: center; gap: 10px; }
.search-wrapper { position: relative; flex: 1; max-width: 450px; }

#pokemon-search { color: var(--text-primary); background: var(--input-bg); padding: 10px 40px 10px 12px !important; width: 100%;
    border: 1px solid var(--border-light); border-radius: var(--radius-md); font-size: 16px; outline: none;
}
#pokemon-search::placeholder { color: var(--text-muted); opacity: 1; }

.search-clear, .search-clear-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted);
    font-size: 1.2rem; line-height: 1; z-index: 10; padding: 5px; user-select: none;
}

.search-string-wrapper { width: 100%; }
.clickable-input {
    width: 100% !important; padding: 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
    background: var(--input-bg); color: var(--text-dark); cursor: pointer; text-align: left; font-family: monospace;
    font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clickable-input.copy-success { background: var(--success-bg) !important; border-color: var(--success) !important; color: var(--success-text) !important; }

/* ================================================================
   13. TABELLEN & LISTEN
================================================================ */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-light); }
.table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { background: var(--table-header-bg); font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }

.col-id { width: 70px; color: var(--text-muted); font-family: monospace; }
.text-mono { font-family: monospace !important; }

.step-list { display: flex; flex-direction: column; gap: 15px; margin: 15px 0; }
.step-item {
    display: flex; align-items: flex-start; gap: 15px; background: var(--card-bg); padding: 15px; border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
.step-number {
    width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent);
    color: var(--card-bg); border-radius: 50%; font-weight: 700; font-size: 14px;
}
.step-number-warning { background: var(--warning); color: #856404; }
.step-number-success { background: var(--success); color: var(--card-bg); }
.step-content { flex: 1; font-size: 0.95em; line-height: 1.5; color: var(--text-dark); padding-top: 4px; }

/* ================================================================
   14. UTILITIES & ANIMATIONEN
================================================================ */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-xs { font-size: 0.75rem !important; }
.font-bold { font-weight: 700 !important; }
.text-muted { color: var(--text-muted) !important; }
.mb-20 { margin-bottom: 20px !important; }
.mt-10 { margin-top: 10px !important; }
.m-0 { margin: 0 !important; }
.p-0 { padding: 0 !important; }
.w-full { width: 100% !important; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.items-center { align-items: center; }

.emoji-gray { filter: grayscale(100%); opacity: 0.8; }
.list-end-spacer { height: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.9em; font-style: italic; }
.main-footer { text-align: center; padding: 40px 15px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border-light); margin-top: 20px; }
.help-section { scroll-margin-top: calc(var(--header-height) + 20px); }

.support-details summary::-webkit-details-marker { display: none; }
.support-details summary { list-style: none; }
.support-details summary::after { content: '▼'; margin-left: auto; font-size: 0.8em; color: var(--text-muted); transition: transform 0.2s ease; }
.support-details[open] summary::after { transform: rotate(180deg); }

.saved { background-color: var(--success-bg) !important; transition: background 0.5s; }
.highlight { border: 2px solid var(--accent) !important; animation: flash 2s; }

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse-border { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); } 70% { box-shadow: 0 0 0 5px rgba(220, 53, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes flash { 0%, 100% { background: transparent; } 50% { background: var(--warning-light); } }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(255, 193, 7, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); } }
@keyframes pulse-opacity {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.pulse-anim {
    animation: pulse-opacity 2s infinite ease-in-out;
}
/* ==========================================================================
   Responsive Data Cards (Tabellen auf Handys als Karten darstellen)
   ========================================================================== */
@media (max-width: 476px) {
    /* Alle Tabellen-Elemente zu Block-Elementen machen */
    .table-mobile-cards, 
    .table-mobile-cards thead, 
    .table-mobile-cards tbody, 
    .table-mobile-cards th, 
    .table-mobile-cards td, 
    .table-mobile-cards tr {
        display: block;
    }
    
    /* Tabellenkopf visuell verstecken (für Screenreader bleibt er erhalten) */
    .table-mobile-cards thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* Jede Zeile (tr) wird zu einer eigenständigen Karte */
    .table-mobile-cards tr {
        border: 1px solid var(--border-light, #ddd);
        border-radius: var(--radius-md, 8px);
        margin-bottom: 15px;
        background-color: var(--card-bg, #fff);
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    
    /* Die einzelnen Zellen (td) innerhalb der Karte formatieren */
    .table-mobile-cards td {
        border: none;
        border-bottom: 1px solid var(--border-light, #eee);
        position: relative;
        padding: 8px 0;
        padding-left: 35%; /* Macht Platz für das generierte Label */
        text-align: right; /* Setzt den Text nach rechts, weg vom Label */
        min-height: 32px;
    }
    
    /* Letzte Zelle bekommt keine Linie mehr */
    .table-mobile-cards td:last-child {
        border-bottom: 0;
    }

    /* Vollautomatische Labels aus dem HTML-Attribut "data-label" generieren */
    .table-mobile-cards td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 30%;
        padding-right: 10px;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted, #666);
        white-space: nowrap;
    }

    /* Optionale Helfer-Klasse für Zellen, die die volle Breite brauchen (z.B. lange Nachrichten) */
    .table-mobile-cards td.full-width-mobile {
        padding-left: 0;
        text-align: left;
    }
    .table-mobile-cards td.full-width-mobile::before {
        position: relative;
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }
}
