/* ==============================================
   BP Google Analytics - Frontend Styles
   ============================================== */

/* --- Card Layout (Shortcode) --- */
.bp-ga-visitors-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin: 20px 0;
}

.bp-ga-visitors-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.bp-ga-visitors-title-icon {
    font-size: 22px;
}

.bp-ga-visitors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bp-ga-visitors-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.bp-ga-visitors-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.bp-ga-visitors-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.bp-ga-visitors-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bp-ga-visitors-label {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bp-ga-visitors-count {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.bp-ga-visitors-unit {
    font-size: 11px;
    opacity: 0.7;
}

/* --- Widget Layout (Sidebar) --- */
.widget .bp-ga-visitors-widget {
    padding: 0;
}

.bp-ga-visitors-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
    gap: 6px;
}

.bp-ga-visitors-row:last-child {
    border-bottom: none;
}

.bp-ga-visitors-row-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.bp-ga-visitors-row-label {
    color: #555;
    min-width: 70px;
}

.bp-ga-visitors-row-sep {
    color: #999;
}

.bp-ga-visitors-row-count {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

.bp-ga-visitors-row-unit {
    color: #888;
    font-size: 13px;
}

/* --- Inline / Minimal Style --- */
.bp-ga-inline {
    display: inline;
    font-size: inherit;
    color: inherit;
}

.bp-ga-minimal {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
}

.bp-ga-minimal-title {
    color: #333;
    margin-right: 8px;
}

/* --- Realtime Card (Shortcode) --- */
.bp-ga-realtime-card {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.35);
    margin: 20px 0;
}

.bp-ga-realtime-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.4px;
}

.bp-ga-realtime-badge {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-left: auto;
}

.bp-ga-realtime-card-body {
    text-align: center;
    padding: 12px 0 16px;
}

.bp-ga-realtime-card-count {
    font-size: 60px;
    font-weight: 800;
    line-height: 1;
}

.bp-ga-realtime-card-unit {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 6px;
}

.bp-ga-realtime-card-footer {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
    margin-top: 4px;
}

/* --- Realtime Widget (Sidebar) --- */
.bp-ga-realtime-widget {
    padding: 4px 0;
}

.bp-ga-realtime-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.bp-ga-realtime-label {
    font-size: 11px;
    font-weight: 700;
    color: #27ae60;
    letter-spacing: 1px;
}

.bp-ga-realtime-count-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.bp-ga-realtime-count {
    font-size: 36px;
    font-weight: 800;
    color: #222;
    line-height: 1;
}

.bp-ga-realtime-unit {
    font-size: 14px;
    color: #555;
}

.bp-ga-realtime-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.bp-ga-realtime-updated {
    font-size: 11px;
    color: #999;
}

/* --- Pulsing Dot --- */
.bp-ga-realtime-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #27ae60;
    border-radius: 50%;
    flex-shrink: 0;
    animation: bp-ga-pulse 1.5s ease-in-out infinite;
}

@keyframes bp-ga-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.5);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 7px rgba(39, 174, 96, 0);
    }
}

/* Dot inside card is white */
.bp-ga-realtime-card .bp-ga-realtime-dot {
    background: #fff;
    animation: bp-ga-pulse-white 1.5s ease-in-out infinite;
}

@keyframes bp-ga-pulse-white {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
    }
}

/* --- Page Views --- */
.bp-ga-pageviews-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #555;
}

.bp-ga-pageviews-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 600;
}

.bp-ga-pageviews-card {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    padding: 14px 20px;
    margin: 8px 0;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.bp-ga-pageviews-card-icon {
    font-size: 30px;
    flex-shrink: 0;
}

.bp-ga-pageviews-card-count {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.bp-ga-pageviews-card-label {
    font-size: 12px;
    opacity: 0.85;
    display: block;
    margin-top: 2px;
}

/* Content footer hook */
.bp-ga-pageviews-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: #555;
}

.bp-ga-pageviews-footer-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* --- Error --- */
.bp-ga-error {
    color: #dc3545;
    font-style: italic;
    font-size: 13px;
    padding: 8px;
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .bp-ga-visitors-grid {
        grid-template-columns: 1fr;
    }

    .bp-ga-visitors-card {
        padding: 16px;
    }

    .bp-ga-visitors-count {
        font-size: 20px;
    }
}
