<?php
function essb_render_analytics_styles() {
    ?>
    <style>
        :root {
            --essb-primary: #3b82f6;
            --essb-primary-dark: #2563eb;
            --essb-success: #10b981;
            --essb-danger: #ef4444;
            --essb-warning: #f59e0b;
            --essb-text: #1e293b;
            --essb-text-light: #64748b;
            --essb-border: #e2e8f0;
            --essb-bg: #fff;
            --essb-card-bg: #ffffff;
            --essb-shadow: none;
            --essb-shadow-hover: 0 4px 6px rgba(0,0,0,0.1);
        }
        
        .essb-analytics-wrap {
            background: var(--essb-bg);
            border-radius: 8px;
            padding: 24px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            color: var(--essb-text);
        }
        
        /* Header */
        .essb-analytics-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            flex-wrap: wrap;
            gap: 16px;
        }
        
        .essb-analytics-title {
            font-size: 20px;
            font-weight: 600;
            color: var(--essb-text);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .essb-icon {
            color: var(--essb-primary);
        }
        
        /* Period Selector */
		.essb-period-filter {
			margin-left: auto;
		}
        .essb-period-select-wrapper {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        
        .essb-period-select {
            padding: 8px 12px;
            border: 1px solid var(--essb-border);
            border-radius: 6px;
            font-size: 13px;
            background: var(--essb-card-bg);
            cursor: pointer;
            color: var(--essb-text);
            min-width: 140px;
        }
        
        .essb-period-select:focus {
            outline: none;
            border-color: var(--essb-primary);
        }
        
        .essb-custom-range {
            display: inline-flex;
            gap: 8px;
            align-items: center;
            padding: 4px 8px;
            background: var(--essb-bg);
            border-radius: 6px;
            border: 1px solid var(--essb-border);
        }
        
        .essb-custom-range input {
            padding: 2px 5px;
            border: 1px solid var(--essb-border);
            border-radius: 4px;
            font-size: 12px;
        }
        
        .essb-custom-range input:focus {
            outline: none;
            border-color: var(--essb-primary);
        }
        
        .essb-custom-range span {
            color: var(--essb-text-light);
            font-size: 12px;
        }
        
        /* Navigation */
        .essb-analytics-nav {
            margin-bottom: 24px;
        }
        
        .essb-nav-tabs {
            display: flex;
            gap: 4px;
            padding: 4px;
            border-radius: 8px;
            flex-wrap: wrap;
        }
        
        .essb-nav-tab {
            padding: 4px 12px;
            color: var(--essb-text-light);
            text-decoration: none;
            border-radius: 6px;
            transition: all 0.2s ease;
            font-weight: 500;
            font-size: 13px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        
        .essb-nav-tab:hover {
            background: var(--essb-bg);
            color: var(--essb-primary);
        }
        
        .essb-nav-tab.active {
            background: var(--essb-primary);
            color: white;
        }
        
        .essb-nav-icon {
            width: 14px;
            height: 14px;
        }
        
        /* KPI Cards */
        .essb-kpi-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }
        
        .essb-kpi-card {
            background: var(--essb-card-bg);
            border-radius: 8px;
            padding: 16px;
            box-shadow: var(--essb-shadow);
            border: 1px solid var(--essb-border);
            transition: all 0.2s ease;
        }
        
        .essb-kpi-card:hover {
            box-shadow: var(--essb-shadow-hover);
        }
        
        .essb-kpi-title {
            font-size: 12px;
            font-weight: 500;
            color: var(--essb-text-light);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .essb-kpi-value {
            font-size: 28px;
            font-weight: 600;
            color: var(--essb-text);
            margin-bottom: 8px;
        }
        
        .essb-kpi-compare {
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .essb-trend-up {
            color: var(--essb-success);
			    padding: 2px 6px;
    border-radius: 5px;
        }
        
        .essb-trend-down {
            color: var(--essb-danger);
			    padding: 2px 6px;
    border-radius: 5px;
        }
        
        /* Chips - Updated with flex layout */
        .essb-chip-wrapper {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 12px 0 8px 0;
        }
        
        .essb-chip {
            display: inline-block;
            padding: 4px 10px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 500;
            color: #1e293b;
        }
        
        .essb-chip-network {
            background: #eef2ff;
            border-color: #c7d2fe;
            color: #1e40af;
        }
        
        .essb-chip-position {
            background: #fef3c7;
            border-color: #fde68a;
            color: #92400e;
        }
        
        .essb-chip-device {
            background: #d1fae5;
            border-color: #a7f3d0;
            color: #065f46;
        }
        
        .essb-chip-small {
            padding: 2px 8px;
            font-size: 11px;
        }
        
        .essb-value-wrapper {
            text-align: right;
        }
        
        .essb-kpi-value-small {
            font-size: 24px;
            font-weight: 600;
            color: #1e293b;
            line-height: 1.2;
        }
        
        .essb-kpi-label-small {
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #64748b;
        }
        
        .essb-kpi-sub {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 8px;
            font-size: 12px;
        }
        
        .essb-kpi-sub-label {
            color: #64748b;
            font-size: 11px;
        }
        
        .essb-kpi-percent {
            font-size: 11px;
            color: #64748b;
            margin-top: 8px;
            text-align: right;
        }
        
        .essb-kpi-stats {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            gap: 12px;
        }
        
        .essb-kpi-stats-inline {
            margin-top: 12px;
            padding-top: 8px;
            border-top: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
        }
        
        .essb-stat-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .essb-stat-label {
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #64748b;
        }
        
        .essb-stat-value {
            font-size: 14px;
            font-weight: 600;
            color: #1e293b;
        }
        
        /* Charts */
        .essb-chart-container {
            background: var(--essb-card-bg);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 24px;
            box-shadow: var(--essb-shadow);
            border: 1px solid var(--essb-border);
        }
        
        .essb-chart-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--essb-text);
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--essb-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        /* Chart canvas container */
        #trend-line-chart {
            max-height: 400px;
            width: 100%;
        }
        
        /* Progress Bar */
        .essb-progress-bar {
            background: var(--essb-border);
            border-radius: 10px;
            overflow: hidden;
            height: 6px;
        }
        
        .essb-progress-bar-small {
            height: 4px;
            margin-top: 6px;
        }
        
        .essb-progress-fill {
            background: var(--essb-primary);
            height: 100%;
            transition: width 0.3s ease;
        }
        
        /* Modern Table - Fixed border display */
        .essb-table-wrapper {
            overflow-x: auto;
            margin-top: 16px;
        }
        
        .essb-modern-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        
        .essb-modern-table thead tr {
            border-bottom: 1px solid var(--essb-border);
        }
        
        .essb-modern-table thead th {
            background: #f8fafc;
            padding: 12px 16px;
            text-align: left;
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            color: #64748b;
        }
        
        .essb-modern-table tbody tr {
            border-bottom: 1px solid #e2e8f0;
        }
        
        .essb-modern-table tbody tr:hover {
            background: #f8fafc;
        }
        
        .essb-modern-table tbody td {
            padding: 12px 16px;
            vertical-align: middle;
        }
        
        /* Table Columns */
        .essb-table-post {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .essb-table-number {
            text-align: right;
            white-space: nowrap;
        }
        
        .essb-rank {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            background: #f1f5f9;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            color: #64748b;
            flex-shrink: 0;
        }
        
        .essb-table-post a {
            color: #3b82f6;
            text-decoration: none;
            font-weight: 500;
            flex: 1;
        }
        
        .essb-table-post a:hover {
            text-decoration: underline;
        }
        
        .essb-clicks-small {
            font-size: 11px;
            color: #64748b;
            margin-left: 6px;
        }
        
        /* Empty State */
        .essb-empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #64748b;
        }
        
        .essb-empty-state svg {
            margin-bottom: 16px;
            color: #94a3b8;
        }
        
        .essb-empty-state p {
            margin: 0;
            font-size: 14px;
        }
        
        .essb-empty-state-sub {
            font-size: 12px;
            margin-top: 8px;
            color: #94a3b8;
        }
        
        /* Filter Bar */
        .essb-filter-bar {
            background: var(--essb-card-bg);
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            align-items: center;
            box-shadow: var(--essb-shadow);
            border: 1px solid var(--essb-border);
        }
        
        .essb-filter-select {
            padding: 6px 12px;
            border: 1px solid var(--essb-border);
            border-radius: 6px;
            background: var(--essb-card-bg);
            font-size: 13px;
        }
        
        /* Heatmap */
        .essb-heatmap-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 1px;
            background: var(--essb-border);
            border: 1px solid var(--essb-border);
            border-radius: 8px;
            overflow: hidden;
        }
        
/* Heatmap Cell with text contrast */
.essb-heatmap-cell {
    transition: all 0.2s ease;
    cursor: pointer;
}

.essb-heatmap-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 3;
    position: relative;
}

.essb-heatmap-cell-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.essb-heatmap-clicks {
    font-weight: 600;
    font-size: 13px;
    /* Color will be set by JavaScript */
}

.essb-heatmap-percent {
    font-size: 10px;
    /* Color will be set by JavaScript */
}

/* Heatmap Legend - Update to show blue shades */
.essb-legend-colors {
    display: flex;
    gap: 2px;
}

.essb-legend-color {
    width: 24px;
    height: 12px;
    border-radius: 2px;
}        
        /* Trends */
        .essb-trends-section {
            background: var(--essb-card-bg);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            border: 1px solid var(--essb-border);
        }
        
        .essb-recommendation-card {
            background: #fef3c7;
            border-left: 3px solid var(--essb-warning);
            padding: 12px 16px;
            border-radius: 6px;
            margin-bottom: 12px;
        }
        
        .essb-recommendation-card:last-child {
            margin-bottom: 0;
        }
        
        /* Buttons */
        .essb-btn {
            padding: 6px 12px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        
        .essb-btn-primary {
            background: var(--essb-primary);
            color: white;
        }
        
        .essb-btn-primary:hover {
            background: var(--essb-primary-dark);
        }
        
        .essb-btn-secondary {
            background: var(--essb-bg);
            color: var(--essb-text);
            border: 1px solid var(--essb-border);
        }
        
        .essb-btn-secondary:hover {
            background: var(--essb-border);
        }
        
        /* Badges */
        .essb-badge {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
        }
        
        .essb-badge-success {
            background: #d1fae5;
            color: #065f46;
        }
        
        .essb-badge-warning {
            background: #fed7aa;
            color: #92400e;
        }
        
        .essb-badge-neutral {
            background: var(--essb-bg);
            color: var(--essb-text-light);
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .essb-analytics-wrap {
                padding: 16px;
            }
            
            .essb-analytics-header {
                flex-direction: column;
                align-items: stretch;
            }
            
            .essb-kpi-grid {
                grid-template-columns: 1fr;
            }
            
            .essb-nav-tab {
                padding: 6px 12px;
                font-size: 12px;
            }
            
            .essb-modern-table thead th,
            .essb-modern-table tbody td {
                padding: 8px 12px;
            }
            
            .essb-rank {
                width: 20px;
                height: 20px;
                font-size: 10px;
            }
            
            .essb-table-number {
                font-size: 11px;
            }
            
            #trend-line-chart {
                max-height: 300px;
            }
            
            .essb-chip-wrapper {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }
            
            .essb-value-wrapper {
                text-align: left;
                width: 100%;
            }
        }
/* Link Button */
.essb-link-btn {
    color: var(--essb-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.essb-link-btn:hover {
    color: var(--essb-primary-dark);
    text-decoration: underline;
}

/* Table Network Chip */
.essb-table-network {
    white-space: nowrap;
}	
		
		/* Table Controls */
.essb-table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.essb-table-search {
    padding: 6px 12px;
    border: 1px solid var(--essb-border);
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
}

.essb-table-search:focus {
    outline: none;
    border-color: var(--essb-primary);
}

.essb-table-rows {
    padding: 6px 12px;
    border: 1px solid var(--essb-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--essb-card-bg);
    cursor: pointer;
}
		
		/* Table Footer & Pagination */
.essb-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--essb-border);
    font-size: 13px;
}

.essb-table-info {
    color: var(--essb-text-light);
    font-size: 12px;
}

.essb-table-pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.essb-pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--essb-border);
    background: var(--essb-card-bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--essb-text);
    transition: all 0.2s ease;
}

.essb-pagination-btn:hover:not(:disabled) {
    background: var(--essb-bg);
    border-color: var(--essb-primary);
    color: var(--essb-primary);
}

.essb-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.essb-page-btn {
    padding: 6px 10px;
    min-width: 32px;
    border: 1px solid var(--essb-border);
    background: var(--essb-card-bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--essb-text);
    transition: all 0.2s ease;
    text-align: center;
}

.essb-page-btn:hover:not(.active) {
    background: var(--essb-bg);
    border-color: var(--essb-primary);
    color: var(--essb-primary);
}

.essb-page-btn.active {
    background: var(--essb-primary);
    border-color: var(--essb-primary);
    color: white;
    cursor: default;
}

.essb-pagination-pages {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Sortable Columns */
.essb-modern-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.essb-modern-table th.sortable:hover {
    background: #eef2ff;
}

.essb-modern-table th .sort-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    color: var(--essb-text-light);
    opacity: 0.6;
}

.essb-modern-table th.sortable:hover .sort-icon {
    opacity: 1;
}

/* Table Controls */
.essb-table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.essb-table-search {
    padding: 6px 12px;
    border: 1px solid var(--essb-border);
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
    background: var(--essb-card-bg);
    color: var(--essb-text);
}

.essb-table-search:focus {
    outline: none;
    border-color: var(--essb-primary);
}

.essb-table-rows {
    padding: 6px 12px;
    border: 1px solid var(--essb-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--essb-card-bg);
    cursor: pointer;
    color: var(--essb-text);
}

.essb-table-rows:focus {
    outline: none;
    border-color: var(--essb-primary);
}

/* Table Network Chip */
.essb-table-network {
    white-space: nowrap;
}

/* Link Button */
.essb-link-btn {
    color: var(--essb-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.essb-link-btn:hover {
    color: var(--essb-primary-dark);
    text-decoration: underline;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .essb-table-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .essb-table-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .essb-pagination-pages {
        order: -1;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .essb-table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .essb-table-search {
        width: 100%;
    }
}
		/* Table Position Chip */
.essb-table-position {
    white-space: nowrap;
}

.essb-table-position .essb-chip {
    display: inline-block;
}
		
		/* Device Comparison Styles */
.essb-device-comparison {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.essb-device-stat {
    flex: 1;
    text-align: center;
}

.essb-comparison-bar {
    margin: 16px 0;
}

.essb-comparison-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--essb-text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.essb-comparison-track {
    display: flex;
    height: 12px;
    background: var(--essb-border);
    border-radius: 6px;
    overflow: hidden;
}

.essb-comparison-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.essb-comparison-desktop {
    background: #3b82f6;
}

.essb-comparison-mobile {
    background: #10b981;
}

.essb-comparison-percent {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--essb-text);
}

/* Two Column Layout */
.essb-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .essb-two-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .essb-device-comparison {
        flex-direction: column;
        gap: 16px;
    }
    
    .essb-device-stat {
        text-align: left;
    }
}
		
		/* Device Comparison Styles */
.essb-device-comparison {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.essb-device-stat-left {
    flex: 1;
    text-align: left;
}

.essb-device-stat-right {
    flex: 1;
    text-align: right;
}

.essb-device-stat .essb-kpi-title {
    margin-bottom: 8px;
}

.essb-device-stat .essb-kpi-value {
    margin-bottom: 0;
}
		
		/* Heatmap Table Styles */
.essb-heatmap-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.essb-heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 600px;
}

.essb-heatmap-table th,
.essb-heatmap-table td {
    border: 1px solid var(--essb-border);
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

.essb-heatmap-corner {
    background: var(--essb-bg);
    font-weight: 600;
    color: var(--essb-text);
    position: sticky;
    left: 0;
    background-color: var(--essb-card-bg);
    z-index: 2;
}

.essb-heatmap-header {
    background: var(--essb-bg);
    font-weight: 500;
    color: var(--essb-text);
    min-width: 100px;
}

.essb-heatmap-header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.essb-heatmap-total {
    font-size: 10px;
    color: var(--essb-text-light);
    font-weight: normal;
}

.essb-heatmap-row-header {
    background: var(--essb-bg);
    font-weight: 500;
    color: var(--essb-text);
    position: sticky;
    left: 0;
    background-color: var(--essb-card-bg);
    z-index: 1;
}

.essb-heatmap-row-header .essb-heatmap-header-content {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
}

.essb-heatmap-cell {
    transition: all 0.2s ease;
    cursor: pointer;
}

.essb-heatmap-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 3;
    position: relative;
}

.essb-heatmap-cell-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.essb-heatmap-clicks {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.essb-heatmap-percent {
    font-size: 10px;
    color: #475569;
}

.essb-heatmap-row-total,
.essb-heatmap-footer,
.essb-heatmap-footer-corner,
.essb-heatmap-footer-total {
    background: var(--essb-bg);
    font-weight: 600;
}

.essb-heatmap-row-total {
    background: #f8fafc;
    font-weight: 600;
}

.essb-heatmap-footer-corner {
    background: var(--essb-bg);
    text-align: right;
}

.essb-heatmap-footer {
    background: var(--essb-bg);
    font-weight: 600;
}

.essb-heatmap-footer-total {
    background: var(--essb-bg);
    font-weight: 700;
}

/* Heatmap Legend */
.essb-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--essb-text-light);
}

.essb-legend-label {
    font-weight: 500;
}

.essb-legend-colors {
    display: flex;
    gap: 2px;
}

.essb-legend-color {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

.essb-legend-text {
    font-size: 10px;
}

/* Heatmap Stats */
.essb-heatmap-stats {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--essb-border);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}

.essb-heatmap-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.essb-heatmap-stat-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--essb-text-light);
}

.essb-heatmap-stat-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--essb-text);
}

/* Responsive */
@media (max-width: 768px) {
    .essb-heatmap-stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .essb-heatmap-table th,
    .essb-heatmap-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .essb-heatmap-clicks {
        font-size: 11px;
    }
    
    .essb-heatmap-percent {
        font-size: 9px;
    }
}
		/* Heatmap Cell with text contrast */
.essb-heatmap-cell {
    transition: all 0.2s ease;
    cursor: pointer;
}

.essb-heatmap-cell-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.essb-heatmap-clicks {
    font-weight: 600;
    font-size: 13px;
}

.essb-heatmap-percent {
    font-size: 10px;
}

/* Dynamic text color based on background will be handled by JavaScript */
		/* Trends Welcome Section */
.essb-trends-welcome {
    background: linear-gradient(135deg, var(--essb-primary) 0%, var(--essb-primary-dark) 100%);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 24px;
    color: white;
}

.essb-trends-welcome-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.essb-trends-welcome-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Insight Cards */
.essb-insight-card {
    background: var(--essb-card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--essb-shadow);
    border: 1px solid var(--essb-border);
    transition: all 0.2s ease;
}

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

.essb-insight-icon {
    font-size: 32px;
}

.essb-insight-content {
    flex: 1;
}

.essb-insight-title {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--essb-text-light);
    margin-bottom: 4px;
}

.essb-insight-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--essb-text);
    line-height: 1.2;
}

.essb-insight-desc {
    font-size: 11px;
    color: var(--essb-text-light);
    margin-top: 4px;
}

/* Section Headers */
.essb-section-header {
    margin-bottom: 20px;
}

.essb-section-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--essb-text);
}

.essb-section-header p {
    margin: 0;
    font-size: 13px;
    color: var(--essb-text-light);
}

/* Recommendations Grid */
.essb-recommendations-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.essb-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.essb-recommendation-card {
    background: var(--essb-card-bg);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid;
    box-shadow: var(--essb-shadow);
}

.essb-recommendation-primary {
    border-left-color: var(--essb-primary);
}

.essb-recommendation-secondary {
    border-left-color: var(--essb-success);
}

.essb-recommendation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.essb-recommendation-icon {
    font-size: 20px;
}

.essb-recommendation-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--essb-text-light);
}

.essb-recommendation-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--essb-text);
}

.essb-recommendation-message {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--essb-text-light);
    line-height: 1.5;
}

.essb-recommendation-action {
    background: var(--essb-bg);
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.essb-tag {
    background: var(--essb-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Trend List */
.essb-trend-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.essb-trend-item {
    background: var(--essb-card-bg);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--essb-border);
}

.essb-trend-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.essb-trend-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--essb-text);
}

.essb-trend-change {
    font-weight: 600;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
}

.essb-trend-surge {
    background: #dcfce7;
    color: #166534;
}

.essb-trend-up {
    background: #d1fae5;
    color: #065f46;
}

.essb-trend-slight-up {
    background: #e6f7e6;
    color: #2e7d32;
}

.essb-trend-plunge {
    background: #fee2e2;
    color: #991b1b;
}

.essb-trend-down {
    background: #fef3c7;
    color: #92400e;
}

.essb-trend-slight-down {
    background: #fff3e0;
    color: #b45309;
}

.essb-trend-stable {
    background: #f1f5f9;
    color: #475569;
}

.essb-trend-bars {
    margin: 12px 0;
}

.essb-trend-bar-label {
    font-size: 11px;
    color: var(--essb-text-light);
    margin-bottom: 4px;
}

.essb-trend-bar-container {
    background: var(--essb-border);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.essb-trend-bar {
    height: 100%;
    border-radius: 4px;
}

.essb-trend-bar-current {
    background: var(--essb-primary);
}

.essb-trend-bar-previous {
    background: #94a3b8;
}

.essb-trend-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.essb-trend-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.essb-trend-insight {
    font-size: 11px;
    color: var(--essb-text-light);
}

/* Recommended Order */
.essb-recommended-order {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.essb-order-device {
    background: var(--essb-bg);
    border-radius: 12px;
    padding: 20px;
}

.essb-order-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--essb-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--essb-border);
}

.essb-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.essb-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--essb-card-bg);
    border-radius: 8px;
}

.essb-order-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--essb-primary);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.essb-order-network {
    font-size: 13px;
    font-weight: 500;
    color: var(--essb-text);
}

/* Actions Summary */
.essb-actions-summary {
    background: linear-gradient(135deg, #fef9e3 0%, #ffffff 100%);
}

.essb-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.essb-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--essb-card-bg);
    border-radius: 8px;
    border-left: 3px solid;
}

.essb-action-high {
    border-left-color: #ef4444;
}

.essb-action-medium {
    border-left-color: #f59e0b;
}

.essb-action-low {
    border-left-color: #10b981;
}

.essb-action-icon {
    font-size: 20px;
}

.essb-action-text {
    font-size: 13px;
    color: var(--essb-text);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .essb-recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .essb-recommended-order {
        grid-template-columns: 1fr;
    }
    
    .essb-trend-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .essb-trend-status {
        flex-direction: column;
        align-items: flex-start;
    }
}
		/* Trends Welcome Section */
.essb-trends-welcome {
    background: var(--essb-card-bg);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 24px;
    border: 1px solid var(--essb-border);
}

.essb-trends-welcome-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--essb-text);
}

.essb-trends-welcome-content p {
    margin: 0;
    color: var(--essb-text-light);
    font-size: 14px;
}

/* Insights Grid */
.essb-insights-grid {
    margin-bottom: 24px;
}

/* Insight Cards */
.essb-insight-card {
    background: var(--essb-card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--essb-shadow);
    border: 1px solid var(--essb-border);
    transition: all 0.2s ease;
}

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

.essb-insight-icon {
    font-size: 32px;
}

.essb-insight-content {
    flex: 1;
}

.essb-insight-title {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--essb-text-light);
    margin-bottom: 4px;
}

.essb-insight-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--essb-text);
    line-height: 1.2;
}

.essb-insight-desc {
    font-size: 11px;
    color: var(--essb-text-light);
    margin-top: 4px;
}
		
		/* Detail View Styles */
.essb-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.essb-detail-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--essb-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.essb-detail-icon {
    font-size: 24px;
}

.essb-detail-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.essb-chip-primary {
    background: var(--essb-primary);
    border-color: var(--essb-primary-dark);
    color: white;
}

.essb-chip-desktop {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1e40af;
}

.essb-chip-mobile {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.essb-chip-percent {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
    .essb-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .essb-detail-chips {
        width: 100%;
    }
}
	
.essb-chart-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.essb-chart-filters .essb-filter-select {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 130px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.essb-chart-filters .essb-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
}

@media (max-width: 768px) {
    .essb-chart-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .essb-chart-filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .essb-chart-filters .essb-filter-select {
        flex: 1;
        min-width: auto;
    }
}		
    </style>
    <?php
}


?>