/* Session Monitoring Dashboard Styles */
.session-monitoring-dashboard {
    margin-top: 20px;
    width: 100%;
    overflow: hidden; /* Prevent overflow from breaking layout */
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}



.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    width: 100%;
    box-sizing: border-box;
}



.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(74, 144, 226, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a90e2;
    flex-shrink: 0;
}



.stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #ccc;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.stat-number {
    font-size: 2.2em;
    font-weight: bold;
    color: #4a90e2;
    display: block;
    line-height: 1;
}



.session-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.recovery-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.recovery-btn.primary {
    background: #4a90e2;
    color: white;
}

.recovery-btn.primary:hover {
    background: #357abd;
}

.recovery-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.recovery-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.recovery-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.active-sessions-list h5 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.sessions-table-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

/* Adaptive table - switches to card layout in narrow containers */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Default table layout for wide containers */
.sessions-table.table-layout {
    table-layout: fixed;
    min-width: 600px;
}

/* Card layout for narrow containers - hidden by default */
.sessions-cards {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.session-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.session-card-user {
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
    color: #ccc;
}

.session-card-detail {
    display: flex;
    flex-direction: column;
}

.session-card-detail-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.session-card-detail-value {
    color: #ccc;
}

/* IP address styling in cards */
.session-card-detail-value code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    word-break: break-all;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Default table layout for wide containers */
.sessions-table.table-layout {
    table-layout: fixed;
    min-width: 600px;
}

/* Compact table layout for medium containers */
.sessions-table.compact-layout {
    table-layout: fixed;
    min-width: 480px;
    font-size: 12px;
}

/* Column width definitions for normal table */
.sessions-table.table-layout th:nth-child(1),
.sessions-table.table-layout td:nth-child(1) { width: 120px; }
.sessions-table.table-layout th:nth-child(2),
.sessions-table.table-layout td:nth-child(2) { width: 80px; }
.sessions-table.table-layout th:nth-child(3),
.sessions-table.table-layout td:nth-child(3) { width: 130px; }
.sessions-table.table-layout th:nth-child(4),
.sessions-table.table-layout td:nth-child(4) { width: 100px; }
.sessions-table.table-layout th:nth-child(5),
.sessions-table.table-layout td:nth-child(5) { width: 140px; max-width: 140px; }
.sessions-table.table-layout th:nth-child(6),
.sessions-table.table-layout td:nth-child(6) { width: 70px; min-width: 70px; }

/* Column width definitions for compact table */
.sessions-table.compact-layout th:nth-child(1),
.sessions-table.compact-layout td:nth-child(1) { width: 90px; }
.sessions-table.compact-layout th:nth-child(2),
.sessions-table.compact-layout td:nth-child(2) { width: 60px; }
.sessions-table.compact-layout th:nth-child(3),
.sessions-table.compact-layout td:nth-child(3) { width: 100px; }
.sessions-table.compact-layout th:nth-child(4),
.sessions-table.compact-layout td:nth-child(4) { width: 70px; }
.sessions-table.compact-layout th:nth-child(5),
.sessions-table.compact-layout td:nth-child(5) { width: 100px; max-width: 100px; }
.sessions-table.compact-layout th:nth-child(6),
.sessions-table.compact-layout td:nth-child(6) { width: 60px; min-width: 60px; }

.sessions-table th {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sessions-table td {
    padding: 12px 15px;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-wrap: break-word; /* Allow long text to wrap */
    overflow-wrap: break-word; /* Modern browsers */
    vertical-align: top; /* Align content to top when wrapping */
}

/* Special handling for IP address column */
.sessions-table td:nth-child(5) {
    padding: 12px 8px; /* Reduced horizontal padding for IP column */
    font-size: 12px; /* Slightly smaller font for IP addresses */
    line-height: 1.3; /* Tighter line height for wrapped text */
}

/* Special handling for IP address code elements */
.sessions-table td:nth-child(5) code {
    word-break: break-all; /* Break long IP addresses at any character */
    white-space: normal; /* Allow wrapping */
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    display: block; /* Make code element block to allow proper wrapping */
}

.sessions-table tr:last-child td {
    border-bottom: none;
}

.sessions-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.role-super_admin {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.role-admin {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.role-barber {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-expired {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* Responsive design - matching image recovery dashboard approach */
@media (max-width: 768px) {
    .session-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        align-self: center;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .session-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .recovery-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .session-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 8px;
    }
    
    .stat-content h4 {
        font-size: 12px;
        margin-bottom: 5px;
        white-space: normal;
        text-overflow: unset;
        overflow: visible;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
}

/* Loading spinner for session monitoring */
.session-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

.session-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}