/* ============================================================
   ITE easyVerein – Public Member Styles
   Nutzt CSS-Variablen vom Theme / vom Admin-Panel
   ============================================================ */

:root {
    --ite-ev-primary:     var(--wp--preset--color--primary, #1d4ed8);
    --ite-ev-columns:     3;
    --ite-ev-avatar-size: 80px;
    --ite-ev-radius:      8px;
    --ite-ev-gap:         1.25rem;
    --ite-ev-card-bg:     #fff;
    --ite-ev-border:      #e2e8f0;
    --ite-ev-text:        inherit;
    --ite-ev-muted:       #64748b;
}

/* ── Wrapper ── */
.ite-ev-wrapper {
    font-family: inherit;
    color: var(--ite-ev-text);
}

/* ── Suchfeld ── */
.ite-ev-search-wrap {
    margin-bottom: 1.5rem;
}
.ite-ev-search {
    width: 100%;
    max-width: 400px;
    padding: .6rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--ite-ev-border);
    border-radius: 999px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ite-ev-search:focus {
    border-color: var(--ite-ev-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ite-ev-primary) 15%, transparent);
}

/* ── No results ── */
.ite-ev-no-results,
.ite-ev-empty {
    padding: 2rem;
    text-align: center;
    color: var(--ite-ev-muted);
    font-style: italic;
}

/* ============================================================
   KARTEN-MODUS
   ============================================================ */
.ite-ev-mode-cards .ite-ev-grid {
    display: grid;
    grid-template-columns: repeat(var(--ite-ev-columns), minmax(0, 1fr));
    gap: var(--ite-ev-gap);
}
@media (max-width: 900px) {
    .ite-ev-mode-cards .ite-ev-grid {
        grid-template-columns: repeat(min(var(--ite-ev-columns), 2), minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .ite-ev-mode-cards .ite-ev-grid {
        grid-template-columns: 1fr;
    }
}

.ite-ev-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.25rem;
    background: var(--ite-ev-card-bg);
    border: 1px solid var(--ite-ev-border);
    border-radius: var(--ite-ev-radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .2s;
}
.ite-ev-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

/* Avatar */
.ite-ev-avatar {
    width: var(--ite-ev-avatar-size);
    height: var(--ite-ev-avatar-size);
    border-radius: var(--ite-ev-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.ite-ev-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.ite-ev-initials {
    width: var(--ite-ev-avatar-size);
    height: var(--ite-ev-avatar-size);
    border-radius: var(--ite-ev-radius);
    background: var(--ite-ev-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--ite-ev-avatar-size) * .38);
    font-weight: 700;
    letter-spacing: .05em;
    user-select: none;
}
.ite-ev-initials--sm {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 50%;
}

.ite-ev-card-body { width: 100%; }

.ite-ev-name {
    margin: 0 0 .25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ite-ev-primary);
}
.ite-ev-company {
    margin: 0 0 .35rem;
    font-size: .875rem;
    color: var(--ite-ev-muted);
    font-weight: 500;
}
.ite-ev-city, .ite-ev-email, .ite-ev-website {
    margin: .2rem 0;
    font-size: .8rem;
    color: var(--ite-ev-muted);
}
.ite-ev-city .ite-ev-icon { margin-right: 3px; }
.ite-ev-email a, .ite-ev-website a {
    color: var(--ite-ev-primary);
    text-decoration: none;
    word-break: break-all;
}
.ite-ev-email a:hover, .ite-ev-website a:hover { text-decoration: underline; }

/* Badges (Gruppen) */
.ite-ev-groups {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    margin-top: .5rem;
}
.ite-ev-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ite-ev-primary) 10%, transparent);
    color: var(--ite-ev-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ============================================================
   TABELLEN-MODUS
   ============================================================ */
.ite-ev-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ite-ev-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
}
.ite-ev-table thead tr {
    background: var(--ite-ev-primary);
    color: #fff;
}
.ite-ev-table thead th {
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ite-ev-table tbody tr {
    border-bottom: 1px solid var(--ite-ev-border);
    transition: background .1s;
}
.ite-ev-table tbody tr:last-child { border-bottom: none; }
.ite-ev-table tbody tr:hover { background: color-mix(in srgb, var(--ite-ev-primary) 5%, transparent); }
.ite-ev-table td {
    padding: .75rem 1rem;
    vertical-align: middle;
}

/* Avatar in Tabelle */
.ite-ev-table-avatar {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 10px;
}
.ite-ev-table-avatar img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    vertical-align: middle;
}

/* ============================================================
   LISTEN-MODUS
   ============================================================ */
.ite-ev-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ite-ev-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .5rem;
    border-bottom: 1px solid var(--ite-ev-border);
    transition: background .1s;
}
.ite-ev-list-item:last-child { border-bottom: none; }
.ite-ev-list-item:hover { background: color-mix(in srgb, var(--ite-ev-primary) 4%, transparent); }

.ite-ev-list-avatar img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}
.ite-ev-list-content .ite-ev-name { font-weight: 600; }
.ite-ev-list-content .ite-ev-company { color: var(--ite-ev-muted); font-size: .875rem; }

/* ── Fehler-Box (nur für Admins) ── */
.ite-ev-error {
    border-left: 4px solid #dc2626 !important;
    padding: .75rem 1rem;
    margin: 1rem 0;
}

/* ── Versteckte Elemente (Suche) ── */
[hidden] { display: none !important; }
