/**
 * Analytics Sections CSS
 * Shared styles for both GSC (Search Performance) and GA4 (Google Analytics) sections
 * Created: November 2025
 */

/* ================================
   GA4 SECTION - ORANGE THEME
   Google Analytics section uses orange to match the GA button
   ================================ */

/* GA4 Tab Styling - Orange Theme */
#google-analytics-section .perf-tab.active {
    color: #ff6b35 !important;
    border-bottom-color: #ff6b35 !important;
}

#google-analytics-section .perf-tab:hover {
    color: #ff6b35 !important;
    background: #fff5f2 !important;
}

/* GA4 Sorted Column Headers - Orange Theme */
#google-analytics-section .dimension-table th.sorted-asc,
#google-analytics-section .dimension-table th.sorted-desc {
    background: #fff5f2 !important;
    color: #ff6b35 !important;
}

#google-analytics-section .dimension-table th.sorted-asc:hover,
#google-analytics-section .dimension-table th.sorted-desc:hover {
    background: #fff5f2 !important;
    color: #ff6b35 !important;
}

/* ================================
   SHARED STYLES
   ================================ */

/* Analytics Section Container */
.analytics-section {
    margin-top: 30px;
}

/* Analytics Metrics Grid (6 cards for GA4, 4 cards for GSC) */
.analytics-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* GA4 Metric Cards - Lighter colors matching table values with vibrant gradients */
.analytics-metric-card.users {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%); /* Light Blue - matches Users column */
}

.analytics-metric-card.new-users {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); /* Light Orange - matches New Users column */
}

.analytics-metric-card.sessions {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); /* Light Purple - matches Sessions column */
}

.analytics-metric-card.pageviews {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%); /* Light Green - matches Pageviews column */
}

.analytics-metric-card.bounce {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); /* Light Amber - matches Bounce Rate column */
}

.analytics-metric-card.duration {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%); /* Light Pink - matches Avg Duration column */
}

.analytics-metric-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.analytics-metric-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-metric-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

/* Note: Timeline Charts use .performance-timeline-grid from styles.css for consistency with GSC charts */

/* Dimension Tables */
.analytics-tabs-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 0 25px;
}

.analytics-tab {
    padding: 10px 20px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.analytics-tab:hover {
    background: #e5e7eb;
    color: #374151;
}

.analytics-tab.active {
    background: #3b82f6;
    color: white;
}

.analytics-tab-content {
    display: none;
}

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

/* Comparison Feature */
.analytics-comparison-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px 25px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 20px;
}

.analytics-comparison-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.analytics-domain-selector {
    flex: 1;
    max-width: 400px;
}

.analytics-domain-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.analytics-compare-btn {
    padding: 8px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.analytics-compare-btn:hover {
    background: #2563eb;
}

.analytics-compare-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .analytics-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .analytics-metric-card {
        padding: 15px;
    }
    
    .analytics-metric-value {
        font-size: 24px;
    }
    
    .analytics-tabs-nav {
        gap: 6px;
        padding: 0 15px;
    }
    
    .analytics-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .analytics-comparison-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .analytics-domain-selector {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .analytics-metrics-grid {
        grid-template-columns: 1fr;
    }
}
