/**
 * Heatmap Analytics Admin Styles
 * CSS for WordPress Admin Dashboard Interface
 * Version: 1.0.0
 */

/* =============================================================================
   Navigation Tabs
   ============================================================================= */

.nav-tab-wrapper {
    margin-bottom: 20px;
}

.nav-tab {
    text-decoration: none !important;
    color: #646970 !important;
    cursor: pointer;
}

.nav-tab:hover {
    color: #0073aa !important;
}

.nav-tab-active {
    background: #fff !important;
    border-bottom: 1px solid #fff !important;
    color: #000 !important;
}

/* =============================================================================
   Dashboard Widgets
   ============================================================================= */

.wp-heatmap-dashboard {
    padding: 20px 0;
}

.dashboard-controls,
.dashboard-controls {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-controls label {
    font-weight: 600;
    margin-right: 8px;
    color: #1d2327;
}

.dashboard-controls input[type="date"] {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 140px;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-widget {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.dashboard-widget:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-widget h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-widget .widget-number {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1.2;
}

.dashboard-widget.error .widget-number {
    color: #d63638;
}

.dashboard-widget.warning .widget-number {
    color: #dba617;
}

.dashboard-widget.success .widget-number {
    color: #00a32a;
}

/* Dashboard Charts */
.dashboard-charts {
    margin: 30px 0;
}

.chart-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    height: 400px;
}

.chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.chart-container canvas {
    max-height: 350px;
    width: 100% !important;
    height: auto !important;
}

/* Recent Activity */
.recent-activity {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.recent-activity h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-activity h3::before {
    content: "\f469";
    font-family: dashicons;
    font-size: 20px;
    color: #0073aa;
}

/* =============================================================================
   Enhanced Table Styling
   ============================================================================= */

.heatmap-table-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-controls {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e4e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.table-search input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.table-search .dashicons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
}

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

.table-filters select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

/* Enhanced table styling */
.heatmap-activity-table,
.heatmap-api-keys-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
}

.heatmap-activity-table th,
.heatmap-api-keys-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e4e7;
    position: sticky;
    top: 0;
    z-index: 10;
}

.heatmap-activity-table td,
.heatmap-api-keys-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: top;
}

.heatmap-activity-table tbody tr:hover,
.heatmap-api-keys-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #e8f0fe;
}

.sorting-indicators {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1;
}

.sorting-indicator {
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.3;
}

.sorting-indicator.asc {
    border-bottom: 4px solid #666;
    margin-bottom: 1px;
}

.sorting-indicator.desc {
    border-top: 4px solid #666;
}

.sortable.asc .sorting-indicator.asc,
.sortable.desc .sorting-indicator.desc {
    opacity: 1;
}

/* Column-specific styling */
.column-page {
    width: 35%;
    min-width: 200px;
}

.column-device {
    width: 15%;
    min-width: 120px;
}

.column-location {
    width: 18%;
    min-width: 150px;
}

.column-views {
    width: 12%;
    min-width: 80px;
    text-align: center;
}

.column-time {
    width: 20%;
    min-width: 140px;
}

.column-name {
    width: 20%;
    min-width: 150px;
}

.column-scopes {
    width: 15%;
    min-width: 120px;
}

.column-created,
.column-lastused,
.column-expires {
    width: 12%;
    min-width: 100px;
}

.column-usage {
    width: 10%;
    min-width: 80px;
    text-align: center;
}

.column-status {
    width: 10%;
    min-width: 90px;
}

.column-actions {
    width: 11%;
    min-width: 100px;
    text-align: center;
}

/* Enhanced page info styling */
.page-info {
    line-height: 1.4;
}

.page-info .page-title {
    display: block;
    color: #1d2327;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.page-info .page-url {
    font-size: 12px;
    color: #646970;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    background: #f6f7f7;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.row-actions {
    margin-top: 6px;
    font-size: 12px;
}

.row-actions span {
    color: #646970;
}

.row-actions a {
    color: #0073aa;
    text-decoration: none;
}

.row-actions a:hover {
    color: #005177;
}

.api-key-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.row-actions code {
    background: #f1f1f1;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
}

/* Enhanced device badges */
.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
    transition: all 0.2s ease;
}

.device-badge .dashicons {
    font-size: 16px;
    line-height: 1;
}

.device-badge .device-label {
    font-weight: 600;
}

.device-badge.device-desktop {
    background: #e7f3ff;
    color: #0073aa;
    border-color: #b3d9ff;
}

.device-badge.device-mobile {
    background: #e8f5e8;
    color: #2e7d2e;
    border-color: #b3e0b3;
}

.device-badge.device-tablet {
    background: #fff2e7;
    color: #b26200;
    border-color: #ffcc99;
}

.device-badge.device-unknown {
    background: #f6f7f7;
    color: #646970;
    border-color: #ddd;
}

.device-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Country info */
.location-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.location-info .dashicons {
    color: #666;
    font-size: 16px;
}

.location-info .location-text {
    font-weight: 600;
    color: #1d2327;
}

.location-unknown {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge .dashicons {
    font-size: 14px;
}

.status-badge.status-active {
    background: #d1e7dd;
    color: #0f5132;
}

.status-badge.status-inactive {
    background: #fff3cd;
    color: #664d03;
}

.status-badge.status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Scope badges enhanced */
.scope-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.scope-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    transition: all 0.2s ease;
}

.scope-read { 
    background: #e1f5fe; 
    color: #01579b; 
    border-color: #81d4fa;
}

.scope-write { 
    background: #e8f5e8; 
    color: #2e7d2e; 
    border-color: #a5d6a7;
}

.scope-admin { 
    background: #fff3e0; 
    color: #e65100; 
    border-color: #ffcc02;
}

.scope-analytics { 
    background: #f3e5f5; 
    color: #6a1b9a; 
    border-color: #ce93d8;
}

.scope-export { 
    background: #f1f8e9; 
    color: #33691e; 
    border-color: #aed581;
}

.scope-badge:hover {
    transform: scale(1.05);
}

/* View count styling */
.view-count {
    display: inline-block;
    background: #f0f6ff;
    color: #135e96;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* Time ago styling */
.time-ago {
    color: #646970;
    font-size: 13px;
}

/* Responsive design */
@media (max-width: 768px) {
    .recent-activity-table {
        font-size: 14px;
    }
    
    .recent-activity-table th,
    .recent-activity-table td {
        padding: 8px 4px;
    }
    
    .page-column {
        width: 50%;
    }
    
    .device-column {
        width: 25%;
    }
    
    .views-column,
    .time-column {
        width: 12.5%;
    }
    
    .page-info .page-url {
        display: none;
    }
    
    .device-badge {
        padding: 2px 6px;
        font-size: 10px;
    }
}

/* =============================================================================
   Heatmap Visualization
   ============================================================================= */

.wp-heatmap-heatmap-view {
    padding: 20px 0;
}

.heatmap-controls {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.heatmap-controls label {
    font-weight: 600;
    margin-right: 8px;
    color: #1d2327;
}

.heatmap-controls select {
    min-width: 150px;
}

.heatmap-display {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    min-height: 500px;
}

/* Chart placeholder text */
.chart-placeholder {
    color: #646970;
    font-style: italic;
    text-align: center;
    margin-top: 10px;
    background: #f6f7f7;
    padding: 20px;
    border-radius: 4px;
    border: 2px dashed #ddd;
}

.heatmap-visualization {
    position: relative;
    width: 100%;
    height: 100%;
}

.heatmap-grid {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.heatmap-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    background-color: rgba(255, 0, 0, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* =============================================================================
   Analytics Charts
   ============================================================================= */

.wp-heatmap-analytics-view {
    padding: 20px 0;
}

.analytics-controls {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.analytics-controls label {
    font-weight: 600;
    margin-right: 8px;
    color: #1d2327;
}

.analytics-charts {
    display: grid;
    gap: 20px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

/* =============================================================================
   Visitor Map Styles
   ============================================================================= */

#visitor-map-container {
    position: relative;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    height: 500px;
}

#visitor-map {
    width: 100%;
    height: 400px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.map-controls {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.map-controls label {
    font-weight: 600;
    margin-right: 8px;
    color: #1d2327;
}

.map-controls select {
    min-width: 200px;
    max-width: 300px;
}

.map-controls button {
    min-width: 120px;
}

#map-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f6f7f7;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    font-size: 13px;
    color: #1d2327;
}

/* Leaflet custom marker styles */
.visitor-marker {
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid white;
    background-color: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Leaflet popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

.leaflet-popup-content {
    margin: 13px 19px;
    line-height: 1.4;
    font-size: 14px;
}

.leaflet-popup-tip {
    background-color: white;
}

/* Leaflet legend styles */
.info.legend {
    background: white;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    line-height: 18px;
    color: #333;
}

.info.legend h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.info.legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
    border-radius: 2px;
}

/* Responsive map */
@media (max-width: 768px) {
    #visitor-map-container {
        height: 450px;
        padding: 15px;
    }

    #visitor-map {
        height: 350px;
    }

    .map-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .map-controls select {
        min-width: auto;
        max-width: none;
    }
}


/* =============================================================================
   API Keys Management
   ============================================================================= */

.api-key-creation {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.api-key-creation h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.api-keys-list {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
}

.api-keys-list h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.status-active {
    color: #00a32a;
    font-weight: 600;
}

.status-inactive {
    color: #646970;
    font-weight: 600;
}

/* =============================================================================
   Export Interface
   ============================================================================= */

.export-controls {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

#export-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

#export-status.success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

#export-status.error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* =============================================================================
   Loading States
   ============================================================================= */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

/* =============================================================================
   Dashboard Functionality Improvements
   ============================================================================= */

/* Working dashboard styles */
.notice {
    margin: 5px 0;
}

.notice-success {
    border-left-color: #00a32a;
    background: #d1e7dd;
}

.notice-error {
    border-left-color: #d63638;
    background: #f8d7da;
}

/* Make sure Update Dashboard button is visible */
#load-dashboard {
    min-width: 120px;
    margin-left: 10px;
}

/* Chart containers need proper height */
.chart-container canvas {
    height: 350px !important;
}

/* Dashboard controls layout */
.dashboard-controls {
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-controls input[type="date"] {
    margin-right: 15px;
}

/* Widget numbers should be readable */
.dashboard-widget .widget-number {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.5px;
}

/* Enhanced Heatmap Styles */
.heatmap-display {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.heatmap-display .chart-container {
    position: relative;
    height: 650px;
    margin-bottom: 20px;
}

#heatmapChart {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.heatmap-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    border-left: 4px solid #0073aa;
}

.heatmap-info ul {
    margin: 10px 0 0 20px;
    list-style: none;
}

.heatmap-info li {
    margin-bottom: 5px;
    font-size: 14px;
}

.heatmap-controls {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.heatmap-controls select {
    min-width: 200px;
    max-width: 300px;
}

/* Responsive heatmap */
@media (max-width: 768px) {
    .heatmap-display .chart-container {
        height: 450px;
    }
    
    .heatmap-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .heatmap-controls select {
        min-width: auto;
        max-width: none;
    }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   Notices and Alerts
   ============================================================================= */

.wp-heatmap-notice {
    margin: 5px 15px 2px;
    background: #fff;
    border-left: 4px solid #0073aa;
    box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
    padding: 1px 12px;
}

.wp-heatmap-notice.notice-error {
    border-left-color: #d63638;
}

.wp-heatmap-notice.notice-warning {
    border-left-color: #dba617;
}

.wp-heatmap-notice.notice-success {
    border-left-color: #00a32a;
}

/* =============================================================================
   Form Enhancements
   ============================================================================= */

.form-table th {
    font-weight: 600;
}

.form-table input[type="checkbox"] {
    margin-right: 8px;
}

.form-table .description {
    color: #646970;
    font-style: italic;
}

/* Color picker enhancement */
.wp-picker-container {
    display: inline-block;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 1200px) {
    .dashboard-widgets {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .dashboard-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
    
    .heatmap-controls,
    .analytics-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .heatmap-controls > *,
    .analytics-controls > * {
        margin-bottom: 10px;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .wp-heatmap-dashboard,
    .wp-heatmap-heatmap-view,
    .wp-heatmap-analytics-view {
        padding: 10px 0;
    }
    
    .dashboard-widget,
    .chart-container,
    .heatmap-controls,
    .analytics-controls,
    .api-key-creation,
    .api-keys-list,
    .export-controls {
        padding: 15px;
    }
    
    .dashboard-widget .widget-number {
        font-size: 24px;
    }
}

/* =============================================================================
   Dark Mode Support
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    .wp-heatmap-dashboard,
    .wp-heatmap-heatmap-view,
    .wp-heatmap-analytics-view {
        color-scheme: dark;
    }
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .nav-tab-wrapper,
    .button,
    .loading-overlay {
        display: none !important;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
}

/* =============================================================================
   High Contrast Mode Support
   ============================================================================= */

@media (prefers-contrast: high) {
    .dashboard-widget,
    .chart-container,
    .heatmap-controls,
    .analytics-controls {
        border: 2px solid;
    }
    
    .heatmap-point {
        border: 2px solid #000;
    }
}

/* =============================================================================
   Reduced Motion Support
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    .heatmap-point,
    .spinner,
    .dashboard-widget {
        animation: none !important;
        transition: none !important;
    }
}

/* =============================================================================
   Enhanced Table Responsive Design
   ============================================================================= */

@media (max-width: 1200px) {
    .column-location {
        display: none;
    }
    
    .column-page {
        width: 40%;
    }
    
    .column-device {
        width: 20%;
    }
}

@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search {
        max-width: none;
        margin-bottom: 8px;
    }
    
    .heatmap-activity-table,
    .heatmap-api-keys-table {
        font-size: 14px;
    }
    
    .heatmap-activity-table th,
    .heatmap-api-keys-table th,
    .heatmap-activity-table td,
    .heatmap-api-keys-table td {
        padding: 8px 12px;
    }
    
    .page-info .page-url {
        display: none;
    }
    
    .device-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .view-count-badge {
        padding: 6px 8px;
    }
    
    .view-count-badge .count {
        font-size: 14px;
    }
    
    .table-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .column-created,
    .column-lastused,
    .column-expires {
        display: none;
    }
    
    .column-name {
        width: 35%;
    }
    
    .column-scopes {
        width: 25%;
    }
    
    .column-status {
        width: 20%;
    }
    
    .column-actions {
        width: 20%;
    }
    
    .heatmap-empty-state {
        padding: 40px 20px;
    }
    
    .heatmap-empty-state .dashicons {
        font-size: 36px;
    }
}
