/* Help Metric Article Helpful Feedback - Dashboard Styles */

.help-metric-article-helpful-feedback-dashboard,
.help-metric-article-helpful-feedback-statistics,
.help-metric-article-helpful-feedback-list {
    max-width: 1400px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

a.dashboard-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

a.dashboard-card:hover {
    border-color: #2271b1;
}

.card-view-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #2271b1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

a.dashboard-card:hover .card-view-link {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.card-icon.positive {
    background: #dcfce7;
    color: #16a249;
}

.card-icon.negative {
    background: #fee2e2;
    color: #dc2626;
}

.card-icon.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

/* Scale SVGs inside card icons to fill the container */
.card-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    fill: currentColor;
}

/* SVG icon inside feedback type badges in tables */
.hmahf-feedback-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.hmahf-feedback-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.feedback-positive .hmahf-feedback-icon svg,
span.feedback-positive .hmahf-feedback-icon svg {
    color: #16a249;
}

.feedback-negative .hmahf-feedback-icon svg,
span.feedback-negative .hmahf-feedback-icon svg {
    color: #dc2626;
}

.card-content h3 {
    margin: 0 0 4px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.card-content p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Charts Section */
.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin: 40px 0;
}

.chart-container {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.chart-container h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.chart-container canvas {
    max-height: 300px;
}

/* Dashboard Section */
.dashboard-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    margin: 40px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.dashboard-section h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

/* Filters */
.hmahf-post-filter-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #166534;
}

.hmahf-post-filter-notice .hmahf-clear-filter {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.hmahf-post-filter-notice .hmahf-clear-filter:hover {
    text-decoration: underline;
}

.statistics-filters,
.feedback-filters {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tables */
.feedback-table,
.statistics-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feedback-table th,
.statistics-table th,
.feedback-table td,
.statistics-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.feedback-table th,
.statistics-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-table tbody tr:hover,
.statistics-table tbody tr:hover {
    background: #f9fafb;
}

/* Status indicators */
.feedback-positive {
    color: #16a249;
    font-weight: 600;
}

.feedback-negative {
    color: #dc2626;
    font-weight: 600;
}

.feedback-ratio {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ratio-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ratio-indicator.high {
    background: #16a249;
}

.ratio-indicator.medium {
    background: #f59e0b;
}

.ratio-indicator.low {
    background: #dc2626;
}

.ratio-indicator.none {
    background: #9ca3af;
}

/* Action buttons */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-action {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.table-action.view {
    background: #3b82f6;
    color: #fff;
}

.table-action.view:hover {
    background: #2563eb;
}

.table-action.edit {
    background: #f59e0b;
    color: #fff;
}

.table-action.edit:hover {
    background: #d97706;
}

.table-action.delete {
    background: #dc2626;
    color: #fff;
}

.table-action.delete:hover {
    background: #b91c1c;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-spinner {
    display: inline-block;
    font-size: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Comments display */
.feedback-comment {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

.feedback-comment.truncated {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.feedback-comment.truncated::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: #fff;
    padding-left: 20px;
}

.expand-comment {
    color: #3b82f6;
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
}

.expand-comment:hover {
    text-decoration: underline;
}

/* Export button */
.export-section {
    margin: 20px 0;
    text-align: right;
}

.export-btn {
    background: #16a249;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.export-btn:hover {
    background: #15803d;
}


/* Admin page header */
.help-metric-article-helpful-feedback-dashboard h1,
.help-metric-article-helpful-feedback-statistics h1,
.help-metric-article-helpful-feedback-list h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

/* Dashboard specific styles */
.help-metric-article-helpful-feedback-dashboard .wrap {
    background: #f8fafc;
    margin: 0 0 0 -20px;
    padding: 20px;
    min-height: calc(100vh - 32px);
}

/* Quick stats summary */
.dashboard-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
}

.dashboard-summary h2 {
    color: white;
    margin: 0 0 10px 0;
}

.dashboard-summary p {
    opacity: 0.9;
    margin: 0;
    font-size: 16px;
}

/* Data tables styling improvements */
.feedback-table thead th,
.statistics-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f9fafb;
}

/* Post title links */
.post-link {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.post-link:hover {
    text-decoration: underline;
    color: #1e40af;
}

/* IP address styling */
.ip-address {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Empty state improvements */
.no-data {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.no-data-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
    display: block;
}

.no-data h3 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 20px;
    font-weight: 600;
}

.no-data p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Success/Error messages */
.dashboard-message {
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-message::before {
    font-size: 18px;
}

.dashboard-message.success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.dashboard-message.success::before {
    content: '✅';
}

.dashboard-message.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.dashboard-message.error::before {
    content: '❌';
}

.dashboard-message.info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.dashboard-message.info::before {
    content: 'ℹ️';
}

/* Button improvements */
.button-primary {
    background: #16a249 !important;
    border-color: #16a249 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

.button-primary:hover {
    background: #15803d !important;
    border-color: #15803d !important;
}

.button-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    color: #fff !important;
    text-shadow: none !important;
}

.button-secondary:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
}

/* Responsive design */
@media (max-width: 1200px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .statistics-filters,
    .feedback-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .feedback-table,
    .statistics-table {
        font-size: 14px;
    }
    
    .feedback-table th,
    .statistics-table th,
    .feedback-table td,
    .statistics-table td {
        padding: 8px 12px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .table-action {
        text-align: center;
        width: 60px;
    }
}

@media (max-width: 480px) {
    .help-metric-article-helpful-feedback-dashboard .wrap,
    .help-metric-article-helpful-feedback-statistics .wrap,
    .help-metric-article-helpful-feedback-list .wrap {
        margin-left: -10px;
        padding: 10px;
    }
    
    .dashboard-card {
        padding: 16px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .card-content h3 {
        font-size: 24px;
    }
    
    .dashboard-charts {
        gap: 16px;
        margin: 24px 0;
    }
    
    .chart-container {
        padding: 16px 12px;
    }
}

/* -------------------------------------------------------------------------
   CSS-based Charts
   ------------------------------------------------------------------------- */

.hmahf-chart-wrap {
    min-height: 200px;
}

/* Bar chart */
.hmahf-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 180px;
    padding-bottom: 24px;
    position: relative;
    border-bottom: 2px solid #e5e7eb;
    border-left: 2px solid #e5e7eb;
    margin: 10px 0 4px 0;
}

.hmahf-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    min-width: 0;
    position: relative;
    height: 100%;
}

.hmahf-bars {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    width: 100%;
    height: calc(100% - 20px);
}

.hmahf-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: opacity 0.2s ease;
    cursor: default;
}

.hmahf-bar:hover {
    opacity: 0.8;
}

.hmahf-bar.positive {
    background: #16a249;
}

.hmahf-bar.negative {
    background: #dc2626;
}

.hmahf-bar-label {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    overflow: hidden;
}

/* Chart legend */
.hmahf-chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 28px;
    padding-top: 8px;
    justify-content: center;
}

.hmahf-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.hmahf-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Donut chart */
.hmahf-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
}

.hmahf-donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hmahf-donut-inner {
    width: 90px;
    height: 90px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
}

.hmahf-donut-value {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.hmahf-donut-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.hmahf-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

/* Block editor preview styles */
.hmahf-block-editor-preview {
    background: #f0fdf4;
    border: 2px dashed #16a249;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #166534;
}

.hmahf-block-editor-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.hmahf-block-editor-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hmahf-block-editor-desc {
    font-size: 13px;
    opacity: 0.7;
}

/* Print styles */
@media print {
    .statistics-filters,
    .feedback-filters,
    .pagination,
    .table-actions {
        display: none;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 20px;
}

.sortable-header:hover {
    background: #e5e7eb;
}

.sortable-header::after {
    content: '↕️';
    position: absolute;
    right: 5px;
    font-size: 12px;
    opacity: 0.5;
}

.sortable-header.asc::after {
    content: '↑';
    opacity: 1;
}

.sortable-header.desc::after {
    content: '↓';
    opacity: 1;
}