.page-views {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: "Zain", sans-serif;
}

/* Library & detail cards */
.page-views--card {
    width: 100%;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}

.page-views--card .page-views__chip {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    gap: 0.65rem;
    border-color: var(--grid-card-border, rgba(0, 0, 0, 0.1));
    background: rgba(138, 7, 7, 0.06);
    box-shadow:
        0 2px 12px rgba(138, 7, 7, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.page-views--card .page-views__chip:hover {
    border-color: rgba(138, 7, 7, 0.28);
    box-shadow:
        0 4px 18px rgba(138, 7, 7, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.page-views--card .page-views__label {
    color: var(--text, #2b2b2b);
    opacity: 0.75;
}

.page-views--card .page-views__count {
    color: var(--primary, #8a0707);
    text-shadow: none;
}

body.darkmode .page-views--card .page-views__chip {
    border-color: var(--grid-card-border, rgba(255, 255, 255, 0.12));
    background: rgba(0, 0, 0, 0.22);
    box-shadow:
        0 2px 14px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.darkmode .page-views--card .page-views__label {
    color: rgba(255, 255, 255, 0.72);
}

body.darkmode .page-views--card .page-views__count {
    color: var(--primary, #ff4040);
}

.page-views__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(138, 7, 7, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition:
        transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.page-views.is-ready .page-views__chip {
    animation: page-views-chip-in 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.page-views__chip:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.22),
        0 0 20px rgba(138, 7, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.page-views__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #a30f0f 0%, var(--primary, #8a0707) 55%, #5c0404 100%);
    box-shadow:
        0 2px 10px rgba(138, 7, 7, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.page-views__icon {
    font-size: 0.95rem;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.page-views.is-ready .page-views__icon-wrap {
    animation: page-views-icon-pulse 2.8s ease-in-out infinite;
}

.page-views__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    min-width: 0;
}

.page-views__label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.2;
}

.page-views__count {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 8px rgba(138, 7, 7, 0.35);
    min-width: 2.5ch;
}

.page-views.is-loading .page-views__count {
    position: relative;
    color: transparent;
    min-width: 3.25rem;
    min-height: 1.25rem;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: page-views-shimmer 1.2s ease-in-out infinite;
}

.page-views.is-ready .page-views__count {
    animation: page-views-pop 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.page-views.is-count-bump .page-views__count {
    animation: page-views-bump 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.page-views.is-count-bump .page-views__chip {
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.22),
        0 0 24px rgba(255, 64, 64, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@keyframes page-views-chip-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes page-views-pop {
    from {
        opacity: 0.35;
        transform: scale(0.88);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes page-views-bump {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes page-views-icon-pulse {
    0%,
    100% {
        box-shadow:
            0 2px 10px rgba(138, 7, 7, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
    50% {
        box-shadow:
            0 2px 16px rgba(255, 64, 64, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes page-views-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

body.darkmode .page-views__chip {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.28);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 64, 64, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.darkmode .page-views__icon-wrap {
    background: linear-gradient(145deg, #ff5555 0%, var(--primary, #ff4040) 50%, #b82828 100%);
    box-shadow:
        0 2px 12px rgba(255, 64, 64, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.darkmode .page-views__label {
    color: rgba(255, 255, 255, 0.65);
}

body.darkmode .page-views__count {
    text-shadow: 0 1px 10px rgba(255, 64, 64, 0.35);
}

@media (max-width: 480px) {
    .page-views__chip {
        gap: 0.6rem;
        padding: 0.5rem 0.85rem 0.5rem 0.7rem;
    }

    .page-views__icon-wrap {
        width: 1.9rem;
        height: 1.9rem;
    }

    .page-views__count {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-views.is-ready .page-views__chip,
    .page-views.is-ready .page-views__count,
    .page-views.is-ready .page-views__icon-wrap,
    .page-views.is-count-bump .page-views__count {
        animation: none;
    }

    .page-views__chip:hover {
        transform: none;
    }
}
