/* Community Links & Floating Quick Support Widget (2026 Modern Design) */
:root {
    --comm-zalo: #0068ff;
    --comm-zalo-bg: #e8f2ff;
    --comm-admin: #10b981;
    --comm-admin-bg: #ecfdf5;
    --comm-group: #8b5cf6;
    --comm-group-bg: #f5f3ff;
}

/* Floating Quick Support Bar (unobtrusive compact FAB) */
.floating-support-bar {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.floating-support-bar > * {
    pointer-events: auto;
}

.floating-support-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.floating-support-toggle i {
    margin-right: 0 !important;
}

.floating-support-toggle > span:not(.fs-pulse) {
    display: none;
}

.floating-support-toggle:hover {
    transform: translateY(-2px);
    background: #1d4ed8;
    box-shadow: 0 12px 24px -6px rgba(37, 99, 235, 0.45);
    color: #ffffff !important;
}

.floating-support-toggle .fs-pulse {
    display: none;
}

@keyframes fsPulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.floating-support-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--bg-card, #ffffff);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
    min-width: 230px;
}

.floating-support-bar.is-open .floating-support-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-support-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--text-main, #1e293b) !important;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.18s ease, transform 0.18s ease;
}

.floating-support-item:hover {
    background: var(--bg-card-subtle, #f8fafc);
    transform: translateX(-3px);
}

.floating-support-item .fsi-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
    flex-shrink: 0;
}

.fsi-icon.is-admin { background: #ecfdf5; color: #059669; }
.fsi-icon.is-group { background: #f5f3ff; color: #7c3aed; }
.fsi-icon.is-zalo  { background: #eff6ff; color: #0068ff; }

.floating-support-item .fsi-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fsi-meta strong {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main, #1e293b);
}

.fsi-meta small {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

/* Community Cards in Contact Page & Dashboard */
.community-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.community-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
    border-radius: 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.community-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.community-card.card-admin:hover { border-color: #10b981; }
.community-card.card-group:hover { border-color: #8b5cf6; }
.community-card.card-zalo:hover  { border-color: #0068ff; }

.cc-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.cc-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 20px;
    flex-shrink: 0;
}

.cc-icon.is-admin { background: #d1fae5; color: #047857; }
.cc-icon.is-group { background: #ede9fe; color: #6d28d9; }
.cc-icon.is-zalo  { background: #dbeafe; color: #0068ff; }

.cc-title-wrap h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main, #0f172a);
}

.cc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-admin-pulse { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-group-pulse { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-zalo-pulse  { background: #eff6ff; color: #0068ff; border: 1px solid #bfdbfe; }

.cc-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted, #64748b);
    margin: 0 0 18px;
    flex: 1;
}

.cc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btn-admin-action { background: #059669; color: #fff !important; }
.btn-admin-action:hover { background: #047857; color: #fff !important; }

.btn-group-action { background: #7c3aed; color: #fff !important; }
.btn-group-action:hover { background: #6d28d9; color: #fff !important; }

.btn-zalo-action { background: #0068ff; color: #fff !important; }
.btn-zalo-action:hover { background: #0056d6; color: #fff !important; }

.cc-helper-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cc-mini-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-card-subtle, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-main, #1e293b) !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.cc-mini-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #0056d6 !important;
}

/* Dark mode adjustments */
html[data-ui-theme="dark"] .floating-support-menu,
html[data-ui-theme="dark"] .community-card {
    background: #111e32;
    border-color: #1e314d;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

html[data-ui-theme="dark"] .floating-support-item:hover {
    background: #172b47;
}

html[data-ui-theme="dark"] .cc-title-wrap h3,
html[data-ui-theme="dark"] .floating-support-item strong {
    color: #f1f5f9;
}

html[data-ui-theme="dark"] .cc-desc,
html[data-ui-theme="dark"] .floating-support-item small {
    color: #94a3b8;
}

html[data-ui-theme="dark"] .cc-mini-btn {
    background: #172b47;
    border-color: #253d60;
    color: #e2e8f0 !important;
}

html[data-ui-theme="dark"] .cc-mini-btn:hover {
    background: #1d3659;
    border-color: #3b82f6;
    color: #93c5fd !important;
}

html[data-ui-theme="dark"] .fsi-icon.is-admin,
html[data-ui-theme="dark"] .cc-icon.is-admin { background: #064e3b; color: #6ee7b7; }
html[data-ui-theme="dark"] .fsi-icon.is-group,
html[data-ui-theme="dark"] .cc-icon.is-group { background: #3b1b6e; color: #c4b5fd; }
html[data-ui-theme="dark"] .fsi-icon.is-zalo,
html[data-ui-theme="dark"] .cc-icon.is-zalo { background: #133360; color: #93c5fd; }

@media (max-width: 767px) {
    .floating-support-bar {
        right: 14px;
        bottom: 14px;
    }
    .floating-support-toggle {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }
    .floating-support-toggle i {
        margin-right: 0 !important;
        font-size: 16px;
    }
    .floating-support-toggle > span:not(.fs-pulse) {
        display: none;
    }
    .floating-support-menu {
        min-width: 210px;
    }
    .community-grid-cards {
        grid-template-columns: 1fr;
    }
}
