/* Floating demo control panels — clearly separate from the website preview */

.demo-fp-dock {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: none;
}

.demo-fp-dock > * {
    pointer-events: auto;
}

.demo-fp-dock-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: min(280px, calc(100vw - 2rem));
}

.demo-fp-tip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    width: max-content;
    max-width: min(280px, calc(100vw - 2rem));
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 2;
    pointer-events: none;
}

.demo-fp-tip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.demo-fp-tip::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 100%;
    border: 7px solid transparent;
    border-top-color: #0f172a;
}

.demo-fp-help {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border: 2px solid #c4b5fd;
    border-radius: 50%;
    background: #1e1b4b;
    color: #e9d5ff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(76, 29, 149, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.demo-fp-help:hover,
.demo-fp-help:focus-visible {
    background: #312e81;
    outline: none;
    box-shadow: 0 6px 18px rgba(76, 29, 149, 0.45);
}

.demo-fp-help.is-active {
    background: #5b21b6;
    border-color: #ddd6fe;
    color: #fff;
}

/* Touch / coarse pointer: tap ⓘ for tooltip; tap main button to open panel */
@media (hover: none), (pointer: coarse) {
    .demo-fp-help {
        display: inline-flex;
    }

    .demo-fp-trigger::after {
        display: none !important;
    }
}

/* Fine pointer + hover: hover main button for tooltip; ⓘ hidden */
@media (hover: hover) and (pointer: fine) {
    .demo-fp-help {
        display: none;
    }
}

.demo-fp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border: 2px solid #a78bfa;
    border-radius: 999px;
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(76, 29, 149, 0.45);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    max-width: min(220px, calc(100vw - 2rem));
}

.demo-fp-trigger:hover,
.demo-fp-trigger:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(76, 29, 149, 0.55);
    outline: none;
}

.demo-fp-trigger.is-open {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
    border-color: #c4b5fd;
}

.demo-fp-trigger-icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.demo-fp-trigger-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-fp-trigger::after {
    content: attr(data-fp-tooltip);
    position: absolute;
    right: calc(100% + 0.65rem);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    width: max-content;
    max-width: 240px;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 1;
}

.demo-fp-trigger:hover::after,
.demo-fp-trigger:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.demo-fp-card {
    position: fixed;
    right: 1rem;
    bottom: 4.5rem;
    z-index: 10040;
    width: min(380px, calc(100vw - 2rem));
    max-height: min(72vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 2px solid #8b5cf6;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.demo-fp-card.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.demo-fp-card.is-minimized .demo-fp-card-body {
    display: none;
}

.demo-fp-card.is-minimized {
    max-height: none;
    width: min(320px, calc(100vw - 2rem));
}

.demo-fp-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    background: linear-gradient(135deg, #312e81 0%, #5b21b6 100%);
    color: #fff;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.demo-fp-card-header:active {
    cursor: grabbing;
}

.demo-fp-card-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.demo-fp-card-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-fp-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.demo-fp-card-btn {
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.demo-fp-card-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.demo-fp-card-body {
    overflow: auto;
    max-height: calc(min(72vh, 640px) - 2.75rem);
    -webkit-overflow-scrolling: touch;
}

/* Scope tier bar inside floating panel */
.demo-fp-card-body .demo-scope-bar {
    border-bottom: none;
    padding: 0.75rem;
}

.demo-fp-card-body .demo-scope-bar__hint {
    max-width: none;
}

/* Page layout controls inside floating panel */
.demo-fp-card-body .pl-control-panel {
    border-bottom: none;
    padding: 0.75rem;
}

/* Breadcrumb controls inside floating panel */
.demo-fp-card-body .bc-controls--fp {
    padding: 0.75rem;
}

.demo-fp-card-body .bc-seo-fp {
    padding: 0.75rem;
}

.demo-fp-card-body .bc-seo-fp .bc-use-cases,
.demo-fp-card-body .bc-seo-fp .bc-benefits,
.demo-fp-card-body .bc-seo-fp .bc-schema-panel {
    background: transparent;
}

/* Dual-pane view bar inside floating panel */
.demo-fp-card-body .demo-dual-bar {
    margin: 0;
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.demo-fp-card-body .demo-dual-bar .demo-view-toggle {
    justify-content: center;
}

.demo-fp-hint-pulse {
    animation: demo-fp-pulse 2s ease-in-out 3;
}

@keyframes demo-fp-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(76, 29, 149, 0.45); }
    50% { box-shadow: 0 8px 28px rgba(167, 139, 250, 0.85), 0 0 0 4px rgba(167, 139, 250, 0.25); }
}

@media (max-width: 640px) {
    .demo-fp-dock {
        right: 0.65rem;
        bottom: 0.65rem;
        left: 0.65rem;
        align-items: stretch;
    }

    .demo-fp-dock-row {
        max-width: none;
        justify-content: stretch;
    }

    .demo-fp-trigger {
        flex: 1;
        justify-content: center;
        max-width: none;
    }

    .demo-fp-tip {
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
    }

    .demo-fp-tip::after {
        right: auto;
        left: 1.25rem;
    }

    .demo-fp-card {
        right: 0.65rem;
        left: 0.65rem;
        width: auto;
        bottom: 3.75rem;
    }
}
