/**
 * Analytics Tab Styles
 *
 * Styles for the Performance Analytics Dashboard tab
 *
 * @package    Instant_Popup_Builder
 * @subpackage Instant_Popup_Builder/admin/css
 */

/* Analytics Dashboard Styles */
.analytics-dashboard {
    padding: 0;
}

.analytics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 12px;
    margin: 0 30px 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.header-content h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.date-range-display {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 24px;
    margin: 0 30px 30px;
    text-align: center;
    font-size: 14px;
}

.date-range-label {
    color: #64748b;
    font-weight: 500;
    margin-right: 8px;
}

.date-range-value {
    color: #1e293b;
    font-weight: 600;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 0 30px;
}

.metric-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #2271b1;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2271b1, #1e5a8a);
    flex-shrink: 0;
}

.metric-icon .dashicons {
    font-size: 24px;
    color: #fff;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #23282d;
    line-height: 1;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.metric-change.positive {
    color: #46b450;
}

.metric-change.negative {
    color: #dc3232;
}

.metric-change .dashicons {
    font-size: 14px;
}

/* Charts Section */
.charts-section {
    margin-bottom: 40px;
    padding: 0 30px;
}

.chart-container {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.chart-header h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header .dashicons {
    color: #2271b1;
}

.chart-header p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.chart-content {
    position: relative;
    height: 300px;
}

/* Performance Section */
.performance-section {
    padding: 0 30px;
    margin-bottom: 40px;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.performance-table {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
}

.table-header h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-header .dashicons {
    color: #2271b1;
}

.table-header p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.table-content {
    padding: 0;
}

.table-content table {
    margin: 0;
}

.table-content th,
.table-content td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.table-content th {
    background: #fafafa;
    font-weight: 600;
    color: #23282d;
    font-size: 13px;
}

.popup-id,
.campaign-date {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.subscriber-count,
.sent-count {
    font-weight: 600;
    color: #2271b1;
}

.performance-bar,
.rate-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.performance-fill,
.rate-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #46b450);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0;
}

.rate-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rate-value {
    font-weight: 600;
    font-size: 13px;
}

.rate-value.good {
    color: #46b450;
}

.rate-value.average {
    color: #ffb900;
}

.rate-value.poor {
    color: #dc3232;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-data .dashicons {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.no-data p {
    margin: 0;
    font-size: 14px;
}

.chart-error-message {
    padding: 40px;
    text-align: center;
    color: #666;
}

/* Export Section */
.export-section {
    padding: 0 30px;
    margin-bottom: 30px;
}

.export-container {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.export-container h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-container .dashicons {
    color: #2271b1;
}

.export-container p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.export-buttons {
    display: flex;
    gap: 15px;
}

.export-buttons .button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .analytics-header {
        margin: 0 20px 20px;
        padding: 25px 30px;
    }

    .date-range-display {
        margin: 0 20px 20px;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .analytics-header {
        padding: 20px 16px;
        margin: 0 16px 20px;
    }

    .header-content h3 {
        font-size: 20px;
    }

    .header-content p {
        font-size: 13px;
    }

    .date-range-display {
        margin: 0 16px 20px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 15px;
    }

    .metric-card {
        padding: 20px;
    }

    .metric-icon {
        width: 50px;
        height: 50px;
    }

    .metric-value {
        font-size: 28px;
    }

    .charts-section,
    .performance-section,
    .export-section {
        padding: 0 15px;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons .button {
        justify-content: center;
        padding: 12px 20px;
    }
}

