/* ============================================================
   FokusLeser – Fokus-Lesemodus  |  assets/fokusleser.css
   ============================================================ */

/* ── Lese-Fortschrittsbalken ─────────────────────────────── */
#fokusleser-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    z-index: 99999;
    pointer-events: none;
}

#fokusleser-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6c63ff, #48cae4);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Toolbar ─────────────────────────────────────────────── */
#fokusleser-toolbar {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99998;
    animation: fokusleser-fadein 0.4s ease;
}

@keyframes fokusleser-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#fokusleser-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 40px;
    padding: 7px 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    color: #444;
    user-select: none;
}

/* ── Lesezeit ────────────────────────────────────────────── */
#fokusleser-reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    white-space: nowrap;
    padding-right: 6px;
    border-right: 1px solid #e0e0e0;
}

/* ── Schriftgröße-Kontrolle ──────────────────────────────── */
#fokusleser-font-controls {
    display: flex;
    gap: 2px;
    padding: 0 6px;
    border-right: 1px solid #e0e0e0;
}

#fokusleser-font-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: background 0.15s;
    line-height: 1;
}

#fokusleser-font-controls button:hover {
    background: #f0f0f0;
    color: #222;
}

/* ── Fokus-Modus-Button ──────────────────────────────────── */
#fokusleser-focus-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    color: #555;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

#fokusleser-focus-btn:hover {
    background: #f0f0ff;
    color: #6c63ff;
}

#fokusleser-focus-btn[aria-pressed="true"] {
    background: #6c63ff;
    color: #fff;
}

#fokusleser-focus-btn[aria-pressed="true"] svg {
    stroke: #fff;
}

/* ── Fokus-Modus aktiv ───────────────────────────────────── */
body.fokusleser-focus-active #fokusleser-toolbar-inner {
    box-shadow: 0 4px 32px rgba(108, 99, 255, .25);
}

/* Alles ausblenden was nicht der Artikel ist */
body.fokusleser-focus-active #fokusleser-focus-overlay {
    display: block;
}

#fokusleser-focus-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    z-index: 9990;
    pointer-events: none;
    animation: fokusleser-overlayin 0.3s ease;
}

@keyframes fokusleser-overlayin {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Artikel im Fokus-Modus nach vorne holen */
body.fokusleser-focus-active .entry-content,
body.fokusleser-focus-active .post-content,
body.fokusleser-focus-active article .content,
body.fokusleser-focus-active .single-post-content,
body.fokusleser-focus-active [itemprop="articleBody"] {
    position: relative;
    z-index: 9991;
    background: #fff;
    border-radius: 4px;
}

/* ── Absatz-Spotlight ────────────────────────────────────── */
.fokusleser-spotlight-active p,
.fokusleser-spotlight-active li,
.fokusleser-spotlight-active blockquote {
    transition: opacity 0.25s ease, color 0.25s ease;
    opacity: 0.35;
}

.fokusleser-spotlight-active .fokusleser-para-focus {
    opacity: 1 !important;
    color: #111 !important;
}

/* ── Lesezeichen-Banner ──────────────────────────────────── */
#fokusleser-bookmark-banner {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid rgba(108, 99, 255, .3);
    border-radius: 40px;
    padding: 9px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    color: #444;
    z-index: 99997;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    animation: fokusleser-fadein 0.4s ease;
    white-space: nowrap;
}

#fokusleser-bookmark-banner[hidden] {
    display: none;
}

#fokusleser-bookmark-goto {
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

#fokusleser-bookmark-goto:hover {
    background: #574fd6;
}

#fokusleser-bookmark-dismiss {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

#fokusleser-bookmark-dismiss:hover {
    color: #555;
}

/* ── Responsive: Toolbar auf Mobile anpassen ─────────────── */
@media (max-width: 480px) {
    #fokusleser-toolbar {
        bottom: 16px;
        right: 50%;
        transform: translateX(50%);
    }

    #fokusleser-focus-label {
        display: none;
    }

    #fokusleser-bookmark-banner {
        font-size: 12px;
        padding: 8px 14px;
    }
}
/* Dark Mode Styles */
body.fokusleser-dark-mode {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.fokusleser-dark-mode #fokusleser-toolbar-inner {
    background: #2d2d2d;
    border-color: #444;
    color: #eee;
}

body.fokusleser-dark-mode #fokusleser-font-controls button {
    color: #ccc;
}

/* Den Fokus-Overlay im Dark Mode noch dunkler machen */
body.fokusleser-dark-mode #fokusleser-focus-overlay {
    background: rgba(15, 15, 15, 0.95);
}
/* ── Fokus-Overlay Element ───────────────────────────────── */
/* Wird per JS eingefügt */
/* TOC Popup */
#fokusleser-toc-popup {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 250px;
    max-height: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 15px;
    overflow-y: auto;
    z-index: 100000;
}

#fokusleser-toc-popup a {
    display: block;
    padding: 5px 0;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

#fokusleser-toc-popup a:hover { color: #6c63ff; }

/* Glückwunsch-Meldung am Ende */
.fokusleser-stats-card {
    background: #f9f9ff;
    border: 2px dashed #6c63ff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 40px 0;
    font-family: inherit;
}