/* Dashboard styles with improved modern design */
.dashboard-container {
    padding: 20px;
    background-color: #f5f7fa;
    border-radius: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard header with key insights */
.dashboard-header-card {
    background-color: #3694d1;
    background-image: linear-gradient(135deg, #3694d1 0%, #2a6a9e 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-header-title h2 {
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.dashboard-subtitle {
    margin: 5px 0 0;
    opacity: 0.85;
    font-size: 1rem;
}

.dashboard-key-metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.key-metric {
    text-align: center;
}

.key-metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
}

.key-metric-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Dashboard card rows */
.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 20px;
}

.dashboard-card {
    flex: 1 1 calc(50% - 20px);
    min-width: 300px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-tools {
    display: flex;
    gap: 10px;
}

.view-toggle, .refresh-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.view-toggle:hover, .refresh-btn:hover {
    background-color: #f0f0f0;
    color: #3694d1;
}

.view-toggle.active {
    background-color: #3694d1;
    color: white;
}

.date-range-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

/* Charts */
#time-series-chart,
#category-chart,
#top-countries-chart,
#interconnection-chart {
    height: 260px;
    width: 100%;
    position: relative;
    padding: 10px 20px 20px 10px;
}

/* Summary stats grid */
.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 15px;
    padding: 20px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.stat-box:hover {
    background-color: #f0f7ff;
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: #e6f2ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    color: #3694d1;
    font-size: 1.2rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Trends section */
#trends-content {
    padding: 20px;
}

#trend-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.trend-indicator {
    flex: 1 1 calc(33.333% - 15px);
    min-width: 150px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trend-title {
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-value {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-up {
    color: #28a745;
}

.trend-down {
    color: #dc3545;
}

.trend-neutral {
    color: #6c757d;
}

/* Recent articles list */
#recent-articles-list {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.article-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.article-item:hover {
    background-color: #f8f9fa;
}

.article-item:last-child {
    border-bottom: none;
}

.article-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    font-size: 0.8rem;
    color: #666;
    gap: 10px;
}

/* Tooltips */
.chart-tooltip {
    position: absolute;
    background: rgba(255,255,255,0.98);
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 999;
    font-size: 0.9rem;
    max-width: 250px;
}

.chart-tooltip-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #3694d1;
}

.chart-tooltip-value {
    font-weight: 500;
}

/* Interconnection chart specific styles */
#interconnection-chart {
    overflow: visible;
}

#interconnection-chart .link {
    stroke-linecap: round;
    transition: stroke-opacity 0.3s ease;
}

#interconnection-chart .node circle {
    transition: opacity 0.3s ease, r 0.2s ease;
}

#interconnection-chart .node text {
    transition: opacity 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .dashboard-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-key-metrics {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .dashboard-card {
        flex: 1 1 100%;
    }
    
    .summary-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .trend-indicator {
        flex: 1 1 100%;
    }
    
    .key-metric {
        flex: 1 1 calc(50% - 12px);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .date-range-indicator {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 10px;
    }
    
    .dashboard-header-card {
        padding: 15px;
    }
    
    .dashboard-header-title h2 {
        font-size: 1.5rem;
    }
    
    .key-metric {
        flex: 1 1 100%;
    }
}
