/* JeReviews Frontend Styles — v2.1 */

.jereviews-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: var(--jer-font-body);
}

/* ── Header ── */
.jer-front-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 28px 32px;
    margin-bottom: 28px;
    background: var(--jer-header-bg);
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    gap: 24px;
}
.jer-header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}
.jer-avg-score {
    font-size: 42px;
    font-weight: 800;
    color: var(--jer-text-color);
    line-height: 1;
    letter-spacing: -1px;
}
.jer-header-stars-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.jer-header-stars-row .jer-star {
    width: 20px;
    height: 20px;
}
.jer-front-count {
    font-family: var(--jer-font-name);
    font-size: 13px;
    font-weight: 500;
    color: #999;
}

/* ── Recent 30-day badge ── */
.jer-recent-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    margin-top: 8px;
    line-height: 1;
}
.jer-recent-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.jer-recent-badge strong {
    font-weight: 800;
}

/* ── Rating Distribution ── */
.jer-header-right {
    flex: 1;
    max-width: 340px;
    min-width: 240px;
}
.jer-dist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.jer-dist-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    width: 14px;
    text-align: right;
    flex-shrink: 0;
}
.jer-dist-star {
    width: 15px;
    height: 15px;
    color: var(--jer-star-color);
    flex-shrink: 0;
}
.jer-dist-bar {
    flex: 1;
    height: 7px;
    background: #ebebeb;
    border-radius: 10px;
    overflow: hidden;
}
.jer-dist-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--jer-star-color), #ffc933);
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.jer-dist-pct {
    font-size: 11px;
    color: #aaa;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 500;
}

/* ── Stars ── */
.jer-stars {
    display: inline-flex;
    align-items: center;
    gap: 1.5px;
}
.jer-star {
    width: var(--jer-star-size);
    height: var(--jer-star-size);
    color: var(--jer-star-color);
    flex-shrink: 0;
}
.jer-star-empty { color: #ddd; }

/* ── Masonry ── */
.jer-masonry {
    columns: var(--jer-cols-desktop);
    column-gap: 16px;
}
.jer-card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: var(--jer-card-bg);
    border-radius: var(--jer-card-radius);
    overflow: hidden;
    box-shadow: var(--jer-card-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: inline-block;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.04);
}
.jer-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* ── Card Photo ── */
.jer-card-photo {
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    line-height: 0;
}
.jer-card-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.jer-card-photo:hover img { transform: scale(1.04); }

/* ── Card Body ── */
.jer-card-body { padding: 14px 16px 16px; }

/* ── Author ── */
.jer-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.jer-author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
    line-height: 1;
}
.jer-author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.jer-author-name {
    font-family: var(--jer-font-name);
    font-size: var(--jer-name-size);
    font-weight: 700;
    color: var(--jer-text-color);
    line-height: 1.2;
}
.jer-author-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.jer-review-date {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
}
/* Fresh / CTA dates */
.jer-review-date.jer-date-fresh {
    color: #ea580c;
    font-weight: 600;
}
.jer-verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    color: #1a8c5b;
    background: #e6f7ef;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}
.jer-verified-tag svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.jer-card-stars { margin-bottom: 8px; }
.jer-card-stars .jer-stars { gap: 1px; }
.jer-card-stars .jer-star {
    width: calc(var(--jer-star-size) - 1px);
    height: calc(var(--jer-star-size) - 1px);
}

.jer-card-text {
    font-family: var(--jer-font-body);
    font-size: var(--jer-body-size);
    color: var(--jer-body-color);
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
}

.jer-card-product {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 11px;
    color: #999;
    display: flex;
    gap: 4px;
}
.jer-product-label { font-weight: 500; }
.jer-product-name { font-weight: 600; color: #666; }

/* ── Helpful / Like-Dislike ── */
.jer-card-helpful {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.jer-helpful-text {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 3px;
}
.jer-helpful-text .jer-helpful-count {
    font-weight: 500;
}
.jer-helpful-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.jer-helpful-btn {
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s;
    color: #aaa;
    padding: 0;
}
.jer-helpful-btn:hover {
    border-color: #ccc;
    color: #666;
    background: #fafafa;
}
.jer-helpful-btn.active-like {
    border-color: #22c55e;
    color: #22c55e;
    background: #f0fdf4;
}
.jer-helpful-btn.active-dislike {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}
.jer-helpful-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Load More ── */
.jer-load-more-wrap {
    text-align: center;
    margin-top: 32px;
    padding: 8px 0 20px;
}
.jer-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 40px;
    background: var(--jer-btn-bg);
    color: var(--jer-btn-color);
    border: none;
    border-radius: var(--jer-btn-radius);
    font-family: var(--jer-font-name);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}
.jer-load-more-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.jer-load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.jer-load-more-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: jer-spin 0.6s linear infinite;
}

/* ── Lightbox ── */
.jer-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.jer-lightbox.active { pointer-events: auto; opacity: 1; }
.jer-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: var(--jer-overlay-bg);
    transition: opacity 0.3s ease;
}
.jer-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}
.jer-lightbox.active .jer-lightbox-content { transform: scale(1); }
.jer-lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--jer-lightbox-radius);
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0,0,0,0.3);
}
.jer-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    z-index: 2;
    color: #333;
}
.jer-lightbox-close:hover { transform: scale(1.1); }

/* ── Animations ── */
@keyframes jer-spin { to { transform: rotate(360deg); } }
@keyframes jer-card-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.jer-card-animate { animation: jer-card-in 0.4s ease forwards; }

/* ── Responsive ── */
@media (max-width: 1400px) {
    .jer-masonry { columns: calc(var(--jer-cols-desktop) - 1); }
}
@media (max-width: 1100px) {
    .jer-masonry { columns: var(--jer-cols-tablet); }
}
@media (max-width: 860px) {
    .jer-masonry { columns: calc(var(--jer-cols-tablet) - 1); }
    .jer-front-header { padding: 20px; flex-direction: column; align-items: stretch; }
    .jer-header-right { max-width: 100%; }
}
@media (max-width: 640px) {
    .jer-masonry { columns: var(--jer-cols-mobile); column-gap: 10px; }
    .jer-card { margin-bottom: 10px; }
    .jer-card-body { padding: 10px 12px 14px; }
    .jer-front-header { padding: 16px; margin-bottom: 20px; border-radius: 12px; }
    .jer-avg-score { font-size: 32px; }
    .jer-load-more-btn { padding: 11px 28px; font-size: 13px; }
    .jer-lightbox-close { top: -10px; right: -10px; width: 32px; height: 32px; }
    .jer-lightbox-img { max-width: 95vw; max-height: 80vh; }
}
