/* ============================================================
   eCoach [ec_tree_overview] Shortcode
   ============================================================ */

.ec-tree-overview {
    font-family: inherit;
    max-width: 900px;
    margin: 0 auto 40px;
}

/* ── Header ───────────────────────────────────────────────── */
.ec-tov-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1e3a5f;
}

.ec-tov-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}

/* ── Knoten allgemein ─────────────────────────────────────── */
.ec-tov-node {
    margin-bottom: 2px;
}

.ec-tov-node-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 5px;
    transition: background 0.15s;
    user-select: none;
}

/* Klickbar-Cursor nur für Knoten mit Kindern */
.ec-tov-has-children > .ec-tov-node-header {
    cursor: pointer;
}

/* ── Toggle-Pfeil ─────────────────────────────────────────── */
.ec-tov-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    min-width: 16px;
    margin-top: 3px;
}

.ec-tov-toggle::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

/* Zugeklappt: Pfeil zeigt nach rechts */
.ec-tov-collapsed > .ec-tov-node-header .ec-tov-toggle::before {
    transform: rotate(-90deg);
}

/* ── Blatt-Indikator (kein Unterpunkt) ───────────────────── */
.ec-tov-leaf {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    min-width: 16px;
    margin-top: 3px;
}

.ec-tov-leaf::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* Endpunkt-Blatt in Amber */
.ec-tov-endpoint > .ec-tov-node-header .ec-tov-leaf::before {
    background: #f59e0b;
}

/* ── Knoteninhalt ─────────────────────────────────────────── */
.ec-tov-node-content {
    flex: 1;
    min-width: 0;
}

.ec-tov-node-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    display: inline;
}

a.ec-tov-node-title:hover {
    color: #1e3a5f;
    text-decoration: underline;
}

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

/* ── Tiefe 1: Hauptbereiche ───────────────────────────────── */
.ec-tov-depth-1 > .ec-tov-node-header {
    background: #1e3a5f;
    border-radius: 6px;
    margin-bottom: 2px;
}

.ec-tov-depth-1 > .ec-tov-node-header .ec-tov-node-title {
    color: #fff;
    font-size: 16px;
}

.ec-tov-depth-1 > .ec-tov-node-header .ec-tov-node-desc {
    color: #bfdbfe;
}

.ec-tov-depth-1 > .ec-tov-node-header .ec-tov-toggle {
    color: rgba(255, 255, 255, 0.65);
}

.ec-tov-depth-1 > .ec-tov-node-header .ec-tov-leaf::before {
    background: rgba(255, 255, 255, 0.4);
}

.ec-tov-depth-1.ec-tov-has-children > .ec-tov-node-header:hover {
    background: #162d4a;
}

/* ── Tiefe 2 ──────────────────────────────────────────────── */
.ec-tov-depth-2 > .ec-tov-node-header {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    margin-left: 20px;
}

.ec-tov-depth-2 > .ec-tov-node-header .ec-tov-node-title {
    color: #1e3a5f;
}

.ec-tov-depth-2 > .ec-tov-node-header .ec-tov-toggle {
    color: #3b82f6;
}

.ec-tov-depth-2.ec-tov-has-children > .ec-tov-node-header:hover {
    background: #dbeafe;
}

/* Endpunkt Tiefe 2 */
.ec-tov-endpoint.ec-tov-depth-2 > .ec-tov-node-header {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

/* ── Tiefe 3 ──────────────────────────────────────────────── */
.ec-tov-depth-3 > .ec-tov-node-header {
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    margin-left: 44px;
}

.ec-tov-depth-3 > .ec-tov-node-header .ec-tov-toggle {
    color: #94a3b8;
}

.ec-tov-depth-3.ec-tov-has-children > .ec-tov-node-header:hover {
    background: #f1f5f9;
}

/* Endpunkt Tiefe 3 */
.ec-tov-endpoint.ec-tov-depth-3 > .ec-tov-node-header {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

/* ── Tiefe 4 ──────────────────────────────────────────────── */
.ec-tov-depth-4 > .ec-tov-node-header {
    background: transparent;
    border-left: 2px solid #e2e8f0;
    margin-left: 68px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.ec-tov-depth-4 > .ec-tov-node-header .ec-tov-node-title {
    font-size: 14px;
}

.ec-tov-depth-4 > .ec-tov-node-header .ec-tov-toggle {
    color: #cbd5e1;
}

.ec-tov-depth-4.ec-tov-has-children > .ec-tov-node-header:hover {
    background: #f8fafc;
}

/* Endpunkt Tiefe 4 */
.ec-tov-endpoint.ec-tov-depth-4 > .ec-tov-node-header {
    border-left-color: #fbbf24;
}

/* ── Tiefe 5 ──────────────────────────────────────────────── */
.ec-tov-depth-5 > .ec-tov-node-header {
    background: transparent;
    border-left: 2px solid #f1f5f9;
    margin-left: 92px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.ec-tov-depth-5 > .ec-tov-node-header .ec-tov-node-title {
    font-size: 13px;
    font-weight: 500;
}

.ec-tov-depth-5 > .ec-tov-node-header .ec-tov-toggle {
    color: #e2e8f0;
}

/* Endpunkt Tiefe 5 */
.ec-tov-endpoint.ec-tov-depth-5 > .ec-tov-node-header {
    border-left-color: #fde68a;
}

/* ── Zugeklappt: Kinder verstecken ───────────────────────── */
.ec-tov-collapsed > .ec-tov-children {
    display: none;
}

.ec-tov-collapsed > .ec-tov-more {
    display: none;
}

/* ── Kinder-Container ─────────────────────────────────────── */
.ec-tov-children {
    margin-top: 2px;
}

.ec-tov-depth-1 > .ec-tov-children {
    margin-bottom: 16px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

/* ── "Mehr"-Hinweis ───────────────────────────────────────── */
.ec-tov-more {
    padding: 4px 14px;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.ec-tov-depth-1 > .ec-tov-more { margin-left: 20px; }
.ec-tov-depth-2 > .ec-tov-more { margin-left: 44px; }
.ec-tov-depth-3 > .ec-tov-more { margin-left: 68px; }
.ec-tov-depth-4 > .ec-tov-more { margin-left: 92px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .ec-tov-depth-2 > .ec-tov-node-header { margin-left: 10px; }
    .ec-tov-depth-3 > .ec-tov-node-header { margin-left: 22px; }
    .ec-tov-depth-4 > .ec-tov-node-header { margin-left: 34px; }
    .ec-tov-depth-5 > .ec-tov-node-header { margin-left: 46px; }

    .ec-tov-depth-1 > .ec-tov-more { margin-left: 10px; }
    .ec-tov-depth-2 > .ec-tov-more { margin-left: 22px; }
    .ec-tov-depth-3 > .ec-tov-more { margin-left: 34px; }
    .ec-tov-depth-4 > .ec-tov-more { margin-left: 46px; }
}
