/**
 * User Management Styles
 *
 * Styles for user grid, cards, and list views
 *
 * (c) Adrian Ranta. All rights reserved. Unauthorised use, reproduction and or distribution is strictly prohibited.
 */

/* Context Menu Styles */
.user-context-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 150px;
    z-index: 10000;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

/* Activity Status Indicators (used on avatar overlays in card view) */
.activity-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.activity-indicator.active {
    background-color: #22c55e;
}

.activity-indicator.idle {
    background-color: #eab308;
}

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

/* Legacy: keep .online mapped to active for card view backward compat */
.activity-indicator.online {
    background-color: #22c55e;
}

/* ========================================
   USER GRID STYLES
   ======================================== */


.user-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.user-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-avatar img,
.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.avatar-placeholder-small {
    width: 32px;
    height: 32px;
    background: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50%;
}

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

.user-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.user-info p {
    margin: 0 0 8px 0;
    color: #6b7280;
    font-size: 14px;
}

.user-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6b7280;
}

.user-meta .department {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.user-meta .location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.user-stats .stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
}

.user-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.user-actions button {
    flex: 1;
    padding: 6px 12px;
    font-size: 13px;
}

/* ========================================
   USER LIST VIEW
   Column order: User | Activity | Last Seen | Status | Department | Location | Assets
   ======================================== */
.user-list-table {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.user-list-header {
    display: grid;
    grid-template-columns: 2.5fr 60px 1.2fr 0.8fr 1.2fr 1.2fr 0.8fr;
    padding: 12px 20px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-list-body {
    background: white;
}

.user-list-item {
    display: grid;
    grid-template-columns: 2.5fr 60px 1.2fr 0.8fr 1.2fr 1.2fr 0.8fr;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.user-list-item:hover {
    background-color: #f9fafb;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.user-list-item:last-child {
    border-bottom: none;
}

/* Column specific styles */
.col-user {
    font-weight: 500;
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Name + email stacked block inside the User column */
.user-name-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email-sub {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-email {
    color: #6b7280;
    font-size: 13px;
}

.col-status .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.col-department,
.col-location {
    color: #6b7280;
    font-size: 13px;
}

/* Activity column: centered dot, no text */
.col-activity {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Activity dot (used in both list rows and detail modals) */
.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.active {
    background-color: #22c55e;
}

.activity-dot.idle {
    background-color: #eab308;
}

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

/* Legacy: keep .online mapped to active for backward compat */
.activity-dot.online {
    background-color: #22c55e;
}

.col-last-seen {
    color: #9ca3af;
    font-size: 13px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
