/*! Copyright (c) 2026 Taylor Gerard. All rights reserved. Developer: Taylor Gerard. BB Hashtag Generator. */
/* O'Radar app: toast, share picker, install card, iOS steps (assets/js/pwa.js). Scoped to .bbhg-apps-* */

.bbhg-apps-toast {
    position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 2147483200;
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    max-width: min(92vw, 460px); padding: 11px 18px; border-radius: 14px;
    background: #0f172a; color: #f8fafc; font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 12px 32px rgba(2, 6, 23, .35); transition: opacity .2s ease, transform .2s ease; text-align: center;
}
.bbhg-apps-toast.on { opacity: 1; transform: translate(-50%, 0); }

.bbhg-apps-sheet {
    position: fixed; inset: 0; z-index: 2147483100; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(2, 6, 23, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #0f172a;
    animation: bbhgAppsFade .18s ease;
}
@media (min-width: 640px) { .bbhg-apps-sheet { align-items: center; } }
.bbhg-apps-card {
    width: min(100%, 520px); max-height: 92vh; overflow: auto; box-sizing: border-box;
    background: #fff; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(2, 6, 23, .25); animation: bbhgAppsUp .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) { .bbhg-apps-card { border-radius: 22px; padding-bottom: 18px; } }
.bbhg-apps-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bbhg-apps-head img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.bbhg-apps-head h2 { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 700; color: inherit; }
.bbhg-apps-head p { margin: 2px 0 0; font-size: 13px; color: #64748b; }
.bbhg-apps-head > div { flex: 1; min-width: 0; }
.bbhg-apps-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f1f5f9; color: #334155; display: grid; place-items: center; cursor: pointer; padding: 0; }
.bbhg-apps-x:hover { background: #e2e8f0; }

.bbhg-apps-preview { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; word-break: break-word; }
.bbhg-apps-preview b { display: block; margin-bottom: 4px; }
.bbhg-apps-preview p { margin: 0 0 6px; color: #334155; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bbhg-apps-url { display: inline-block; font-size: 13px; color: #0369a1; background: #e0f2fe; border-radius: 99px; padding: 2px 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bbhg-apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.bbhg-apps-act {
    display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 10px 12px; box-sizing: border-box;
    border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; color: #0f172a; font-weight: 600; font-size: 14px; line-height: 1.2; font-family: inherit; text-align: left; cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}
.bbhg-apps-act span { font-size: 19px; line-height: 1; }
.bbhg-apps-act:hover, .bbhg-apps-act:focus-visible { border-color: #38bdf8; background: #f0f9ff; outline: none; }
.bbhg-apps-act:active { transform: scale(.98); }

.bbhg-apps-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.bbhg-apps-btn {
    appearance: none; border: 0; border-radius: 99px; padding: 10px 18px; font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0ea5e9; color: #fff; cursor: pointer;
}
.bbhg-apps-btn:hover { background: #0284c7; }
.bbhg-apps-btn.alt { background: #f1f5f9; color: #0f172a; }
.bbhg-apps-btn.alt:hover { background: #e2e8f0; }
.bbhg-apps-btn:focus-visible, .bbhg-apps-x:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 2px; }

.bbhg-apps-steps { margin: 4px 0 10px 20px; padding: 0; }
.bbhg-apps-steps li { margin: 0 0 10px; }
.bbhg-apps-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #e0f2fe; color: #0369a1; vertical-align: middle; }
.bbhg-apps-note { font-size: 13px; color: #64748b; margin: 6px 0 0; }

.bbhg-apps-hint {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 2147483050;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px;
    background: #fff; color: #0f172a; box-shadow: 0 14px 40px rgba(2, 6, 23, .3);
    font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transform: translateY(140%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.bbhg-apps-hint.on { transform: translateY(0); }
.bbhg-apps-hint img { border-radius: 11px; flex: none; }
.bbhg-apps-hint-t { flex: 1; min-width: 180px; }
.bbhg-apps-hint-t b { display: block; font-size: 15px; }
.bbhg-apps-hint-t span { color: #64748b; font-size: 13px; }
.bbhg-apps-hint-b { display: flex; gap: 6px; margin-left: auto; }

.bbhg-apps-install-link[hidden], .bbhg-apps-bell[hidden] { display: none !important; }
.bbhg-apps-bell.on svg { fill: currentColor; }

.bbhg-apps-flash { animation: bbhgAppsFlash 1.8s ease; }

/* Notification preferences */
.bbhg-apps-prefs fieldset { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.bbhg-apps-prefs legend { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 6px; padding: 0; }
.bbhg-apps-prefs .bbhg-ap-tone { grid-template-columns: 1fr 1fr; }
.bbhg-apps-prefs .bbhg-apps-act { cursor: pointer; font-weight: 500; }
.bbhg-apps-prefs .bbhg-apps-act em { font-style: normal; }
.bbhg-apps-prefs .bbhg-apps-act input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: #0ea5e9; }
.bbhg-apps-prefs .bbhg-apps-act:has(input:checked) { border-color: #0ea5e9; background: #f0f9ff; }
.bbhg-apps-prefs .bbhg-ap-freq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.bbhg-apps-prefs .bbhg-ap-freq select { flex: 1; min-width: 0; min-height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 0 10px; font: inherit; font-weight: 500; background: #fff; color: inherit; }
.bbhg-apps-prefs .bbhg-apps-btn[disabled] { opacity: .6; cursor: default; }
.bbhg-apps-sheet.is-dark.bbhg-apps-prefs .bbhg-apps-act:has(input:checked) { background: #0c2a44; border-color: #0ea5e9; }
.bbhg-apps-sheet.is-dark.bbhg-apps-prefs .bbhg-ap-freq select { background: #111c31; border-color: #1e293b; }

/* Dark */
.bbhg-apps-sheet.is-dark { color: #e2e8f0; }
.bbhg-apps-sheet.is-dark .bbhg-apps-card, .bbhg-apps-hint.is-dark { background: #0f172a; color: #e2e8f0; }
.bbhg-apps-sheet.is-dark .bbhg-apps-x, .bbhg-apps-sheet.is-dark .bbhg-apps-btn.alt, .bbhg-apps-hint.is-dark .bbhg-apps-btn.alt { background: #1e293b; color: #e2e8f0; }
.bbhg-apps-sheet.is-dark .bbhg-apps-preview { background: #111c31; border-color: #1e293b; }
.bbhg-apps-sheet.is-dark .bbhg-apps-preview p { color: #cbd5e1; }
.bbhg-apps-sheet.is-dark .bbhg-apps-act { background: #111c31; border-color: #1e293b; color: #e2e8f0; }
.bbhg-apps-sheet.is-dark .bbhg-apps-act:hover, .bbhg-apps-sheet.is-dark .bbhg-apps-act:focus-visible { background: #0c2a44; border-color: #0ea5e9; }
.bbhg-apps-sheet.is-dark .bbhg-apps-head p, .bbhg-apps-sheet.is-dark .bbhg-apps-note, .bbhg-apps-hint.is-dark .bbhg-apps-hint-t span { color: #94a3b8; }

@keyframes bbhgAppsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bbhgAppsUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes bbhgAppsFlash { 0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); } 20%, 60% { box-shadow: 0 0 0 4px rgba(14, 165, 233, .45); } }
@media (prefers-reduced-motion: reduce) {
    .bbhg-apps-sheet, .bbhg-apps-card, .bbhg-apps-flash { animation: none; }
    .bbhg-apps-toast, .bbhg-apps-hint { transition: none; }
}
