﻿/* ===================================================================
   TEAM ONLINE BADGE — Sidebar presence indicator
   Add to sidebar.css (after nav-item styles, section 4)
   
   Expanded:  [ 👥 Team Management          🟢 3 online ]
   Collapsed: [ 👥 ] with small green "3" badge top-right
   =================================================================== */

/* ---- EXPANDED STATE (default) ---- */

.team-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    line-height: 1;
    white-space: nowrap;
    transition: opacity 0.3s ease, background 0.2s ease;
}

    .team-online-badge:hover {
        background: rgba(16, 185, 129, 0.18);
    }

/* Pulsing green dot */
.team-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: team-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes team-dot-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    }
}

/* Count number */
.team-online-count {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* "online" label — only visible in expanded state */
.team-online-badge::after {
    content: "online";
    font-weight: 500;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}


/* ---- COLLAPSED STATE ---- */

.layout-app.sidebar-collapsed .sidebar .team-online-badge {
    /* Reset expanded styles */
    margin-left: 0;
    padding: 0;
    gap: 0;
    background: #059669;
    border: 2px solid var(--sidebar-bg-1, #FAFAF9);
    border-radius: 999px;
    /* Position as notification badge */
    position: absolute;
    top: 2px;
    right: 2px;
    /* Compact sizing */
    min-width: 18px;
    height: 18px;
    justify-content: center;
    align-items: center;
    /* White text on green */
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/* Hide dot and "online" label in collapsed */
.layout-app.sidebar-collapsed .sidebar .team-online-dot {
    display: none;
}

.layout-app.sidebar-collapsed .sidebar .team-online-badge::after {
    content: none;
}

/* Keep count visible */
.layout-app.sidebar-collapsed .sidebar .team-online-count {
    display: inline;
}

/* Ensure nav-item has relative positioning for the badge */
#nav-team-management {
    position: relative;
}
