/* Web Push Bell Widget */
.ls-webpush-bell-widget {
    position: fixed;
    bottom: calc(30px + var(--hd-bottom-fixed-safe-offset, 0px));
    right: 30px;
    width: 60px;
    height: 60px;
    background: #2271b1;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0.5);
}

button.ls-webpush-bell-widget {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    font: inherit;
    line-height: 1;
}

button.ls-webpush-bell-widget:focus-visible {
    outline: 3px solid rgba(34, 113, 177, 0.35);
    outline-offset: 4px;
}

.ls-webpush-bell-widget.ls-visible {
    opacity: 1;
    transform: scale(1);
}

.ls-webpush-deferred-launcher.ls-loading {
    cursor: wait;
}

.ls-webpush-deferred-launcher.ls-loading.ls-loading-animate .ls-webpush-bell-icon-container {
    animation: lsWebpushLoaderSpin 0.85s linear infinite;
}

.ls-webpush-deferred-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes lsWebpushLoaderSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ls-webpush-deferred-launcher.ls-loading.ls-loading-animate .ls-webpush-bell-icon-container {
        animation: none;
    }
}

.ls-webpush-bell-widget:hover {
    transform: scale(1.1);
    background: #135e96;
}

.ls-webpush-bell-icon-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.2s ease;
}

.ls-webpush-bell-svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
}

.ls-webpush-bell-logo {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
}

.ls-webpush-bell-widget:hover .ls-webpush-bell-icon-container {
    transform: scale(1.1);
}

.ls-webpush-bell-widget.ls-subscribed .ls-webpush-bell-icon-container {
    color: #2271b1;
}

.ls-webpush-bell-widget.ls-subscribed {
    background: #fff;
    border: 2px solid #2271b1;
}

.ls-webpush-bell-widget.ls-style-branded {
    width: 58px;
    height: 58px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 18px;
    background: #fff;
    color: #2271b1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.ls-webpush-bell-widget.ls-style-branded:hover {
    background: #f8fbff;
}

.ls-webpush-bell-widget.ls-style-branded.ls-subscribed {
    border-color: #22c55e;
}

.ls-webpush-bell-widget.ls-style-branded .ls-webpush-bell-icon-container {
    color: #2271b1;
}

.ls-webpush-bell-widget.ls-style-minimal {
    width: 48px;
    height: 48px;
    background: #1f2937;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.ls-webpush-bell-widget.ls-style-minimal:hover {
    background: #111827;
}

.ls-webpush-bell-widget.ls-style-minimal .ls-webpush-bell-icon-container {
    width: 26px;
    height: 26px;
}

.ls-webpush-bell-widget.ls-style-minimal .ls-webpush-bell-svg {
    width: 24px;
    height: 24px;
}

.ls-webpush-bell-widget.ls-style-minimal .ls-webpush-bell-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.ls-webpush-bell-widget.ls-style-minimal .ls-webpush-bell-badge {
    top: -4px;
    right: -4px;
}


/* Badge for notifications */
.ls-webpush-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #d63638;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    display: inline-block; /* Show it */
    z-index: 10;
}

/* Tooltip/Prompt */
.ls-webpush-prompt {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: none;
    animation: lsSlideUp 0.3s ease;
}

.ls-webpush-bell-widget.ls-style-branded .ls-webpush-prompt,
.ls-webpush-direct-prompt.ls-style-branded {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.ls-webpush-bell-widget.ls-style-minimal .ls-webpush-prompt,
.ls-webpush-direct-prompt.ls-style-minimal {
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

@keyframes lsSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ls-webpush-prompt h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1d2327;
}

.ls-webpush-prompt-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ls-webpush-prompt-heading h4 {
    margin: 0;
}

.ls-webpush-prompt-logo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 8px;
    object-fit: cover;
    background: #f8fafc;
}

.ls-webpush-prompt p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

.ls-webpush-ios-steps {
    margin: 0 0 15px;
    padding-left: 20px;
    color: #334155;
    font-size: 13px;
    line-height: 1.6;
}

.ls-webpush-ios-steps li {
    margin: 0 0 4px;
}

.ls-webpush-prompt-actions {
    display: flex;
    gap: 10px;
}

.ls-webpush-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 40px;
}

.ls-webpush-btn-primary {
    background: #2271b1;
    color: #fff;
}

.ls-webpush-btn-primary:hover {
    background: #135e96;
}

.ls-webpush-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.ls-webpush-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.ls-webpush-btn-danger {
    background: #d63638;
    color: #fff;
}

.ls-webpush-btn-danger:hover {
    background: #b32d2e;
}

.ls-webpush-inline-subscribe {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: #2271b1;
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(34, 113, 177, 0.22);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ls-webpush-inline-subscribe:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(19, 94, 150, 0.26);
}

.ls-webpush-inline-subscribe:focus-visible {
    outline: 3px solid rgba(34, 113, 177, 0.35);
    outline-offset: 3px;
}

.ls-webpush-direct-prompt {
    position: fixed;
    left: auto;
    right: 30px;
    bottom: calc(30px + var(--hd-bottom-fixed-safe-offset, 0px));
    z-index: 100000;
    box-sizing: border-box;
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1d2327;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.ls-webpush-direct-prompt.ls-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ls-webpush-direct-prompt.ls-has-launcher {
    bottom: calc(104px + var(--hd-bottom-fixed-safe-offset, 0px));
}

.ls-webpush-direct-prompt.ls-pos-left {
    left: 30px;
    right: auto;
}

.ls-webpush-direct-prompt.ls-pos-center {
    left: 50%;
    right: auto;
    transform: translate(-50%, 12px);
}

.ls-webpush-direct-prompt.ls-pos-center.ls-visible {
    transform: translate(-50%, 0);
}

.ls-webpush-direct-prompt .ls-webpush-prompt-heading h4 {
    margin: 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
}

.ls-webpush-direct-prompt p {
    margin: 0 0 15px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .ls-webpush-direct-prompt,
    .ls-webpush-direct-prompt.ls-pos-left,
    .ls-webpush-direct-prompt.ls-pos-center {
        left: 16px;
        right: 16px;
        width: auto;
        transform: translateY(12px);
    }

    .ls-webpush-direct-prompt.ls-visible,
    .ls-webpush-direct-prompt.ls-pos-center.ls-visible {
        transform: translateY(0);
    }

    .ls-webpush-direct-prompt.ls-has-launcher {
        bottom: calc(96px + var(--hd-bottom-fixed-safe-offset, 0px));
    }
}

/* Error and permission notices */
.ls-webpush-error-banner {
    position: fixed;
    bottom: calc(20px + var(--hd-bottom-fixed-safe-offset, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    max-width: 90%;
    padding: 15px 25px;
    border-radius: 8px;
    background: #d63638;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    text-align: center;
}

.ls-webpush-error-note {
    font-size: 12px;
}

.ls-webpush-status-banner {
    position: fixed;
    bottom: calc(20px + var(--hd-bottom-fixed-safe-offset, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    max-width: min(520px, 90vw);
    padding: 14px 22px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a8a;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.ls-webpush-permission-blocked {
    position: fixed;
    bottom: calc(20px + var(--hd-bottom-fixed-safe-offset, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    max-width: 400px;
    padding: 20px 25px;
    border: 2px solid #d63638;
    border-radius: 12px;
    background: #fff;
    color: #1d2327;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.ls-webpush-permission-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.ls-webpush-permission-icon {
    margin-right: 10px;
    font-size: 24px;
}

.ls-webpush-permission-title {
    color: #d63638;
    font-size: 16px;
}

.ls-webpush-permission-copy {
    margin: 0 0 12px;
    color: #50575e;
}

.ls-webpush-permission-steps {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background: #f0f6fc;
    font-size: 13px;
}

.ls-webpush-permission-close {
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 6px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.ls-webpush-permission-close:hover,
.ls-webpush-permission-close:focus {
    background: #135e96;
}

/* Right Positioning (Default) */
.ls-webpush-bell-widget {
    right: 30px;
}
.ls-webpush-bell-widget .ls-webpush-prompt {
    right: 0;
}

/* Left Positioning */
.ls-webpush-bell-widget.ls-pos-left {
    right: auto;
    left: 30px;
}
.ls-webpush-bell-widget.ls-pos-left .ls-webpush-prompt {
    right: auto;
    left: 0;
}

/* Pulse animation for the bell */
.ls-webpush-bell-widget:not(.ls-subscribed).ls-pulse:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(34, 113, 177, 0.4);
    animation: lsPulse 2s infinite;
}

@keyframes lsPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Subscribed hover tooltip */
.ls-webpush-bell-widget.ls-subscribed:hover::after {
    content: "取消訂閱";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    margin-bottom: 10px;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.ls-pos-left.ls-webpush-bell-widget.ls-subscribed:hover::after {
    left: 0;
    transform: none;
}

.ls-pos-right.ls-webpush-bell-widget.ls-subscribed:hover::after {
    right: 0;
    left: auto;
    transform: none;
}

/* Ensure prompt stays above other things */
.ls-webpush-prompt {
    z-index: 100001;
}

/* Disabled state (when service is turned off) */
.ls-webpush-bell-widget.ls-disabled {
    background: #9ca3af;
    cursor: pointer;
    opacity: 0.7;
}

.ls-webpush-bell-widget.ls-disabled:hover {
    background: #6b7280;
    opacity: 0.9;
}

.ls-webpush-bell-widget.ls-disabled .ls-webpush-bell-icon-container {
    color: #fff;
}

/* Remove pulse animation for disabled state */
.ls-webpush-bell-widget.ls-disabled:after {
    display: none;
}
