/* GRW Frontend Widget Styles */

.grw-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1a1a2e;
    margin: 24px 0;
}

/* ── Header ─────────────────────────────────────────────── */
.grw-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.grw-overall-rating {
    display: flex;
    align-items: center;
    gap: 16px;
}

.grw-score {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.grw-header-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grw-total-count {
    font-size: 13px;
    color: #64748b;
}

.grw-heading-text {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.grw-platform-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.grw-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.grw-badge-google   { background: #e8f0fe; color: #1a73e8; }
.grw-badge-facebook { background: #e7f0ff; color: #1877f2; }
.grw-badge-manual   { background: #f1f5f9; color: #475569; }

/* ── Stars ───────────────────────────────────────────────── */
.grw-stars-wrap {
    display: inline-flex;
    gap: 2px;
}

.grw-star {
    font-size: 18px;
    line-height: 1;
}

.grw-star-full  { color: #f59e0b; }
.grw-star-half  { color: #f59e0b; opacity: .6; }
.grw-star-empty { color: #d1d5db; }

.grw-stars-sm .grw-star { font-size: 13px; }

/* ── Grid ────────────────────────────────────────────────── */
.grw-grid {
    display: grid;
    gap: 16px;
}

.grw-cols-1 .grw-grid { grid-template-columns: 1fr; }
.grw-cols-2 .grw-grid { grid-template-columns: repeat(2, 1fr); }
.grw-cols-3 .grw-grid { grid-template-columns: repeat(3, 1fr); }
.grw-cols-4 .grw-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .grw-cols-3 .grw-grid,
    .grw-cols-4 .grw-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .grw-grid { grid-template-columns: 1fr !important; }
}

/* ── Card ────────────────────────────────────────────────── */
.grw-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow .2s, transform .2s;
}

.grw-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.grw-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Avatar ──────────────────────────────────────────────── */
.grw-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grw-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grw-avatar-initial {
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* ── Author ──────────────────────────────────────────────── */
.grw-author-info {
    flex: 1;
    min-width: 0;
}

.grw-author-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Platform icon ───────────────────────────────────────── */
.grw-card-platform {
    margin-left: auto;
    flex-shrink: 0;
}

.grw-platform-svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ── Review text ─────────────────────────────────────────── */
.grw-card-body { flex: 1; }

.grw-review-text {
    font-size: 14px;
    line-height: 1.65;
    color: #475569;
    margin: 0;
}

.grw-read-more {
    background: none;
    border: none;
    padding: 0;
    color: #2271b1;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────── */
.grw-card-footer {
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.grw-date {
    font-size: 12px;
    color: #94a3b8;
}

/* ── Load More ───────────────────────────────────────────── */
.grw-load-more-wrap {
    text-align: center;
    margin-top: 28px;
}

.grw-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: #fff;
    color: #2271b1;
    border: 2px solid #2271b1;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, color .18s, transform .15s, box-shadow .18s;
}

.grw-load-more-btn:hover:not(:disabled) {
    background: #2271b1;
    color: #fff;
    box-shadow: 0 4px 16px rgba(34,113,177,.3);
    transform: translateY(-1px);
}

.grw-load-more-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Card enter animation ────────────────────────────────── */
.grw-card-entering {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s ease, transform .3s ease;
}

.grw-card-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── States ──────────────────────────────────────────────── */
.grw-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 15px;
}

.grw-error {
    color: #ef4444;
    font-size: 14px;
}
