/**
 * Shois Chat Button — Analytics & Settings CSS
 * @package ShoisChatButton
 */

/* ═══ KPI CARDS ═══ */
.shcb-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.shcb-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    background: var(--scb-card-bg, #fff);
    border: 1px solid var(--scb-border, #e5e7eb);
    border-radius: 12px;
}

.shcb-kpi-icon {
    font-size: 24px;
}

.shcb-kpi-content {
    flex: 1;
}

.shcb-kpi-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--scb-text, #1e293b);
    line-height: 1.2;
}

.shcb-kpi-label {
    font-size: 12px;
    color: var(--scb-text-light, #64748b);
}

.shcb-kpi-change {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.shcb-kpi-up {
    color: var(--scb-primary);
    background: #dcfce7;
}

.shcb-kpi-down {
    color: #dc2626;
    background: #fee2e2;
}

/* ═══ CHART ═══ */
.shcb-mini-chart {
    padding: 16px;
}

.shcb-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
}

.shcb-chart-bar-group {
    flex: 1;
    display: flex;
    gap: 1px;
    align-items: flex-end;
    height: 100%;
}

.shcb-chart-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s;
}

.shcb-chart-bar-imp {
    background: #c7d2fe;
}

.shcb-chart-bar-click {
    background: var(--scb-primary, #6366f1);
}

.shcb-chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--scb-text-light, #64748b);
}

.shcb-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shcb-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.shcb-legend-imp {
    background: #c7d2fe;
}

.shcb-legend-click {
    background: var(--scb-primary, #6366f1);
}

.shcb-chart-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* ═══ PLATFORM BREAKDOWN ═══ */
.shcb-platform-breakdown {
    padding: 8px 0;
}

.shcb-platform-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.shcb-platform-stat-name {
    width: 90px;
    font-size: 12px;
    font-weight: 500;
    color: var(--scb-text, #1e293b);
    text-transform: capitalize;
}

.shcb-platform-stat-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.shcb-platform-stat-bar {
    height: 100%;
    background: var(--scb-primary, #6366f1);
    border-radius: 4px;
    transition: width 0.3s;
}

.shcb-platform-stat-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--scb-text, #1e293b);
    min-width: 32px;
    text-align: right;
}

.shcb-no-data {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 13px;
}

/* ═══ DEVICE ═══ */
.shcb-device-breakdown {
    padding: 16px;
}

.shcb-device-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.shcb-device-mobile {
    height: 100%;
    background: var(--scb-primary, #6366f1);
    border-radius: 6px;
    transition: width 0.3s;
}

.shcb-device-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--scb-text-light, #64748b);
}

/* ═══ PERIOD SELECTOR ═══ */
.shcb-period-selector {
    display: flex;
    gap: 4px;
}

.shcb-period-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.shcb-period-btn:hover {
    border-color: var(--scb-primary, #6366f1);
}

.shcb-period-btn-active {
    border-color: var(--scb-primary, #6366f1);
    background: var(--scb-primary, #6366f1);
    color: #fff;
}

/* ═══ COLUMNS ═══ */
.shcb-analytics-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .shcb-analytics-columns {
        grid-template-columns: 1fr;
    }
}

/* ═══ SETTINGS ═══ */
.shcb-settings-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--scb-card-bg, #fff);
    border: 1px solid var(--scb-border, #e5e7eb);
    border-radius: 10px;
}

.shcb-import-export-actions {
    display: flex;
    gap: 10px;
    padding: 8px 0;
}

.shcb-import-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shcb-loading {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}