/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Container principal */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, #003366 0%, #0066a1 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #0099cc;
    color: white;
}

.btn-primary:hover {
    background-color: #007aa3;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #ff9900;
    color: white;
}

.btn-secondary:hover {
    background-color: #e68900;
    transform: translateY(-2px);
}

/* Métricas principales */
.main-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-card:nth-child(1) .metric-icon {
    background: linear-gradient(135deg, #0099cc, #33bbee);
}

.metric-card:nth-child(2) .metric-icon {
    background: linear-gradient(135deg, #33bbee, #66ccdd);
}

.metric-card:nth-child(3) .metric-icon {
    background: linear-gradient(135deg, #66ccdd, #99ddee);
}

.metric-card:nth-child(4) .metric-icon {
    background: linear-gradient(135deg, #ff9900, #ffaa33);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.metric-description {
    font-size: 0.875rem;
    color: #666;
}

/* Navegación por pestañas */
.dashboard-tabs {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    color: #0099cc;
    background-color: #f8fafc;
}

.tab-button.active {
    color: #0099cc;
    border-bottom-color: #0099cc;
}

/* Contenido principal */
.dashboard-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

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

/* Grid de contenido */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-container h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.5rem;
}

.chart-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.stat-section h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 1rem;
}

/* Estadísticas de dispositivos */
.device-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.device-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.device-item i {
    width: 20px;
    color: #0099cc;
}

.device-name {
    flex: 1;
    font-weight: 500;
}

.device-percentage {
    font-weight: 700;
    color: #003366;
}

/* Estadísticas geográficas */
.geo-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.geo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.geo-name {
    width: 80px;
    font-weight: 500;
    font-size: 0.9rem;
}

.geo-bar {
    flex: 1;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.geo-fill {
    height: 100%;
    background: linear-gradient(90deg, #0099cc, #33bbee);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.geo-percentage {
    width: 50px;
    text-align: right;
    font-weight: 700;
    color: #003366;
    font-size: 0.9rem;
}

/* Ranking de medios */
.content-header {
    margin-bottom: 1.5rem;
}

.content-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.5rem;
}

.content-header p {
    color: #666;
}

.media-ranking {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

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

.ranking-item:hover {
    background-color: #f8fafc;
}

.ranking-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0099cc, #33bbee);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 1rem;
}

.media-info {
    flex: 1;
}

.media-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.25rem;
}

.media-users {
    color: #666;
    font-size: 0.9rem;
}

.media-quality {
    text-align: center;
    margin: 0 1rem;
}

.quality-score {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0099cc;
}

.quality-label {
    font-size: 0.8rem;
    color: #666;
}

.media-sessions {
    text-align: right;
    font-weight: 600;
    color: #003366;
    min-width: 100px;
}

/* Sección de calidad */
.quality-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.quality-section,
.fraud-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.quality-section h3,
.fraud-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 0.5rem;
}

.quality-section p,
.fraud-section p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Análisis de tráfico */
.traffic-analysis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.traffic-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.traffic-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    font-weight: 500;
}

.traffic-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.traffic-indicator.human {
    background-color: #0099cc;
}

.traffic-indicator.bot {
    background-color: #ff9900;
}

.traffic-bar {
    flex: 1;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.traffic-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.traffic-fill.human {
    background: linear-gradient(90deg, #0099cc, #33bbee);
}

.traffic-fill.bot {
    background: linear-gradient(90deg, #ff9900, #ffaa33);
}

.traffic-percentage {
    font-weight: 700;
    color: #003366;
    min-width: 50px;
    text-align: right;
}

/* Estadísticas de fraude */
.fraud-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fraud-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
}

.fraud-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff9900, #ffaa33);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.fraud-content {
    flex: 1;
}

.fraud-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #003366;
}

.fraud-label {
    font-size: 0.9rem;
    color: #666;
}

/* Sección de campañas */
.campaigns-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.campaigns-details {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.campaigns-details h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 1rem;
}

.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campaign-item {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.campaign-item:hover {
    border-color: #0099cc;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.campaign-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #003366;
}

.roi-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.roi-badge.positive {
    background-color: #d4edda;
    color: #155724;
}

.campaign-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #003366;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .quality-grid,
    .campaigns-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .main-metrics {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .dashboard-tabs {
        padding: 0 1rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .media-quality,
    .media-sessions {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .geo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .geo-bar {
        width: 100%;
    }
    
    .traffic-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .traffic-bar {
        width: 100%;
    }
}

