/**
 * Premium Shared Design System
 * Modern SaaS style — white cards, subtle shadows, purple/teal gradient accents.
 * Loaded on all plugin admin pages via strp-sub-admin enqueue.
 */

/* ---------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   --------------------------------------------------------------- */
:root {
    --strp-primary: #8444F9;
    --strp-primary-light: #6C63FF;
    --strp-primary-bg: rgba(132, 68, 249, 0.08);
    --strp-primary-border: rgba(132, 68, 249, 0.2);
    --strp-teal: #00d4aa;
    --strp-teal-bg: rgba(0, 212, 170, 0.08);
    --strp-teal-border: rgba(0, 212, 170, 0.2);
    --strp-success: #00a32a;
    --strp-warning: #dba617;
    --strp-danger: #d63638;
    --strp-text-primary: #1e293b;
    --strp-text-secondary: #64748b;
    --strp-text-muted: #94a3b8;
    --strp-surface: #ffffff;
    --strp-surface-secondary: #f8fafc;
    --strp-surface-tertiary: #f1f5f9;
    --strp-border: #e2e8f0;
    --strp-radius-sm: 8px;
    --strp-radius-md: 12px;
    --strp-radius-lg: 16px;
    --strp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --strp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --strp-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --strp-gradient: linear-gradient(135deg, #8444F9, #6C63FF);
    --strp-gradient-accent: linear-gradient(135deg, #8444F9, #00d4aa);
    --strp-transition: 200ms ease;
}

/* ---------------------------------------------------------------
   Premium Card
   --------------------------------------------------------------- */
.strp-card {
    background: var(--strp-surface);
    border-radius: var(--strp-radius-md);
    box-shadow: var(--strp-shadow-sm);
    padding: 24px;
    transition: box-shadow var(--strp-transition);
}

.strp-card:hover {
    box-shadow: var(--strp-shadow-md);
}

.strp-card--flat {
    box-shadow: none;
    border: 1px solid var(--strp-border);
}

/* ---------------------------------------------------------------
   KPI Stat Cards
   --------------------------------------------------------------- */
.strp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.strp-kpi-card {
    background: var(--strp-surface);
    border-radius: var(--strp-radius-md);
    box-shadow: var(--strp-shadow-sm);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.strp-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--strp-gradient);
    border-radius: var(--strp-radius-md) var(--strp-radius-md) 0 0;
}

.strp-kpi-card--teal::before {
    background: var(--strp-teal);
}

.strp-kpi-card--success::before {
    background: var(--strp-success);
}

.strp-kpi-card--warning::before {
    background: var(--strp-warning);
}

.strp-kpi-card--danger::before {
    background: var(--strp-danger);
}

.strp-kpi-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--strp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.strp-kpi-card__value {
    font-size: 32px;
    font-weight: 700;
    color: var(--strp-text-primary);
    margin: 0;
    line-height: 1.2;
}

.strp-kpi-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.strp-kpi-card__trend--up {
    color: var(--strp-success);
}

.strp-kpi-card__trend--down {
    color: var(--strp-danger);
}

/* ---------------------------------------------------------------
   Chart Container
   --------------------------------------------------------------- */
.strp-chart-wrap {
    background: var(--strp-surface);
    border-radius: var(--strp-radius-md);
    box-shadow: var(--strp-shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.strp-chart-wrap__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.strp-chart-wrap__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin: 0;
}

.strp-chart-wrap__canvas {
    width: 100%;
    max-height: 300px;
}

/* ---------------------------------------------------------------
   Period Selector
   --------------------------------------------------------------- */
.strp-period-selector {
    display: inline-flex;
    background: var(--strp-surface-tertiary);
    border-radius: var(--strp-radius-sm);
    padding: 2px;
}

.strp-period-selector__btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--strp-text-secondary);
    cursor: pointer;
    transition: all var(--strp-transition);
}

.strp-period-selector__btn--active,
.strp-period-selector__btn:hover {
    background: var(--strp-surface);
    color: var(--strp-primary);
    box-shadow: var(--strp-shadow-sm);
}

/* ---------------------------------------------------------------
   Activity Feed
   --------------------------------------------------------------- */
.strp-activity-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.strp-activity-feed__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--strp-border);
}

.strp-activity-feed__item:last-child {
    border-bottom: none;
}

.strp-activity-feed__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.strp-activity-feed__icon--new {
    background: var(--strp-primary-bg);
    color: var(--strp-primary);
}

.strp-activity-feed__icon--upgrade {
    background: var(--strp-teal-bg);
    color: var(--strp-teal);
}

.strp-activity-feed__icon--cancel {
    background: rgba(214, 54, 56, 0.08);
    color: var(--strp-danger);
}

.strp-activity-feed__icon--warning {
    background: rgba(219, 166, 23, 0.08);
    color: var(--strp-warning);
}

.strp-activity-feed__text {
    flex: 1;
    font-size: 14px;
    color: var(--strp-text-primary);
    line-height: 1.5;
}

.strp-activity-feed__time {
    font-size: 12px;
    color: var(--strp-text-muted);
    white-space: nowrap;
}

/* ---------------------------------------------------------------
   Status Indicators
   --------------------------------------------------------------- */
.strp-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.strp-status-dot--healthy { background: var(--strp-success); }
.strp-status-dot--warning { background: var(--strp-warning); }
.strp-status-dot--error   { background: var(--strp-danger); }

.strp-status-dot--healthy,
.strp-status-dot--error {
    animation: strp-pulse 2s ease-in-out infinite;
}

@keyframes strp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
    .strp-status-dot--healthy,
    .strp-status-dot--error {
        animation: none;
    }
}

/* ---------------------------------------------------------------
   Premium Button
   --------------------------------------------------------------- */
.strp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--strp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--strp-transition);
    text-decoration: none;
}

.strp-btn--primary {
    background: var(--strp-gradient);
    color: #fff;
}

.strp-btn--primary:hover {
    box-shadow: 0 4px 12px rgba(132, 68, 249, 0.35);
    transform: translateY(-1px);
    color: #fff;
}

.strp-btn--secondary {
    background: var(--strp-surface);
    color: var(--strp-text-primary);
    border: 1px solid var(--strp-border);
}

.strp-btn--secondary:hover {
    border-color: var(--strp-primary);
    color: var(--strp-primary);
}

.strp-btn--ghost {
    background: transparent;
    color: var(--strp-text-secondary);
    padding: 10px 12px;
}

.strp-btn--ghost:hover {
    color: var(--strp-primary);
    background: var(--strp-primary-bg);
}

.strp-btn:focus-visible {
    outline: 2px solid var(--strp-primary);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
   Two-Column Layout
   --------------------------------------------------------------- */
.strp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ---------------------------------------------------------------
   Section Header
   --------------------------------------------------------------- */
.strp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.strp-section-header__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--strp-text-primary);
    margin: 0;
}

/* ---------------------------------------------------------------
   Empty State
   --------------------------------------------------------------- */
.strp-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.strp-empty-state__icon {
    color: var(--strp-text-muted);
    margin-bottom: 16px;
}

.strp-empty-state__icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.strp-empty-state__text {
    color: var(--strp-text-secondary);
    font-size: 15px;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 1200px) {
    .strp-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .strp-kpi-grid {
        grid-template-columns: 1fr;
    }
    .strp-grid-2 {
        grid-template-columns: 1fr;
    }
}
