/* ============================================================
   eCoach Schuldatenbank [ec_school_db]
   ============================================================ */

.ec-school-db {
    font-family: inherit;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Filter-Panel ─────────────────────────────────────────── */
.ec-sdb-filter {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.ec-sdb-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.ec-sdb-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    flex: 1;
}

.ec-sdb-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ec-sdb-select {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #1e293b;
    width: 100%;
    cursor: pointer;
}

.ec-sdb-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── Suche + Buttons ──────────────────────────────────────── */
.ec-sdb-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.ec-sdb-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
}

.ec-sdb-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.ec-sdb-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.ec-sdb-btn-primary {
    background: #1e3a5f;
    color: #fff;
}
.ec-sdb-btn-primary:hover { background: #2d5a8e; }

.ec-sdb-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.ec-sdb-btn-secondary:hover { background: #e2e8f0; }

.ec-sdb-btn-save {
    background: transparent;
    color: #0369a1;
    border: 1px solid #93c5fd;
}
.ec-sdb-btn-save:hover { background: #eff6ff; }

/* ── Ergebnisbereich ──────────────────────────────────────── */
.ec-sdb-results {
    min-height: 80px;
}

.ec-sdb-hint,
.ec-sdb-loading {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
}

.ec-sdb-count {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

/* ── Kacheln ──────────────────────────────────────────────── */
.ec-sdb-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ec-sdb-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ec-sdb-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.ec-sdb-card--oer {
    border-left: 4px solid #22c55e;
}

.ec-sdb-card--unit {
    border-left: 4px solid #3b82f6;
}

.ec-sdb-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ec-sdb-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ec-sdb-badge--oer  { background: #dcfce7; color: #166534; }
.ec-sdb-badge--unit { background: #dbeafe; color: #1d4ed8; }

.ec-sdb-license {
    font-size: 11px;
    color: #166534;
    background: #f0fdf4;
    padding: 2px 6px;
    border-radius: 4px;
}

.ec-sdb-author {
    font-size: 12px;
    color: #64748b;
}

.ec-sdb-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.ec-sdb-card-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.ec-sdb-card-actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ec-sdb-action {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.ec-sdb-action--start {
    background: #1e3a5f;
    color: #fff;
}
.ec-sdb-action--start:hover { background: #2d5a8e; color: #fff; }

.ec-sdb-action--book {
    background: #3b82f6;
    color: #fff;
}
.ec-sdb-action--book:hover { background: #2563eb; color: #fff; }

.ec-sdb-action--open {
    background: #dcfce7;
    color: #166534;
}
.ec-sdb-action--open:hover { background: #bbf7d0; color: #166534; }

.ec-sdb-action--save {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.ec-sdb-action--save:hover { background: #e2e8f0; }
.ec-sdb-action--save:disabled { opacity: 0.6; cursor: default; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .ec-sdb-filter-row { flex-direction: column; }
    .ec-sdb-filter-group { min-width: 100%; }
    .ec-sdb-cards { grid-template-columns: 1fr; }
    .ec-sdb-search-row { flex-direction: column; align-items: stretch; }
    .ec-sdb-search { min-width: 0; }
}
