/**
 * Shois Chat Button — Agents & Display Rules CSS
 * @package ShoisChatButton
 */

/* ═══ AGENTS ═══ */
/* ═══ AGENTS TABLE ═══ */
.shcb-agents-list-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

.shcb-agents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.shcb-agents-table thead {
    background: #fdfdfd;
    border-bottom: 2px solid #f1f5f9;
}

.shcb-agents-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.shcb-agent-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.shcb-agent-row:last-child {
    border-bottom: none;
}

.shcb-agent-row:hover {
    background: #f8fafc;
}

.shcb-agent-row td {
    padding: 16px 20px;
    vertical-align: middle;
}

.shcb-agent-disabled {
    opacity: 0.7;
}

/* Avatar Cell */
.shcb-agent-list-avatar img,
.shcb-agent-list-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.shcb-agent-list-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    background: var(--scb-primary);
}

/* Name Cell */
.shcb-agent-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

/* Title Cell */
.shcb-agent-title {
    color: #64748b;
    font-size: 14px;
}

/* Status Badge */
.shcb-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.shcb-status-online {
    background: rgba(81, 112, 255, 0.08);
    color: #5170ff;
}

.shcb-status-offline {
    background: #f1f5f9;
    color: #64748b;
}

.shcb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Platforms Cell */
.shcb-agent-platforms-list {
    display: flex;
    gap: 6px;
}

.shcb-agent-platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 6px;
}

.shcb-agent-platform-icon svg {
    width: 100%;
    height: 100%;
}

.shcb-platform-initial {
    font-size: 14px;
    font-weight: 700;
}

.shcb-no-platforms {
    color: #cbd5e1;
}

/* Actions Cell */
.shcb-row-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.shcb-row-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
}

.shcb-row-action-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.shcb-action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Drawer */
.shcb-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    display: flex;
    justify-content: flex-end;
}

.shcb-drawer {
    width: 480px;
    max-width: 100%;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    animation: scb-drawer-slide 250ms ease-out;
}

@keyframes scb-drawer-slide {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.shcb-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.shcb-drawer-header h3 {
    margin: 0;
    font-size: 16px;
}

.shcb-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.shcb-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.shcb-drawer-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.shcb-platform-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.shcb-platform-row-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.shcb-platform-row-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shcb-field-label-sm {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px !important;
}

.shcb-platform-select {
    max-width: 160px;
    flex: 1;
}

/* Empty state */
.shcb-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--scb-text-light, #64748b);
}

.shcb-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

/* ═══ SCHEDULE ═══ */
.shcb-schedule-days {
    margin-top: 12px;
}

.shcb-schedule-day {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.shcb-schedule-day-off {
    opacity: 0.6;
}

.shcb-schedule-day-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 70px;
}

.shcb-schedule-day-name {
    font-size: 13px;
    font-weight: 500;
}

.shcb-schedule-times {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.shcb-time-input {
    max-width: 110px;
    padding: 5px 8px;
    font-size: 12px;
}

.shcb-schedule-sep {
    color: #94a3b8;
}

.shcb-schedule-closed {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.shcb-btn-xs {
    padding: 3px 8px;
    font-size: 10px;
}

/* ═══ DISPLAY RULES ═══ */
.shcb-rules-mode {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.shcb-mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--scb-border);
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    text-align: center;
}

.shcb-mode-btn:hover {
    border-color: var(--scb-primary);
}

.shcb-mode-btn-active {
    border-color: var(--scb-primary);
    background: var(--scb-primary-light);
    font-weight: 600;
}

.shcb-rules-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shcb-rule-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: var(--scb-card-bg, #fff);
    border: 1px solid var(--scb-border, #e5e7eb);
    border-radius: 10px;
}

.shcb-rule-type-select {
    max-width: 220px;
}

.shcb-rule-value-input {
    flex: 1;
}

.shcb-rules-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 12px;
}

.shcb-rules-save {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toggle sizes */
.shcb-toggle-sm .shcb-toggle-slider {
    width: 34px;
    height: 18px;
}

.shcb-toggle-sm .shcb-toggle-slider::before {
    width: 14px;
    height: 14px;
}

.shcb-toggle-sm input:checked+.shcb-toggle-slider::before {
    transform: translateX(16px);
}