/* ═══════════════════════════════════════════════════════════════════
   GA4 Analytics Widget – styles for WitnessInTheCorridors footer
   Matches existing footer palette: beige/cream tones, serif editorial
   ═══════════════════════════════════════════════════════════════════ */

/* ── Root widget container ─────────────────────────────────────────── */
.ga4-widget {
    display: inline-block;
    width: 100%;
    max-width: 320px;          /* widened to fit "30 Days User" on one line */
    background: #f5ecd6;       /* warm cream – same as footer card bg */
    border: 1px solid #c9b48a; /* subtle golden border matching footer palette */
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(80, 55, 20, 0.10);
    padding: 10px 12px 8px;
    font-family: Georgia, 'Times New Roman', serif; /* editorial serif */
    color: #3d2b0e;            /* dark walnut text */
    box-sizing: border-box;
    line-height: 1.3;
}

/* ── Header row ─────────────────────────────────────────────────────── */
.ga4-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    border-bottom: 1px solid #d4bc8f;
    padding-bottom: 6px;
}

.ga4-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b4a1e;
}

/* Pulsing green dot – "live" indicator */
.ga4-pulse-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
    animation: ga4-pulse 2s ease-in-out infinite;
}

@keyframes ga4-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.5; transform: scale(1.25); }
}

/* ── Stats row ──────────────────────────────────────────────────────── */
.ga4-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 7px;
}

.ga4-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.ga4-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8c6b35;
    margin-bottom: 1px;
    white-space: nowrap;
}

.ga4-stat-value {
    font-size: 13px;
    font-weight: bold;
    color: #2c1d06;
    white-space: nowrap;
}

.ga4-divider {
    width: 1px;
    height: 28px;
    background: #c9b48a;
    flex-shrink: 0;
}

/* ── Trend colours ──────────────────────────────────────────────────── */
.ga4-trend-up   { color: #2e7d32; font-size: 12px; }
.ga4-trend-down { color: #c62828; font-size: 12px; }
.ga4-trend-flat { color: #6b4a1e; font-size: 12px; }

/* ── Countries row ──────────────────────────────────────────────────── */
.ga4-countries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 4px;
    margin-bottom: 20px;
    padding-top: 5px;
    border-top: 1px solid #d4bc8f;
}

.ga4-country-item {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #ede0c0;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 9px;
    color: #3d2b0e;
    white-space: nowrap;
    overflow: hidden;
    cursor: default;
    min-width: 0;
}

.ga4-flag {
    font-size: 12px;
    line-height: 1;
}

.ga4-country-users {
    font-size: 10px;
    color: #5a3e18;
}

/* ── Footer note (last updated) ─────────────────────────────────────── */
.ga4-footer-note {
    font-size: 9px;
    color: #2e7d32;
    text-align: right;
    font-style: italic;
    margin-top: 2px;
}

/* ── Mobile responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ga4-widget {
        max-width: 100%;        /* full width on mobile footer */
        margin-top: 10px;
    }
}

/* ── Dark-mode safety (if site ever adds dark theme) ────────────────── */
@media (prefers-color-scheme: dark) {
    .ga4-widget {
        background: #2a1f0e;
        border-color: #5a4220;
        color: #e8d5b0;
    }
    .ga4-header,
    .ga4-countries {
        border-color: #5a4220;
    }
    .ga4-country-item {
        background: #3a2910;
    }
    .ga4-stat-value {
        color: #f0ddb8;
    }
}
.ga4-flag-img {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}
.ga4-widget {
    position: relative;
}

/* Brand inside black marked area */
.ga4-brand {
    position: absolute;
    left: 14px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ga4-brand-icon {
    width: 18px;
    height: 18px;
}

.ga4-brand-text {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}