/**
 * Workflow List View Styles
 * Extracted from workflows.html - List view, KPI cards, table styles
 */

/* CRITICAL: Ensure list view shows by default, builder view hidden */
#listView {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#builderView {
    display: none !important;
    visibility: hidden !important;
}
#builderView.active {
    display: block !important;
    visibility: visible !important;
}
#listView.hidden {
    display: none !important;
    visibility: hidden !important;
}

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

.wf-kpi-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wf-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--kpi-color, #38bdf8) 0%, transparent 100%);
}

.wf-kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.wf-kpi-card.total { --kpi-color: #38bdf8; }
.wf-kpi-card.active { --kpi-color: #34d399; }
.wf-kpi-card.draft { --kpi-color: #a78bfa; }
.wf-kpi-card.nodes { --kpi-color: #fbbf24; }

.wf-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--kpi-rgb, 56, 189, 248), 0.2) 0%, rgba(var(--kpi-rgb, 56, 189, 248), 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--kpi-color);
    margin-bottom: 12px;
}

.wf-kpi-card.total .wf-kpi-icon { --kpi-rgb: 56, 189, 248; }
.wf-kpi-card.active .wf-kpi-icon { --kpi-rgb: 52, 211, 153; }
.wf-kpi-card.draft .wf-kpi-icon { --kpi-rgb: 167, 139, 250; }
.wf-kpi-card.nodes .wf-kpi-icon { --kpi-rgb: 251, 191, 36; }

.wf-kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.wf-kpi-trend {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.wf-kpi-trend.up {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.wf-kpi-trend.down {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.wf-kpi-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.wf-kpi-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    opacity: 0.3;
}

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

.wf-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wf-header-title h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wf-header-title h5 i {
    color: #8b5cf6;
}

.wf-header-actions {
    display: flex;
    gap: 12px;
}

.wf-btn-new {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wf-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.wf-btn-new i {
    font-size: 16px;
}

/* Enhanced Table */
.wf-table-container {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.wf-table {
    width: 100%;
    border-collapse: collapse;
}

.wf-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.wf-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wf-table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}

.wf-table tbody tr {
    transition: all 0.2s;
}

.wf-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.08);
}

.wf-table tbody tr:hover td {
    border-bottom-color: rgba(139, 92, 246, 0.2);
}

.wf-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wf-name-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #a78bfa;
}

.wf-name-text {
    font-weight: 600;
    color: #fff;
}

.wf-name-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

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

.wf-status-badge.active {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.wf-status-badge.draft {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

.wf-status-badge.paused {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.wf-status-badge i {
    font-size: 8px;
}

.wf-metric {
    text-align: center;
}

.wf-metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.wf-metric-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.wf-actions {
    display: flex;
    gap: 6px;
}

.wf-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wf-action-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.wf-action-btn.edit:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.wf-action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}
