/* Zavier theme-owned stylesheet; visual tokens are finalized by css/theme.css. */
/* Source: app/Modules/Opac/Views/statistics_web_visitor.php */
/* Shared shell, cards and typography from statistics-anggota.css */

/* ===== KPI Cards — device color accents ===== */
.wv-kpi-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.wv-kpi-desktop span { background: #eaf2fb !important; color: #1f5fae !important; }
.wv-kpi-mobile span  { background: #fff7ed !important; color: #f97316 !important; }
.wv-kpi-tablet span  { background: #f3f0ff !important; color: #8b5cf6 !important; }
.wv-kpi-total span   { background: #ecfdf5 !important; color: #10b981 !important; }
.wv-kpi-unique span  { background: #fef3c7 !important; color: #d97706 !important; }

/* ===== Chart containers ===== */
.wv-chart {
    position: relative;
    min-width: 0;
}

.wv-chart-trend {
    height: 340px;
}

.wv-chart-donut {
    height: 260px;
    max-width: 320px;
    margin: 0 auto 16px;
}

.wv-chart-bars {
    height: 300px;
}

.wv-chart canvas {
    max-width: 100%;
}

/* ===== Duo Grid ===== */
.wv-duo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== Device Legend ===== */
.wv-device-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 8px;
}

.wv-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    font-size: .84rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wv-legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wv-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wv-legend-desktop .wv-legend-dot { background: #1f5fae; }
.wv-legend-mobile .wv-legend-dot  { background: #f97316; }
.wv-legend-tablet .wv-legend-dot  { background: #8b5cf6; }

.wv-legend-label {
    flex: 1;
    font-weight: 600;
    color: #172b43;
}

.wv-legend-item strong {
    font-weight: 700;
    color: #172b43;
}

.wv-legend-item em {
    font-style: normal;
    color: #64748b;
    font-size: .78rem;
}

/* ===== Top Pages List ===== */
.wv-pages-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wv-page-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f3f7;
}

.wv-page-item:last-child {
    border-bottom: none;
}

.wv-page-rank {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2fb;
    color: #1f5fae;
    font-size: .75rem;
    font-weight: 700;
    border-radius: 8px;
}

.wv-page-item:nth-child(1) .wv-page-rank { background: #1f5fae; color: #fff; }
.wv-page-item:nth-child(2) .wv-page-rank { background: #3d78ba; color: #fff; }
.wv-page-item:nth-child(3) .wv-page-rank { background: #6b9bcd; color: #fff; }

.wv-page-data {
    flex: 1;
    min-width: 0;
}

.wv-page-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.wv-page-meta span {
    font-size: .82rem;
    color: #172b43;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.wv-page-meta strong {
    font-size: .75rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.wv-page-progress {
    display: block;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
    border: none;
    background: #e6edf5;
}

.wv-page-progress::-webkit-progress-bar {
    background: #e6edf5;
    border-radius: 3px;
}

.wv-page-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #1f5fae, #6b9bcd);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.wv-page-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #1f5fae, #6b9bcd);
    border-radius: 3px;
}

/* ===== Notes ===== */
.wv-notes ul {
    padding-left: 18px;
    margin: 0;
    color: #64748b;
    font-size: .83rem;
    line-height: 1.8;
}

.wv-notes li+li {
    margin-top: 10px;
}

.wv-notes strong {
    color: #172b43;
}

/* ===== Trend Panel ===== */
.wv-trend-panel {
    margin-bottom: 20px;
}

/* ===== Empty State ===== */
.webvisitor-statistics-page .member-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8896a4;
}

.webvisitor-statistics-page .member-empty i,
.webvisitor-statistics-page .member-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.webvisitor-statistics-page .member-empty h2 {
    font-size: 1.1rem;
    margin: 14px 0 6px;
    color: #172b43;
}

.webvisitor-statistics-page .member-empty p {
    max-width: 370px;
    margin: 0 auto;
    font-size: .85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .wv-kpi-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .wv-duo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .wv-kpi-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wv-chart-trend {
        height: 280px;
    }

    .wv-chart-donut {
        height: 220px;
    }

    .wv-chart-bars {
        height: 260px;
    }

    .webvisitor-statistics-page .member-statistics-shell > .member-panel {
        margin: 0 12px 12px;
    }

    .wv-duo-grid {
        margin: 0 12px 12px;
    }

    .wv-notes {
        margin: 0 12px 12px;
    }

    .wv-trend-panel {
        margin: 0 12px 20px;
    }
}

@media (max-width: 575px) {
    .wv-kpi-list {
        grid-template-columns: 1fr;
    }

    .wv-page-meta {
        flex-direction: column;
        gap: 2px;
    }

    .wv-page-meta span {
        max-width: 100%;
    }
}

/* ===== Filter Override ===== */
.webvisitor-statistics-page .visit-filter {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important;
}

@media screen and (max-width: 768px) {
    .webvisitor-statistics-page .visit-filter {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Print ===== */
@media print {
    .wv-chart {
        display: none !important;
    }

    .visit-data > div {
        display: block !important;
    }

    .visit-table-wrap {
        max-height: none;
        overflow: visible;
    }

    .visit-data summary {
        display: none;
    }
}
