/* ==========================================================================
   Overlays shared across pages: subscribe dialog, share dialog, floating
   create button. Linked by resources/views/components/overlay-styles.blade.php.
   These live directly under <body>, so they only rely on the --app-* tokens.
   ========================================================================== */

/* ── Subscribe dialog (components/subscribe-dialog) ───────────────────────
   Teleported to <body>, so it can't use the .bf scope; tokens still apply. */
[x-cloak] { display: none !important; }
.bsd {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.bsd__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.bsd__card {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 32px 28px 24px;
    border-radius: 20px;
    background:
        radial-gradient(120% 80% at 50% 0%, var(--app-accent-soft), transparent 60%),
        var(--app-surface);
    color: var(--app-text);
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
    animation: bsd-in .18s ease-out;
}
@keyframes bsd-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.bsd .bsd__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-muted);
    cursor: pointer;
}
.bsd__close:hover { background: var(--app-surface-2); color: var(--app-text); }
.bsd__close .material-icons { font-size: 20px; line-height: 1; }
.bsd__photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--app-surface-3);
    box-shadow: 0 0 0 4px var(--app-surface);
}
.bsd .bsd__title {
    margin: 14px 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.015em;
    line-height: 1.25;
    color: var(--app-text);
}
.bsd__by { margin: 0; color: var(--app-muted); font-size: 14px; }
.bsd__by strong { color: var(--app-text); }
.bsd__bio { margin: 12px 0 0; color: var(--app-text-2); font-size: 15px; line-height: 1.5; }
.bsd__form { margin-top: 22px; text-align: left; }
.bsd .bsd__input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--app-border-2);
    border-radius: 12px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 16px;   /* no zoom on iOS */
    outline: none;
}
.bsd__input:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--app-accent-soft); }
.bsd__input[aria-invalid="true"] { border-color: var(--app-danger); }
.bsd .bsd__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--app-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.bsd__submit:hover { filter: brightness(.95); }
.bsd__submit:disabled { opacity: .7; cursor: progress; }
.bsd .bsd__submit--ghost { background: transparent; border-color: var(--app-border-2); color: var(--app-text); }
.bsd__submit:focus-visible, .bsd__close:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.bsd__error { margin: 10px 0 0; color: var(--app-danger); font-size: 14px; }
.bsd__note { margin: 12px 0 0; color: var(--app-muted); font-size: 13px; text-align: center; }
.bsd__done { margin-top: 20px; }
.bsd__done-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--app-success) 14%, transparent);
    color: var(--app-success);
}
.bsd__done-icon .material-icons { line-height: 1; }
.bsd__done h3 { margin: 12px 0 4px; font-size: 18px; font-weight: 800; color: var(--app-text); }
.bsd__done p { margin: 0; color: var(--app-text-2); font-size: 15px; }

/* ── Share dialog (components/share-dialog) ───────────────────────────── */
.bsh { text-align: left; padding: 24px; }
.bsd .bsh__title {
    margin: 0 40px 16px 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--app-text);
}
.bsh__preview {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: var(--app-surface);
}
.bsh__preview-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--app-accent-soft);
    color: var(--app-accent);
}
.bsh__preview-icon .material-icons { line-height: 1; }
.bsh__preview-text { display: flex; flex-direction: column; min-width: 0; }
.bsh__subject {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--app-text);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.35;
}
.bsh__meta { color: var(--app-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bsh__copy {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding: 5px 5px 5px 14px;
    border: 1px solid var(--app-border-2);
    border-radius: 999px;
    background: var(--app-surface-2);
}
.bsh__copy input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text-2);
    font-size: 14px;
}
.bsd .bsh__copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--app-text);
    color: var(--app-surface);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .15s;
}
.bsd .bsh__copy-btn.is-copied { background: var(--app-success); color: #fff; }
.bsh__copy-btn .material-icons { font-size: 17px; line-height: 1; }

.bsh__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-top: 18px;
}
.bsh__net {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 2px;
    border-radius: 12px;
    color: var(--app-text-2);
    font-size: 12px;
    text-align: center;
    transition: background-color .15s;
}
.bsh__net:hover { background: var(--app-surface-2); color: var(--app-text); text-decoration: none; }
.bsh__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    transition: transform .15s;
}
.bsh__net:hover .bsh__icon { transform: translateY(-2px); }
.bsh__icon .material-icons { font-size: 22px; line-height: 1; }
.bsh__icon--x  { background: #000; }
.bsh__icon--li { background: #0a66c2; }
.bsh__icon--fb { background: #1877f2; }
.bsh__icon--wa { background: #25d366; }
.bsh__icon--tg { background: #229ed9; }
.bsh__icon--em { background: var(--app-muted); }
html[data-theme="dark"] .bsh__icon--x { background: #fff; color: #000; }
.bsd .bsh__more { margin-top: 14px; }
.bsh__more .material-icons { font-size: 18px; line-height: 1; }

@media (max-width: 420px) {
    .bsh__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Floating create button (campaign/components/action) ──────────────── */
.bb-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    transition: transform .25s ease, opacity .25s ease;
}
.bb-fab.is-hidden { transform: translateY(16px) scale(.9); opacity: 0; pointer-events: none; }
.bb-fab__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50% !important;
    background: var(--app-accent);
    color: #fff;
    box-shadow: 0 8px 24px rgba(24, 119, 242, .35), 0 2px 6px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: transform .2s ease, filter .15s;
}
.bb-fab__btn:hover { filter: brightness(1.05); }
.bb-fab__btn:focus { outline: none; }
.bb-fab__btn:focus-visible { outline: 3px solid var(--app-accent-line); outline-offset: 3px; }
.bb-fab__btn .material-icons { font-size: 28px; line-height: 1; transition: transform .2s ease; }
.bb-fab.is-open .bb-fab__btn .material-icons { transform: rotate(45deg); }

.bb-fab__menu {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    padding: 6px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-surface);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    animation: bb-fab-in .15s ease-out;
}
.bb-fab__menu[hidden] { display: none; }
@keyframes bb-fab-in { from { opacity: 0; transform: translateY(6px); } }
.bb-fab__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--app-text);
    font-weight: 600;
    font-size: 15px;
}
.bb-fab__item:hover, .bb-fab__item:focus-visible { background: var(--app-surface-2); color: var(--app-text); text-decoration: none; outline: none; }
.bb-fab__item .material-icons { color: var(--app-accent); font-size: 20px; line-height: 1; }

@media (max-width: 767.98px) {
    .bb-fab { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .bb-fab, .bb-fab__btn, .bb-fab__btn .material-icons, .bsh__icon { transition: none; }
    .bb-fab__menu, .bsd__card { animation: none; }
}
