/* WP Visitor Statistics - Frontend Stylesheet */
.wvs-widget {
    container-type: inline-size;
    width: 100%;
    margin: 15px 0;
    box-sizing: border-box;
    font-family: inherit;
}
.wvs-widget *,
.wvs-widget *::before,
.wvs-widget *::after {
    box-sizing: border-box;
}

/* =======================================================
   CARDS LAYOUT (Default & Responsive Auto-Fit)
   ======================================================= */
.wvs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    width: 100%;
}

.wvs-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.wvs-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wvs-stat-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f3f4f6;
}

.wvs-css-icon {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
}

.wvs-icon-total { color: #2563eb; }
.wvs-icon-today { color: #f59e0b; }
.wvs-icon-online { color: #16a34a; }
.wvs-icon-yesterday { color: #e11d48; }
.wvs-icon-month { color: #0891b2; }
.wvs-icon-year { color: #7c3aed; }
.wvs-icon-ip { color: #475569; }

/* Chart icon (Total) */
.wvs-icon-total .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: 3.5px;
    height: 8px;
    border-radius: 2px 2px 0 0;
    background: currentColor;
    box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor;
}
.wvs-icon-total .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    bottom: 2px;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* Clock icon (Today) */
.wvs-icon-today .wvs-css-icon {
    border: 2px solid currentColor;
    border-radius: 50%;
}
.wvs-icon-today .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 4px;
    width: 2px;
    height: 7px;
    border-radius: 1px;
    background: currentColor;
}
.wvs-icon-today .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 9px;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* Yesterday icon (Clock backwards) */
.wvs-icon-yesterday .wvs-css-icon {
    border: 2px solid currentColor;
    border-radius: 50%;
}
.wvs-icon-yesterday .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 5px;
    width: 2px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
}
.wvs-icon-yesterday .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 9px;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* Month icon (Calendar) */
.wvs-icon-month .wvs-css-icon {
    border: 2px solid currentColor;
    border-radius: 4px;
    height: 18px;
    top: 3px;
}
.wvs-icon-month .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 3px;
    right: 2px;
    height: 2px;
    background: currentColor;
}
.wvs-icon-month .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 7px;
    width: 3px;
    height: 3px;
    background: currentColor;
    box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor;
}

/* Year icon (Calendar with tag) */
.wvs-icon-year .wvs-css-icon {
    border: 2px solid currentColor;
    border-radius: 4px;
    height: 18px;
    top: 3px;
}
.wvs-icon-year .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -3px;
    width: 2px;
    height: 3px;
    background: currentColor;
    box-shadow: 10px 0 0 currentColor;
}
.wvs-icon-year .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 5px;
    width: 8px;
    height: 6px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

/* IP address icon (Screen/Monitor) */
.wvs-icon-ip .wvs-css-icon {
    border: 2px solid currentColor;
    border-radius: 3px;
    height: 15px;
    top: 3px;
}
.wvs-icon-ip .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 8px;
    bottom: -5px;
    width: 4px;
    height: 4px;
    background: currentColor;
}
.wvs-icon-ip .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    bottom: -6px;
    width: 12px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

/* User icon (Online) */
.wvs-icon-online .wvs-css-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
}
.wvs-icon-online .wvs-css-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    bottom: 2px;
    width: 18px;
    height: 9px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.wvs-stat-content {
    min-width: 0;
    flex: 1;
}

.wvs-stat-number {
    display: block;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.wvs-stat-number.wvs-ip-text,
.wvs-list-number.wvs-ip-text {
    font-size: 14.5px;
    letter-spacing: 0.2px;
}

.wvs-stat-label {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wvs-live-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: wvs-pulse 1.8s infinite;
}

@keyframes wvs-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

/* =======================================================
   CONTAINER QUERIES FOR NARROW COLUMNS (Footer col-3, Sidebar)
   ======================================================= */
@container (max-width: 500px) {
    .wvs-cards-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .wvs-stat-card {
        min-height: 54px;
        padding: 8px 12px;
        gap: 10px;
        border-radius: 8px;
    }
    .wvs-stat-icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 8px;
    }
    .wvs-css-icon {
        transform: scale(0.85);
    }
    .wvs-stat-number {
        font-size: 17px;
    }
    .wvs-stat-label {
        font-size: 11.5px;
    }
    .wvs-live-dot {
        top: 8px;
        right: 8px;
        width: 6px;
        height: 6px;
    }
}

/* Fallback Media Query for older browsers */
@media (max-width: 767px) {
    .wvs-cards-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* =======================================================
   LIST LAYOUT (.wvs-layout-list)
   ======================================================= */
.wvs-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.wvs-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.wvs-list-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wvs-list-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f3f4f6;
}

.wvs-list-icon .wvs-css-icon {
    transform: scale(0.75);
}

.wvs-list-label {
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
}

.wvs-list-number {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

.wvs-list-item .wvs-live-dot {
    position: static;
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

/* =======================================================
   FLATSOME & DARK FOOTER COMPATIBILITY
   ======================================================= */
.dark .wvs-stat-card,
.footer-wrapper .dark .wvs-stat-card,
.footer .dark .wvs-stat-card,
[data-theme="dark"] .wvs-stat-card {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}
.dark .wvs-stat-card:hover,
.footer-wrapper .dark .wvs-stat-card:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.2);
}
.dark .wvs-stat-icon,
.footer-wrapper .dark .wvs-stat-icon {
    background: rgba(255, 255, 255, 0.12);
}
.dark .wvs-stat-number,
.footer-wrapper .dark .wvs-stat-number {
    color: #ffffff;
}
.dark .wvs-stat-label,
.footer-wrapper .dark .wvs-stat-label {
    color: rgba(255, 255, 255, 0.75);
}

.dark .wvs-list-item,
.footer-wrapper .dark .wvs-list-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}
.dark .wvs-list-icon,
.footer-wrapper .dark .wvs-list-icon {
    background: rgba(255, 255, 255, 0.1);
}
.dark .wvs-list-label,
.footer-wrapper .dark .wvs-list-label {
    color: rgba(255, 255, 255, 0.8);
}
.dark .wvs-list-number,
.footer-wrapper .dark .wvs-list-number {
    color: #ffffff;
}

/* =======================================================
   AUTHOR CREDIT (Hồ Tấn Hiệu - googlemeta.com)
   ======================================================= */
.wvs-author-credit {
    margin-top: 8px;
    padding-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    text-align: right;
    color: #9ca3af;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.wvs-author-credit:hover {
    opacity: 1;
}

.wvs-author-credit a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    font-weight: 600;
    transition: color 0.2s ease;
}

.wvs-author-credit a:hover {
    color: #2563eb;
    border-bottom-style: solid;
}

.dark .wvs-author-credit,
.footer-wrapper .dark .wvs-author-credit {
    color: rgba(255, 255, 255, 0.55);
}
.dark .wvs-author-credit a:hover,
.footer-wrapper .dark .wvs-author-credit a:hover {
    color: #60a5fa;
}
