/* Global UI — WhatsApp FABs + Announcements */

/* ── Top announcement bar (full width) ── */
.ddz-ann-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1065;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    animation: ddzFadeIn 0.35s ease;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.ddz-ann-topbar.is-hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

.ddz-ann-topbar__icon {
    flex-shrink: 0;
    font-size: 1rem;
    opacity: 0.95;
}

.ddz-ann-topbar__content {
    flex: 1;
    min-width: 0;
}

.ddz-ann-topbar__title {
    font-weight: 700;
    margin-right: 0.5rem;
}

.ddz-ann-topbar__msg {
    opacity: 0.92;
}

.ddz-ann-topbar__btn {
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.ddz-ann-topbar__btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: inherit;
    transform: translateY(-1px);
}

.ddz-ann-topbar__close {
    flex-shrink: 0;
    border: none;
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    opacity: 0.85;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.ddz-ann-topbar__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
}

body.has-ddz-topbar .main-navbar {
    top: var(--ddz-topbar-height, 48px);
}

body.has-ddz-topbar.dashboard-app {
    padding-top: var(--ddz-topbar-height, 0px);
}

body.has-ddz-topbar.dashboard-app .sidebar {
    top: var(--ddz-topbar-height, 0px);
    height: calc(100vh - var(--ddz-topbar-height, 0px));
}

body.has-ddz-topbar .main-content {
    padding-top: calc(var(--navbar-height, 72px) + var(--ddz-topbar-height, 0px));
}

/* ── Dashboard / homepage banners ── */
.ddz-ann-home-banner,
.ddz-ann-dash-banner {
    margin-bottom: 1.25rem;
    animation: ddzFadeIn 0.4s ease;
}

.ddz-ann-banner-card {
    border-radius: 14px;
    padding: 1.1rem 1.35rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.ddz-ann-banner-card__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ddz-ann-banner-card__body {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
}

.ddz-ann-banner-card__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.ddz-ann-banner-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.ddz-ann-banner-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.92;
    line-height: 1.5;
}

.ddz-ann-banner-card__actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.ddz-ann-banner-card__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    border: none;
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.ddz-ann-banner-card__close:hover {
    opacity: 1;
}

.ddz-ann-priority {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.ddz-ann-priority--critical {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
}

.ddz-ann-priority--important {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.ddz-ann-priority--normal {
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
}

/* ── WhatsApp FAB stack (icon-only circles) ── */
.ddz-global-fab-stack {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1060;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

body.dashboard-app .ddz-global-fab-stack {
    left: calc(var(--sidebar-width, 260px) + 1.25rem);
}

.ddz-global-fab-stack--store {
    bottom: 5.5rem;
}

.ddz-global-fab-stack:empty {
    display: none;
}

.ddz-fab {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    cursor: pointer;
    background: #25d366;
}

.ddz-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
    color: #fff;
}

.ddz-fab > i {
    font-size: 1.35rem;
    line-height: 1;
}

.ddz-fab__label,
.ddz-fab__pill {
    display: none;
}

.ddz-fab--channel {
    background: var(--ddz-channel-color, #25d366);
}

.ddz-fab--support {
    background: #128c7e;
}

.ddz-fab--announce,
.ddz-fab--floating-ann,
#ddzAnnFab {
    display: none !important;
}

.ddz-fab--pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
    animation: ddzPulse 3s ease infinite;
    pointer-events: none;
}

.ddz-fab__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── Popup modal ── */
.ddz-ann-popup {
    z-index: 1080;
}

.ddz-ann-popup .modal-content {
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px;
}

.ddz-ann-popup__inner {
    padding: 1.75rem;
}

.ddz-ann-popup__inner h5 {
    font-size: 1.15rem;
    font-weight: 700;
}

.ddz-ann-popup__inner p {
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ── Drawer (optional, admin-enabled only) ── */
.ddz-ann-drawer {
    position: fixed;
    inset: 0;
    z-index: 1070;
    pointer-events: none;
}

.ddz-ann-drawer.is-open {
    pointer-events: auto;
}

.ddz-ann-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ddz-ann-drawer.is-open .ddz-ann-drawer__backdrop {
    opacity: 1;
}

.ddz-ann-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100%;
    background: var(--dash-surface, #fff);
    color: var(--dash-text-heading, #0f172a);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ddz-ann-drawer.is-open .ddz-ann-drawer__panel {
    transform: translateX(0);
}

.ddz-ann-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--dash-border, #e2e8f0);
}

.ddz-ann-drawer__header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.ddz-ann-drawer__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ddz-ann-drawer__close {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--dash-text-muted, #64748b);
    padding: 0.35rem;
    cursor: pointer;
}

.ddz-ann-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.ddz-ann-item {
    border: 1px solid var(--dash-border, #e2e8f0);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.notification-btn .ddz-ann-bell-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2px solid var(--dash-topbar-bg, #fff);
}

@keyframes ddzPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}

@keyframes ddzFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .ddz-global-fab-stack,
    body.dashboard-app .ddz-global-fab-stack,
    body.dashboard-app .ddz-fab--floating-ann,
    .ddz-fab--floating-ann {
        left: 0.85rem;
        bottom: 1rem;
    }

    .ddz-global-fab-stack--store {
        bottom: 5rem;
    }

    body.has-ddz-topbar.dashboard-app .sidebar {
        top: 0;
        height: 100vh;
    }

    .ddz-ann-topbar {
        flex-wrap: wrap;
        padding: 0.55rem 0.85rem;
        font-size: 0.8125rem;
    }

    .ddz-ann-banner-card__body {
        padding-right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ddz-fab--pulse::after {
        animation: none;
    }
}

/* ── WhatsApp Community invite popup ── */
.ddz-wa-community-modal .modal-dialog {
    max-width: 420px;
}

.ddz-wa-community {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.ddz-wa-community__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.35rem 1.25rem 1.2rem;
    background: #25D366;
    color: #fff;
}

.ddz-wa-community__badge {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ddz-wa-community__header-text {
    flex: 1;
    min-width: 0;
}

.ddz-wa-community__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
}

.ddz-wa-community__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    opacity: 0.95;
}

.ddz-wa-community__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.25rem;
    opacity: 0.9;
    cursor: pointer;
}

.ddz-wa-community__close:hover {
    opacity: 1;
}

.ddz-wa-community__body {
    padding: 1.35rem 1.35rem 1.25rem;
    background: #fff;
}

.ddz-wa-community__benefits {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ddz-wa-community__benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.ddz-wa-community__benefits strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.ddz-wa-community__benefits p {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.ddz-wa-community__icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.ddz-wa-community__icon--green {
    background: #e8f8ef;
    color: #25D366;
}

.ddz-wa-community__icon--blue {
    background: #e8f1ff;
    color: #3b82f6;
}

.ddz-wa-community__icon--purple {
    background: #f3e8ff;
    color: #8b5cf6;
}

.ddz-wa-community__join {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #25D366;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.ddz-wa-community__join:hover {
    background: #1ebe57;
    color: #fff !important;
    transform: translateY(-1px);
}

.ddz-wa-community__later {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ddz-wa-community__later:hover {
    background: #e2e8f0;
}

.ddz-wa-community__note {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

[data-bs-theme="dark"] .ddz-wa-community__body,
body.dark-mode .ddz-wa-community__body {
    background: #1e293b;
}

[data-bs-theme="dark"] .ddz-wa-community__benefits strong,
body.dark-mode .ddz-wa-community__benefits strong {
    color: #f8fafc;
}

[data-bs-theme="dark"] .ddz-wa-community__benefits p,
body.dark-mode .ddz-wa-community__benefits p {
    color: #94a3b8;
}

[data-bs-theme="dark"] .ddz-wa-community__later,
body.dark-mode .ddz-wa-community__later {
    background: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ddz-wa-community__later:hover,
body.dark-mode .ddz-wa-community__later:hover {
    background: #475569;
}
