/* =========================================================
   Skill Tandem – Home / Entdecken Seite
   Ausgelagert aus base_app/templates/base_app/home.html
   - Bookmark-Overlay
   - Profil-Cards
   - Mobile Filter-FAB + Panel
   - Tools-FAB + Slide-in Panel
   - Onboarding-Tour (Overlay / Spotlight / Tooltip)
   ========================================================= */

/* --------- Bookmark-Overlay auf Profil-Bild --------- */
.bookmark-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
    font-size: 1.15rem;
    line-height: 1;
}

.bookmark-overlay:hover {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transform: scale(1.08);
}

/* --------- Profil-Cards: Bild immer gleich groß wie Karte --------- */
.card .row.g-0 > .col-md-4 {
    min-height: 180px;
}

.card .row.g-0 > .col-md-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------- Mobile Filter-FAB + Overlay-Panel --------- */
.filter-fab {
    position: fixed;
    /* Über dem Tools-FAB (tools-fab: bottom 24px + 50px Höhe + 12px Abstand) */
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    right: calc(24px + env(safe-area-inset-right, 0px));
    z-index: 1048;
    width: 50px;
    height: 50px;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(4, 75, 217, 0.3);
    display: none;
}

@media (max-width: 1399px) {
    .filter-fab {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    #filterPanel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1060;
        background: #fff;
        padding: 20px;
        overflow-y: auto;
        margin: 0 !important;
        max-width: 100% !important;
    }

    #filterPanel.filter-open {
        display: block !important;
    }
}

@media (max-width: 576px) {
    .filter-fab {
        /* Über dem Tools-FAB (mobile: bottom 16px + 46px + 10px Abstand) */
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        left: auto;
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}

/* --------- Tools-FAB + Slide-in Panel --------- */
.tools-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color, #044BD9);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(4, 75, 217, 0.35);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tools-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(4, 75, 217, 0.45);
}

.tools-fab.hidden {
    display: none;
}

.tools-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1050;
    width: 340px;
    max-width: 100%;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px 0 0 0;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    padding: 20px;
    transform: translateX(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    will-change: transform;
}

.tools-panel.open {
    transform: translateX(0);
}

.tools-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.tools-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.tools-panel-close:hover {
    color: #333;
}

.tools-panel a {
    color: #333;
    padding: 6px 0;
    transition: color 0.2s;
}

.tools-panel a:hover {
    color: var(--primary-color, #044BD9);
}

.tools-overlay {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tools-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 576px) {
    .tools-panel {
        /* Mobile: Panel oben sichtbar, nicht unten versteckt */
        width: 100%;
        max-width: 100%;
        right: 0;
        left: 0;
        top: 0;
        bottom: auto;
        max-height: 85vh;
        border-radius: 0 0 16px 16px;
        transform: translateY(-110%);
    }

    .tools-panel.open {
        transform: translateY(0);
    }

    .tools-fab {
        bottom: 16px;
        right: 16px;
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
}

/* --------- Onboarding-Tour (clean) --------- */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: transparent; /* Abdunklung kommt vom Highlight-Cutout */
    pointer-events: auto;
}

.tour-overlay.hidden {
    display: none;
}

/* Highlight: box-shadow "stanzt" das Target aus der Abdunklung aus */
.tour-highlight {
    position: fixed;
    border-radius: 10px;
    box-shadow: 0 0 0 3px var(--primary-color, #044BD9),
                0 0 0 9999px rgba(0, 0, 0, 0.6);
    background: transparent;
    pointer-events: none;
    transition: top 0.3s, left 0.3s, width 0.3s, height 0.3s;
    z-index: 200001;
}

.tour-tooltip {
    position: fixed;
    z-index: 200020;
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 340px;
}

/* Während Tour aktiv: nur Back-to-top verstecken */
body.tour-active .back-to-top {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Back-to-top auf Mobile nach LINKS, damit Filter/Tools-FABs rechts frei bleiben */
@media (max-width: 1399px) {
    .back-to-top {
        right: auto !important;
        left: calc(16px + env(safe-area-inset-left, 0px)) !important;
    }
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tour-step-indicator {
    font-size: 11px;
    color: #999;
    font-weight: 600;
}

.tour-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.tour-close:hover {
    color: #333;
}

.tour-tooltip-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #222;
    font-size: 15px;
}

.tour-tooltip-text {
    font-size: 14px;
    color: #444;
    margin-bottom: 10px;
    line-height: 1.45;
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.tour-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 10px;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.2s;
}

.tour-dot.active {
    background: var(--primary-color, #044BD9);
}
