/*
 * O'Radar opener buttons (11.14.0).
 * Loaded on pages where the app waits for its first open, so the buttons that open it look the same before the
 * app's own stylesheets arrive. The same rules are in frontend.css; nothing here applies inside the app window.
 */
:root {
    --bbhg-primary: #0ea5e9;
    --bbhg-accent: #06b6d4;
    --bbhg-radius: 10px;
}

.bbhg-composer-trigger { margin: 16px 0; }

.bbhg-open-generator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--bbhg-primary) 0%, var(--bbhg-accent) 100%);
    color: white;
    border: none !important;
    outline: none !important;
    padding: 14px 32px;
    border-radius: var(--bbhg-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px -3px rgba(14, 165, 233, 0.4), 0 8px 25px -5px rgba(6, 182, 212, 0.3);
    min-width: 220px;
    justify-content: center;
}
.bbhg-open-generator:focus { outline: none !important; border: none !important; }
.bbhg-open-generator:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--bbhg-primary); }
.bbhg-open-generator:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(14, 165, 233, 0.5), 0 12px 30px -5px rgba(6, 182, 212, 0.4);
}
.bbhg-open-generator:hover .bbhg-arrow { animation: none; transform: translateX(6px); }
.bbhg-open-generator svg { width: 18px; height: 18px; }
.bbhg-open-generator .bbhg-arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
    animation: bbhg-arrow-bounce 1.2s ease-in-out infinite;
}
.bbhg-open-generator .bbhg-arrow svg { width: 16px; height: 16px; stroke: white; }
@keyframes bbhg-arrow-bounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.bbhg-composer-trigger.bbhg-inline .bbhg-open-generator { min-width: auto; padding: 10px 20px; }

.bbhg-floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999998;
    animation: bbhg-fab-entrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bbhg-fab-entrance { from { transform: scale(0) rotate(-180deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } }
.bbhg-fab {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bbhg-primary) 0%, var(--bbhg-accent) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    animation: bbhg-fab-pulse 3s ease-in-out infinite;
}
.bbhg-fab:hover { transform: scale(1.1) rotate(5deg); animation: none; box-shadow: 0 8px 20px rgba(14, 165, 233, 0.5), 0 4px 10px rgba(0, 0, 0, 0.2); }
.bbhg-fab:active { transform: scale(0.95); }
@keyframes bbhg-fab-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 8px 24px rgba(14, 165, 233, 0.6), 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(14, 165, 233, 0.2); }
}
@media (max-width: 640px) {
    .bbhg-floating-button { bottom: 20px; right: 20px; }
    .bbhg-fab { width: 38px; height: 38px; }
}

/* While the app loads after a tap: the button shows a spinning ring. */
.bbhg-app-busy { cursor: progress !important; position: relative; }
.bbhg-fab.bbhg-app-busy::after,
.bbhg-open-generator.bbhg-app-busy::after,
.bbhg-inline-btn.bbhg-app-busy::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: bbhg-app-spin 0.8s linear infinite;
    pointer-events: none;
}
.bbhg-open-generator.bbhg-app-busy::after,
.bbhg-inline-btn.bbhg-app-busy::after { inset: auto; right: 10px; top: 50%; width: 14px; height: 14px; margin-top: -10px; border-width: 3px; }
.bbhg-inline-btn.bbhg-app-busy::after { border-color: rgba(14, 165, 233, 0.2); border-top-color: var(--bbhg-primary); }
html.bbhg-app-loading { cursor: progress; }
@keyframes bbhg-app-spin { to { transform: rotate(360deg); } }

/* O'Radar splash (11.14.4): shown the instant an opener is tapped while the app is still loading. */
.bbhg-app-veil {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px;
    background: radial-gradient(ellipse at 50% 35%, #1e1f4b 0%, #14142e 55%, #0b0c1d 100%);
    color: #e2e8f0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    animation: bbhg-veil-in .18s ease-out;
}
.bbhg-app-veil.out { opacity: 0; transition: opacity .25s ease; }
.bbhg-app-veil-radar { position: relative; width: min(260px, 60vw); aspect-ratio: 1; }
.bbhg-app-veil-radar i { position: absolute; border-radius: 50%; }
.bbhg-app-veil-radar .r1 { inset: 0; border: 1px solid rgba(94, 234, 212, .18); }
.bbhg-app-veil-radar .r2 { inset: 20%; border: 1px solid rgba(94, 234, 212, .16); }
.bbhg-app-veil-radar .r3 { inset: 40%; border: 1px solid rgba(94, 234, 212, .14); background: radial-gradient(circle, rgba(45, 212, 191, .12), transparent 70%); }
.bbhg-app-veil-radar .sweep { inset: 0; background: conic-gradient(from 0deg, rgba(45, 212, 191, .45), rgba(45, 212, 191, 0) 70deg, transparent 360deg); animation: bbhg-app-spin 2.2s linear infinite; -webkit-mask: radial-gradient(circle, #000 69%, transparent 70%); mask: radial-gradient(circle, #000 69%, transparent 70%); }
.bbhg-app-veil-radar .core { left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #2dd4bf; box-shadow: 0 0 18px #2dd4bf; }
.bbhg-app-veil-txt { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.bbhg-app-veil-txt .w { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: #cbd5e1; }
.bbhg-app-veil-txt b { font-size: clamp(36px, 7vw, 52px); font-weight: 800; color: #5eead4; text-shadow: 0 0 24px rgba(45, 212, 191, .45); letter-spacing: .01em; }
.bbhg-app-veil-txt .s { font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: #94a3b8; }
.bbhg-app-veil-bar { width: min(200px, 50vw); height: 3px; border-radius: 3px; background: rgba(148, 163, 184, .2); overflow: hidden; }
.bbhg-app-veil-bar i { display: block; width: 40%; height: 100%; border-radius: 3px; background: #2dd4bf; animation: bbhg-veil-bar 1.1s ease-in-out infinite; }
html.bbhg-app-veiled, html.bbhg-app-veiled body { overflow: hidden; }
@keyframes bbhg-veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bbhg-veil-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
    .bbhg-app-veil-radar .sweep, .bbhg-app-veil-bar i { animation: none; }

    .bbhg-floating-button, .bbhg-fab, .bbhg-open-generator .bbhg-arrow { animation: none; }
    .bbhg-app-busy::after { animation-duration: 2.4s; }
}
