/* General sidebar section styling */
.sidebar-section {
    margin: 10px 0;
    padding-top: 10px;
}

.sidebar-section-compact {
    margin: 5px 0;
    padding-top: 5px;
}

/* Status group styles */
.status-group {
    margin-bottom: 8px;
}

.status-group:last-child {
    margin-bottom: 0;
}

.status-group-header {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.status-group-title {
    font-size: small;
    flex: 1;
    text-align: left;
    align-items: center;
    justify-content: center;
}

.status-group-count {
    font-size: smaller;
    padding-left: 2px;
    color: #6b7280;
}

/* Sidebar team widget - compact version */
.sidebar-team-widget {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    min-width: 0;
    margin: 0;
}

.sidebar-team-widget .team-availability-header {
    background: transparent;
    padding: 8px 15px;
}

.sidebar-team-widget .team-availability-title {
    font-size: medium;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-team-widget .team-availability-summary {
    gap: 6px;
}

.sidebar-team-widget .team-availability-summary .summary-count {
    font-size: 11px;
    color: #6b7280;
}

.sidebar-team-widget .status-group-header {
    padding: 4px 15px;
    font-size: 10px;
}


.sidebar-team-widget .member-status-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e5e7eb;
    align-items: center;
    display: flex;
    justify-content: center;
    border: 1px solid #fff;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
}

.team-memeber-user {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding-left: 12px;
}

.sidebar-team-widget .member-name {
    font-size: x-small;
    margin-bottom: 1px;
}

.sidebar-team-widget .member-status-text {
    font-size: 10px;
}

.sidebar-team-widget .member-last-seen {
    font-size: 9px;
}

.sidebar-team-widget .team-availability-updated {
    padding: 3px 15px;
    font-size: 9px;
    border-top: 1px solid #f3f4f6;
}

/* Collapsible section styles */
.sidebar-section-collapsible {
    margin: 0;
}

.sidebar-section-header a {
    display: block;
    padding: 8px 15px;
    color: #374151;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-section-header a:hover {
    background: #f1f3f4;
    text-decoration: none;
}

.sidebar-section-header .glyphicon {
    font-size: 11px;
    margin-right: 6px;
}

.sidebar-section-header .glyphicon-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar-section-header a[aria-expanded="false"] .glyphicon-chevron-down {
    transform: rotate(-90deg);
}

.team-status-summary-inline {
    font-size: 10px;
    color: #6b7280;
    margin-left: 5px;
}

/* Dropdown widget styles */
.dropdown-team-widget {
    width: 280px;
    max-width: none;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dropdown-menu-wide {
    min-width: 300px;
    padding: 0;
}

/* Responsive adjustments for sidebar */
@media (max-width: 1200px) {
    .sidebar-team-widget .member-name {
        font-size: x-small;
    }

    .sidebar-team-widget .member-status-indicator {
        width: 15px;
        height: 15px;
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .sidebar-section {
        margin: 5px 0;
    }

    .sidebar-team-widget .team-availability-header {
        padding: 6px 10px;
    }

    .sidebar-team-widget .team-member {
        padding: 5px 10px;
    }

    .sidebar-team-widget .status-group-header {
        padding: 3px 10px;
    }
}

/* Integration with existing sidebar menu styles */
.sidebar-menu + .sidebar-section {
    margin-top: 0;
}

.sidebar-section + .sidebar-buttons {
    margin-top: 10px;
}

/* Status indicator animations */
.member-status-indicator {
    transition: background-color 0.3s ease;
}

.team-member[data-status-changed] {
    animation: statusHighlight 2s ease-out;
}

@keyframes statusHighlight {
    0% {
        background-color: #e3f2fd;
    }
    100% {
        background-color: transparent;
    }
}

/* Loading state in sidebar */
.sidebar-team-widget .team-availability-loading {
    padding: 15px;
    text-align: center;
    font-size: 11px;
    color: #6b7280;
}

/* Error state in sidebar */
.sidebar-team-widget .team-availability-error {
    padding: 8px 15px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 11px;
    border: none;
    border-left: 3px solid #dc2626;
    margin: 0;
}

/* Empty state in sidebar */
.sidebar-team-widget .team-availability-empty {
    padding: 15px;
    text-align: center;
    color: #6b7280;
    font-size: 11px;
}

.sidebar-team-widget .team-availability-refresh {
    padding: 2px 4px;
    font-size: 10px;
}

.sidebar-team-widget.team-availability-widget {
    min-width: 0;
    width: 100%;
}


/* Main widget styles */
.team-availability-widget {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    min-width: 280px;
}

.team-availability-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-availability-title {
    font-size: medium;
    font-weight: 600;
    margin: 0;
}

.team-availability-summary {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.summary-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.summary-dot.available {
    background-color: #10b981;
}

.summary-dot.idle {
    background-color: #e78708;
}

.summary-dot.offline {
    background-color: #9ca3af;
}

.team-member {
    display: flex;
    align-items: center;
    padding: 2px 16px;
    transition: background-color 0.2s ease;
}

.team-member:hover {
    background-color: #f9fafb;
}

.member-status-indicator.available {
    background-color: #10b981;
}

.member-status-indicator.idle {
    background-color: #e78708;
}

.member-status-indicator.offline {
    background-color: #9ca3af;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: x-small;
    font-weight: 500;
    color: #374151;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-status-text {
    font-size: 11px;
    color: #6b7280;
    margin: 0;
}

.member-last-seen {
    font-size: 10px;
    color: #9ca3af;
    margin-left: 8px;
    white-space: nowrap;
}

.team-availability-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
}

.team-availability-empty {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 13px;
}

.team-availability-error {
    padding: 12px 16px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 12px;
    border-left: 3px solid #dc2626;
}

.team-availability-refresh {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.team-availability-refresh:hover {
    background-color: #f3f4f6;
}

.team-availability-updated {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    padding: 4px 16px;
    border-top: 1px solid #f3f4f6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .team-availability-widget {
        min-width: 100%;
    }

    .team-availability-summary {
        flex-direction: column;
        gap: 4px;
    }

    .status-group-header {
        padding: 4px 12px;
        font-size: 10px;
    }

}


/* Smooth transitions for group changes */
.status-group {
    transition: all 0.3s ease;
}

.status-group-members {
    transition: max-height 0.3s ease;
    padding-left: 2px;

}

.status-group.collapsed .status-group-members {
    display: none;
}

/* Toggle icon for collapsible groups */
.status-group-toggle {
    margin-left: auto;
    margin-right: 8px;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.status-group.collapsed .status-group-toggle {
    transform: rotate(-90deg);
}

/* Enhanced visual separation between groups */
.status-group + .status-group {
    margin-top: 4px;
}

/* Improved scroll behavior for grouped lists */
.team-availability-list.grouped {
    scroll-behavior: smooth;
}

/* Animation for new member additions */
.team-member.new-member {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}