/* GA4 Analytics Widget Styles */
.ga4-widget {
    position: fixed;
    bottom: 25px;
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ga4-widget.open {
    transform: translateX(0);
}

.ga4-widget-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ga4-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.ga4-widget-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.ga4-widget-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ga4-widget-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.ga4-widget-tabs {
    display: flex;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 16px;
    gap: 4px;
}

.ga4-tab-button {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.ga4-tab-button:hover {
    background-color: #f8f9fa;
    color: #333;
}

.ga4-tab-button.active {
    background-color: #667eea;
    color: white;
}

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

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

.ga4-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.ga4-metric-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.ga4-metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.ga4-metric-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ga4-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.ga4-list-label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.ga4-list-value {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.ga4-chart-container {
    height: 120px;
    margin-bottom: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.ga4-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.ga4-loading i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

.ga4-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 16px;
}

.ga4-refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: 12px;
}

.ga4-refresh-btn:hover {
    background: #5a6fd8;
}

.ga4-refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ga4-realtime-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .ga4-widget {
        width: 280px;
        top: 10px;
        right: 10px;
    }
    
    .ga4-metric-grid {
        grid-template-columns: 1fr;
    }
}

/* Status indicators */
.ga4-status-good { color: #48bb78; }
.ga4-status-warning { color: #ed8936; }
.ga4-status-danger { color: #f56565; }

/* Mini progress bar for trends */
.ga4-trend-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.ga4-trend-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
}