/* T-ARE Analytics Dashboard Styles */

.analytics-dashboard {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.analytics-summary h3 {
    color: var(--primary-black);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 3px solid var(--primary-gold);
    padding-bottom: 10px;
}

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

.metric {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--primary-gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

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

.metric label {
    display: block;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-black);
    line-height: 1;
}

.engagement-high {
    color: #28a745 !important;
}

.engagement-medium {
    color: #ffc107 !important;
}

.engagement-low {
    color: #dc3545 !important;
}

/* Performance indicators */
.performance-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
}

.performance-good {
    background-color: #28a745;
}

.performance-needs-improvement {
    background-color: #ffc107;
}

.performance-poor {
    background-color: #dc3545;
}

/* Analytics charts container */
.analytics-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 15px;
    text-align: center;
}

/* Real-time updates indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    color: #28a745;
    font-size: 0.9rem;
    margin-left: 10px;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Event timeline */
.event-timeline {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.event-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
}

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

.event-timestamp {
    color: var(--text-light);
    font-weight: 500;
}

.event-description {
    color: var(--primary-black);
    margin-left: 10px;
}

/* Conversion funnel visualization */
.conversion-funnel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.funnel-step {
    background: linear-gradient(90deg, var(--primary-gold), #F4E4BC);
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.funnel-step::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid var(--primary-gold);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.funnel-step:last-child::after {
    display: none;
}

.funnel-step-name {
    font-weight: 600;
    color: var(--primary-black);
}

.funnel-step-count {
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--primary-black);
    font-size: 0.9rem;
}

/* Device breakdown */
.device-breakdown {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.device-stat {
    padding: 10px;
}

.device-icon {
    font-size: 2rem;
    color: var(--primary-gold);
    margin-bottom: 8px;
}

.device-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
}

.device-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Performance metrics */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.performance-metric {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.performance-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.performance-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Debug panel */
.debug-panel {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
}

.debug-panel .debug-timestamp {
    color: #68d391;
}

.debug-panel .debug-event {
    color: #63b3ed;
}

.debug-panel .debug-error {
    color: #f56565;
}

/* Responsive design */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .metric {
        padding: 15px;
    }
    
    .metric value {
        font-size: 1.5rem;
    }
    
    .analytics-charts {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .device-breakdown {
        flex-direction: column;
        gap: 15px;
    }
    
    .performance-metrics {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
}

/* Print styles */
@media print {
    .analytics-dashboard {
        background: white;
        box-shadow: none;
    }
    
    .live-indicator::before {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .analytics-dashboard {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .metric {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .chart-container {
        background: #4a5568;
        color: #e2e8f0;
    }
}