/**
 * @package     Joomla.Site
 * @subpackage  mod_artificial_traffic
 *
 * @copyright   Copyright (C) 2024 Your Name. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */

.mod-artificial-traffic {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

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

.campaign-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #3498db;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.external-link-btn:hover {
    background: #2980b9;
    color: #ffffff;
    text-decoration: none;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    transition: transform 0.2s ease;
}

.metric-item:hover {
    transform: translateY(-2px);
}

.metric-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.chart-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.chart-title,
.demographics-title {
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.demographics-container {
    margin-top: 20px;
}

.demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.demographic-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.demographic-section h5 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #34495e;
}

.demographic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demographic-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.85rem;
}

.demographic-label {
    min-width: 60px;
    color: #2c3e50;
    font-weight: 500;
}

.demographic-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 1s ease;
}

.demographic-value {
    min-width: 40px;
    text-align: right;
    font-weight: 500;
    color: #2c3e50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .traffic-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .demographics-grid {
        grid-template-columns: 1fr;
    }
    
    .demographic-list li {
        flex-wrap: wrap;
    }
    
    .demographic-label {
        min-width: 50px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mod-artificial-traffic {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .campaign-title,
    .metric-value,
    .chart-title,
    .demographics-title,
    .demographic-label,
    .demographic-value {
        color: #ecf0f1;
    }
    
    .metric-item,
    .chart-container,
    .demographic-section {
        background: #3d3d3d;
    }
    
    .metric-label {
        color: #b0b0b0;
    }
    
    .demographic-bar {
        background: #4d4d4d;
    }
    
    .bar-fill {
        background: linear-gradient(90deg, #5dade2, #58d68d);
    }
}