/*! Copyright (c) 2026 Taylor Gerard. All rights reserved. Developer: Taylor Gerard. BB Hashtag Generator. */
/* Post to Bluesky composer (assets/js/bluesky-post.js). Scoped to .bbhg-bp */

html.bbhg-bp-lock, html.bbhg-bp-lock body { overflow: hidden !important; }

.bbhg-bp {
    position: fixed; inset: 0; z-index: 2147483150; display: none; align-items: flex-end; justify-content: center;
    background: rgba(2, 6, 23, .58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #0f172a; text-align: left;
}
.bbhg-bp.on { display: flex; animation: bbhgBpFade .16s ease; }
@media (min-width: 680px) { .bbhg-bp { align-items: center; } }
.bbhg-bp *, .bbhg-bp *::before, .bbhg-bp *::after { box-sizing: border-box; }

.bbhg-bp-card {
    width: min(100%, 600px); max-height: 94vh; overflow: auto; background: #fff;
    border-radius: 22px 22px 0 0; padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(2, 6, 23, .3); animation: bbhgBpUp .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 680px) { .bbhg-bp-card { border-radius: 22px; padding-bottom: 18px; } }

.bbhg-bp-top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.bbhg-bp-logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #1185fe, #38bdf8); color: #fff; flex: none; }
.bbhg-bp-top h2 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; color: inherit; line-height: 1.2; }
.bbhg-bp-acct { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #334155; min-width: 0; }
.bbhg-bp-acct img { border-radius: 50%; object-fit: cover; background: #e2e8f0; }
.bbhg-bp-acct span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bbhg-bp-link { border: 0; background: none; color: #1185fe; font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; padding: 4px; }
.bbhg-bp-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f1f5f9; color: #334155; font-size: 22px; line-height: 1; cursor: pointer; }
.bbhg-bp-x:hover { background: #e2e8f0; }

.bbhg-bp-lead { margin: 0 0 12px; color: #334155; }
.bbhg-bp-field { display: block; margin: 0 0 10px; }
.bbhg-bp-field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #334155; }
.bbhg-bp input[type="text"], .bbhg-bp input:not([type]), .bbhg-bp input[type="password"], .bbhg-bp select, .bbhg-bp textarea {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 10px 12px; font-size: 15px; line-height: 1.4; font-family: inherit; color: #0f172a; background: #fff; margin: 0;
}
.bbhg-bp textarea { resize: vertical; min-height: 84px; display: block; }
.bbhg-bp input:focus, .bbhg-bp select:focus, .bbhg-bp textarea:focus { outline: none; border-color: #1185fe; box-shadow: 0 0 0 3px rgba(17, 133, 254, .2); }
.bbhg-bp-help { font-size: 13px; color: #64748b; margin: 0 0 10px; }
.bbhg-bp-help a { color: #1185fe; font-weight: 600; }
.bbhg-bp-warn { font-size: 13px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 9px 12px; margin: 0 0 10px; }
.bbhg-bp-warn label { display: block; margin-top: 6px; font-weight: 600; }
.bbhg-bp-adv { margin: 0 0 10px; font-size: 13px; color: #475569; }
.bbhg-bp-adv summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.bbhg-bp-adv small { display: block; margin-top: 4px; color: #64748b; }
.bbhg-bp-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 8px; cursor: pointer; }
.bbhg-bp-check.sm { font-size: 13px; color: #475569; margin: 0; }
.bbhg-bp-check input { width: 17px; height: 17px; margin: 0; accent-color: #1185fe; }
.bbhg-bp-note { font-size: 12.5px; color: #64748b; margin: 0 0 8px; }
.bbhg-bp-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; margin: 8px 0; }

.bbhg-bp-posts { display: flex; flex-direction: column; gap: 10px; }
.bbhg-bp-post { position: relative; }
.bbhg-bp-post.multi { padding-left: 30px; }
.bbhg-bp-post.multi::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: -12px; width: 2px; background: #e2e8f0; }
.bbhg-bp-post.multi:last-child::before { display: none; }
.bbhg-bp-num { position: absolute; left: 0; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #1185fe; color: #fff; font-weight: 700; font-size: 12px; line-height: 24px; font-family: inherit; text-align: center; }
.bbhg-bp-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; color: #64748b; min-height: 22px; }
.bbhg-bp-hints { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbhg-bp-count { font-variant-numeric: tabular-nums; font-weight: 700; color: #64748b; }
.bbhg-bp-count.near { color: #d97706; }
.bbhg-bp-count.over { color: #dc2626; }
.bbhg-bp-rm { border: 0; background: #f1f5f9; color: #475569; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; cursor: pointer; line-height: 24px; padding: 0; }
.bbhg-bp-rm:hover { background: #fee2e2; color: #b91c1c; }

.bbhg-bp-tools, .bbhg-bp-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.bbhg-bp-opts { justify-content: space-between; }
.bbhg-bp-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; }
.bbhg-bp-chip:hover { border-color: #1185fe; color: #1185fe; }
.bbhg-bp-chip.warn { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.bbhg-bp-chip[hidden], .bbhg-bp [hidden] { display: none !important; }
.bbhg-bp-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; }
.bbhg-bp-lang select { width: auto; padding: 6px 10px; border-radius: 10px; font-size: 13px; }

.bbhg-bp-media { margin-top: 10px; border-radius: 14px; }
.bbhg-bp-media.drag { outline: 2px dashed #1185fe; outline-offset: 4px; }
.bbhg-bp-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.bbhg-bp-thumbs:not(:empty) { margin-bottom: 8px; }
.bbhg-bp-thumb { position: relative; }
.bbhg-bp-thumb img { width: 100%; height: 96px; object-fit: cover; border-radius: 12px; display: block; background: #f1f5f9; }
.bbhg-bp-thumb .bbhg-bp-rm { position: absolute; top: 5px; right: 5px; background: rgba(15, 23, 42, .75); color: #fff; }
.bbhg-bp-thumb input { margin-top: 5px !important; padding: 6px 8px !important; font-size: 12px !important; border-radius: 9px !important; }

.bbhg-bp-progress { margin: 10px 0 0; font-size: 13px; color: #334155; }
.bbhg-bp-bar { height: 6px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-bottom: 6px; }
.bbhg-bp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1185fe, #38bdf8); transition: width .3s ease; }

.bbhg-bp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bbhg-bp-actions.center { justify-content: center; }
.bbhg-bp-btn {
    appearance: none; border: 0; border-radius: 99px; padding: 10px 20px; font: 700 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #1185fe; color: #fff; cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px;
}
.bbhg-bp-btn:hover { background: #0a6fe0; color: #fff; }
.bbhg-bp-btn.alt { background: #f1f5f9; color: #0f172a; }
.bbhg-bp-btn.alt:hover { background: #e2e8f0; color: #0f172a; }
.bbhg-bp-btn:disabled { opacity: .55; cursor: default; }
.bbhg-bp-btn.busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: bbhgBpSpin .8s linear infinite; }
.bbhg-bp-btn:focus-visible, .bbhg-bp-chip:focus-visible, .bbhg-bp-x:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

.bbhg-bp-done { text-align: center; padding: 18px 6px 6px; }
.bbhg-bp-ok { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 34px; line-height: 64px; font-weight: 700; }
.bbhg-bp-done h3 { margin: 0 0 4px; font-size: 19px; color: inherit; }
.bbhg-bp-done p { margin: 0; color: #475569; }

.bbhg-bsky-post-link svg { color: #1185fe; }

/* Bluesky Pulse and Thread Generator entry buttons */
.bbhg-bp-entry {
    display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 99px; padding: 9px 16px; cursor: pointer;
    background: linear-gradient(135deg, #1185fe, #38bdf8); color: #fff !important; font: 700 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 6px 18px rgba(17, 133, 254, .28); text-decoration: none;
}
.bbhg-bp-entry:hover { filter: brightness(1.06); }
.bbhg-bp-entry svg { color: #fff; }
.bbhg-bp-compose-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(17, 133, 254, .09), rgba(56, 189, 248, .08)); border: 1px solid rgba(17, 133, 254, .25); }
.bbhg-bp-compose-card div { flex: 1; min-width: 200px; }
.bbhg-bp-compose-card b { display: block; font-size: 15px; color: #0f172a; }
.bbhg-bp-compose-card span { font-size: 13px; color: #475569; }

/* Dark */
.bbhg-bp.is-dark { color: #e2e8f0; }
.bbhg-bp.is-dark .bbhg-bp-card { background: #0f172a; }
.bbhg-bp.is-dark .bbhg-bp-top { border-color: #1e293b; }
.bbhg-bp.is-dark .bbhg-bp-x, .bbhg-bp.is-dark .bbhg-bp-btn.alt, .bbhg-bp.is-dark .bbhg-bp-rm { background: #1e293b; color: #e2e8f0; }
.bbhg-bp.is-dark input:not([type="checkbox"]):not([type="file"]), .bbhg-bp.is-dark select, .bbhg-bp.is-dark textarea { background: #0b1324; border-color: #334155; color: #e2e8f0; }
.bbhg-bp.is-dark .bbhg-bp-chip { background: #0b1324; border-color: #334155; color: #e2e8f0; }
.bbhg-bp.is-dark .bbhg-bp-lead, .bbhg-bp.is-dark .bbhg-bp-acct, .bbhg-bp.is-dark .bbhg-bp-progress, .bbhg-bp.is-dark .bbhg-bp-done p, .bbhg-bp.is-dark .bbhg-bp-field span { color: #cbd5e1; }
.bbhg-bp.is-dark .bbhg-bp-help, .bbhg-bp.is-dark .bbhg-bp-meta, .bbhg-bp.is-dark .bbhg-bp-note, .bbhg-bp.is-dark .bbhg-bp-check.sm, .bbhg-bp.is-dark .bbhg-bp-lang, .bbhg-bp.is-dark .bbhg-bp-adv { color: #94a3b8; }
.bbhg-bp.is-dark .bbhg-bp-bar, .bbhg-bp.is-dark .bbhg-bp-post.multi::before { background: #1e293b; }
.bbhg-bp.is-dark .bbhg-bp-warn { background: #2a1606; border-color: #7c2d12; color: #fdba74; }
.bbhg-bp.is-dark .bbhg-bp-err { background: #2a0f12; border-color: #7f1d1d; color: #fecaca; }

@keyframes bbhgBpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bbhgBpUp { from { transform: translateY(26px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes bbhgBpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bbhg-bp.on, .bbhg-bp-card { animation: none; } .bbhg-bp-bar i { transition: none; } }
