/* developer/sessions/assets/css/sessions.css - استایل‌های اختصاصی مانیتورینگ نشست‌ها */

:root {
    --dev-purple: #6D28D9;
    --dev-purple-bg: #F5F3FF;
    --dev-purple-border: #DDD6FE;
    --status-online: #10B981;
    --status-online-bg: #ECFDF5;
    --status-idle: #F59E0B;
    --status-idle-bg: #FEF3C7;
    --status-expired: #9CA3AF;
    --status-expired-bg: #F3F4F6;
}

/* کارت‌های آمار و خلاصه‌وضعیت */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-icon.green {
    background: #ECFDF5;
    color: #059669;
}

.stat-icon.purple {
    background: var(--dev-purple-bg);
    color: var(--dev-purple);
}

.stat-icon.amber {
    background: #FFFBEB;
    color: #D97706;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* نوار ابزار */
.toolbar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.toolbar-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 260px;
    max-width: 450px;
    position: relative;
}

.toolbar-search-wrap svg {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.toolbar-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

.toolbar-input:focus {
    border-color: var(--primary);
    background: #FFF;
    box-shadow: 0 0 0 3px rgba(140, 90, 50, 0.15);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-dev {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-dev-outline {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    color: var(--text-main);
}

.btn-dev-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--primary);
}

.btn-dev-danger {
    background: #DC2626;
    color: #FFF;
}

.btn-dev-danger:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

.auto-refresh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    user-select: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}

.auto-refresh-toggle input {
    cursor: pointer;
    accent-color: var(--primary);
}

/* پالس آنلاین */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* جدول نشست‌ها */
.sessions-table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 13px;
}

.sessions-table th {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-card);
    white-space: nowrap;
}

.sessions-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.sessions-table tr:hover td {
    background-color: rgba(250, 246, 240, 0.7);
}

.session-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-card);
    flex-shrink: 0;
}

.session-user-info {
    display: flex;
    flex-direction: column;
}

.session-user-name {
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-username {
    font-size: 11px;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.ip-badge {
    display: inline-flex;
    font-family: monospace;
    font-size: 12px;
    direction: ltr;
    color: #4B5563;
    background: #F3F4F6;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-online {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.status-idle {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.status-expired {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.current-session-tag {
    background: var(--dev-purple-bg);
    color: var(--dev-purple);
    border: 1px solid var(--dev-purple-border);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-terminate {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-terminate:hover {
    background: #DC2626;
    color: #FFF;
    border-color: #DC2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* مودال تایید */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #FFF;
    border-radius: var(--radius-xl);
    max-width: 440px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
    border: 1px solid var(--border-card);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.modal-icon-danger {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #FEE2E2;
    color: #DC2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: var(--text-main);
    font-weight: 800;
}

.modal-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 22px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* توست نوتیفیکیشن */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1F2937;
    color: #FFF;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.toast.success {
    background: #065F46;
    border-left: 4px solid #10B981;
}

.toast.error {
    background: #991B1B;
    border-left: 4px solid #EF4444;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
