/* ----------------------------------------------------- community invite & launcher -- */

/* Floating launcher pill */
.tf-community-launcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.15rem;
    background: linear-gradient(135deg, #131722, #1e2538);
    border: 1px solid rgba(255, 107, 0, 0.45);
    border-radius: 9999px;
    color: #ffffff !important;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 107, 0, 0.25);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-decoration: none;
}
.tf-community-launcher:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: #ff6b00;
    box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 107, 0, 0.4);
}
.tf-community-launcher__pulse {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background-color: #25d366;
    border-radius: 50%;
    border: 2px solid #131722;
    box-shadow: 0 0 8px #25d366;
    animation: tf-launcher-pulse 2s infinite;
}
@keyframes tf-launcher-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.tf-community-launcher__icon {
    font-size: 1.15rem;
    color: #ff8c00;
    display: flex;
    align-items: center;
}
.tf-community-launcher__socials {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.25rem;
    font-size: 1rem;
}

/* Modal Overlay */
.tf-community-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.tf-community-modal.is-open {
    opacity: 1;
    visibility: visible;
}
.tf-community-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 16, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Dialog Box */
.tf-community-modal__dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 36rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    background: var(--tf-surface, #ffffff);
    border: 1px solid var(--tf-border-strong, #e2e8f0);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 107, 0, 0.15);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--tf-text, #1e293b);
}
.tf-community-modal.is-open .tf-community-modal__dialog {
    transform: scale(1) translateY(0);
}
.tf-community-modal__close {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--tf-border, #e2e8f0);
    background: var(--tf-bg-2, #f8fafc);
    color: var(--tf-muted, #64748b);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tf-community-modal__close:hover {
    color: var(--tf-strong, #0f172a);
    background: var(--tf-surface-hover, #f1f5f9);
    transform: rotate(90deg);
}

/* Header */
.tf-community-modal__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ff8c00;
    margin-bottom: 0.65rem;
}
.tf-community-modal__badge-pulse {
    width: 7px;
    height: 7px;
    background: #ff8c00;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff8c00;
}
.tf-community-modal__title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--tf-strong, #0f172a);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}
.tf-community-modal__desc {
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--tf-muted, #64748b);
    margin: 0 0 1.25rem 0;
}

/* Grid of Primary Cards */
.tf-community-modal__grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}
.tf-community-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--tf-bg-2, #f8fafc);
    border: 1px solid var(--tf-border, #e2e8f0);
    border-radius: 0.85rem;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.tf-community-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5px;
    opacity: 0.8;
    transition: width 0.2s ease;
}
.tf-community-card:hover {
    background: var(--tf-surface-hover, #f1f5f9);
    border-color: var(--tf-border-strong, #cbd5e1);
    transform: translateX(4px);
}
.tf-community-card:hover::before {
    width: 5px;
}

/* Card Network Variants */
.tf-community-card--youtube::before { background: #ff0000; }
.tf-community-card--tiktok::before { background: #00f2fe; }
.tf-community-card--whatsapp::before { background: #25d366; }
.tf-community-card--telegram::before { background: #229ed9; }

.tf-community-card__icon-box {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.tf-community-card:hover .tf-community-card__icon-box {
    transform: scale(1.08);
}
.tf-community-card__icon-box--youtube { background: rgba(255, 0, 0, 0.12); color: #ff0000; }
.tf-community-card__icon-box--tiktok { background: rgba(0, 242, 254, 0.12); color: #00f2fe; }
.tf-community-card__icon-box--whatsapp { background: rgba(37, 211, 102, 0.12); color: #25d366; }
.tf-community-card__icon-box--telegram { background: rgba(34, 158, 217, 0.12); color: #229ed9; }

.tf-community-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.tf-community-card__title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tf-community-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tf-strong, #0f172a);
}
.tf-community-card__badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tf-community-card__badge--youtube { background: rgba(255, 0, 0, 0.15); color: #ff5252; }
.tf-community-card__badge--tiktok { background: rgba(0, 242, 254, 0.15); color: #00f2fe; }
.tf-community-card__badge--whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.tf-community-card__badge--telegram { background: rgba(34, 158, 217, 0.15); color: #40b3e9; }

.tf-community-card__caption {
    font-size: 0.8rem;
    color: var(--tf-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tf-community-card__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.5rem;
    background: var(--tf-surface, #ffffff);
    border: 1px solid var(--tf-border, #e2e8f0);
    color: var(--tf-strong, #0f172a);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.tf-community-card:hover .tf-community-card__action {
    background: #ff6b00;
    border-color: #ff6b00;
    color: #ffffff;
}

/* Secondary Pills */
.tf-community-modal__secondary {
    padding-top: 0.85rem;
    border-top: 1px solid var(--tf-border, #e2e8f0);
    margin-bottom: 1.25rem;
}
.tf-community-modal__secondary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tf-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.tf-community-modal__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tf-community-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: var(--tf-bg-2, #f8fafc);
    border: 1px solid var(--tf-border, #e2e8f0);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tf-text, #1e293b) !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
}
.tf-community-pill:hover {
    background: var(--tf-surface-hover, #f1f5f9);
    color: var(--tf-strong, #0f172a) !important;
    border-color: var(--tf-border-strong, #cbd5e1);
    transform: translateY(-1px);
}

/* Footer */
.tf-community-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--tf-border, #e2e8f0);
    font-size: 0.82rem;
}
.tf-community-modal__credit {
    color: var(--tf-muted, #64748b);
}
.tf-community-modal__credit a {
    color: #ff8c00;
    text-decoration: none;
    font-weight: 600;
}
.tf-community-modal__credit a:hover {
    text-decoration: underline;
}
.tf-community-modal__dismiss {
    background: none;
    border: 0;
    color: var(--tf-muted, #64748b);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s ease;
}
.tf-community-modal__dismiss:hover {
    color: var(--tf-strong, #0f172a);
    text-decoration: underline;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .tf-community-launcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.55rem 0.95rem;
        font-size: 0.82rem;
    }
    .tf-community-launcher__socials {
        display: none;
    }
    .tf-community-modal {
        padding: 0.5rem;
        align-items: flex-end;
    }
    .tf-community-modal__dialog {
        max-height: 85vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 1.25rem 1rem;
    }
    .tf-community-card__caption {
        display: none;
    }
}
