/**
 * GreenMetrics Reports Styles
 */

/* Report Filters */
.greenmetrics-report-filters {
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
    width: 100%;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 32.46%;
    margin: 0;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 500;
}

.custom-date-range {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
    width: 100%;
}

.custom-date-range .date-range-field {
    flex: 1;
}

.custom-date-range input[type="date"] {
    width: 100%;
}
.greenmetrics-report-filters .button#apply-filters {
    margin-bottom: 10px;
}
/* Report Chart */
.greenmetrics-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.report-actions {
    display: flex;
    gap: 10px;
}

.greenmetrics-report-chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

.chart-loading, .summary-loading, .trend-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.chart-loading p, .summary-loading p, .trend-loading p {
    margin-top: 10px;
    font-weight: 500;
}

/* Performance Summary */
.greenmetrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.summary-card {
    background-color: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #23282d;
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1e1e1e;
}

.summary-note {
    font-size: 12px;
    color: #767676;
    margin-bottom: 10px;
}

.summary-change {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-top: 10px;
    font-weight: 500;
}

.summary-change .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

.summary-change.positive {
    color: #46b450;
}

.summary-change.negative {
    color: #dc3232;
}

.summary-change.neutral {
    color: #767676;
}

/* Page Performance Tables */
.greenmetrics-tabs {
    margin-top: 15px;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 15px;
}

.tab-button {
    padding: 8px 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    margin-bottom: -1px;
}

.tab-button:hover {
    color: #0073aa;
}

.tab-button.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.page-performance-table-container {
    overflow-x: auto;
}

.greenmetrics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.greenmetrics-table th,
.greenmetrics-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e4e7;
}

.greenmetrics-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.greenmetrics-table tr:hover {
    background-color: #f3f4f5;
}

.loading-cell {
    text-align: center;
    padding: 30px !important;
}

.loading-cell .spinner {
    float: none;
    margin: 0 auto;
}

.loading-cell p {
    margin-top: 10px;
}

.no-data {
    text-align: center;
    padding: 30px !important;
    color: #777;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 14px;
}

/* Performance Score Styles */
.performance-score {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    min-width: 40px;
}

.performance-score.excellent {
    background-color: #4CAF50;
    color: white;
}

.performance-score.good {
    background-color: #8BC34A;
    color: white;
}

.performance-score.average {
    background-color: #FFC107;
    color: #333;
}

.performance-score.poor {
    background-color: #FF9800;
    color: white;
}

.performance-score.critical {
    background-color: #F44336;
    color: white;
}

/* Chart Legend Styles */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.chart-legend li {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 5px;
}

/* Trend Analysis */
.greenmetrics-trend-analysis {
    position: relative;
    min-height: 200px;
}

.trend-card {
    background-color: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trend-card {
    position: relative;
    border-left: 4px solid #ccc;
}

.trend-card.trend-positive {
    border-left-color: #46b450;
}

.trend-card.trend-negative {
    border-left-color: #dc3232;
}

.trend-card.trend-neutral {
    border-left-color: #767676;
}

.trend-card.trend-info {
    border-left-color: #00a0d2;
}

.trend-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #23282d;
}

.trend-description {
    margin-bottom: 15px;
    line-height: 1.5;
}

.trend-custom-content {
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.trend-pages-list {
    margin: 10px 0;
    padding-left: 20px;
}

.trend-pages-list li {
    margin-bottom: 8px;
}

.trend-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.trend-metric {
    flex: 1;
    min-width: 150px;
}

.trend-metric-label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.trend-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}

/* Modal */
.greenmetrics-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.greenmetrics-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    max-width: 500px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.greenmetrics-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.greenmetrics-modal-close:hover,
.greenmetrics-modal-close:focus {
    color: black;
    text-decoration: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .custom-date-range {
        flex-direction: column;
        width: 100%;
    }

    .custom-date-range .date-range-field {
        width: 100%;
    }

    .greenmetrics-modal-content {
        width: 90%;
        margin: 20% auto;
    }
}
