/**
 * Proxy History Chart Styles
 */

.history-chart-container {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.chart-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.proxy-info {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
    padding: 6px 12px;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 6px;
}

/* Stats Cards */
.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

/* Chart Area */
.chart-area {
    background: var(--bg-secondary, #f9fafb);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

#history-svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #6b7280);
    font-size: 1rem;
}

/* Mini Chart (for proxy cards) */
.mini-chart {
    display: block;
    opacity: 0.8;
}

.mini-chart-no-data {
    font-size: 0.75rem;
    color: var(--text-tertiary, #9ca3af);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .history-chart-container {
        padding: 16px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .chart-area {
        padding: 15px;
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }

    .chart-legend {
        gap: 15px;
        font-size: 0.85rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .history-chart-container {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .chart-header h3 {
        color: #f9fafb;
    }

    .proxy-info {
        background: #374151;
        color: #d1d5db;
    }

    .chart-area {
        background: #111827;
    }

    .no-data {
        color: #9ca3af;
    }

    #history-svg text {
        fill: #d1d5db !important;
    }

    #history-svg line {
        stroke: #374151 !important;
    }
}

/* Accessibility */
.history-chart-container:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-chart-container {
    animation: fadeIn 0.3s ease-out;
}
