@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --hpcr-star:    #FBBF24;
    --hpcr-orange:  #FF6B35;
    --hpcr-text:    #111827;
    --hpcr-muted:   #6B7280;
    --hpcr-border:  #E5E7EB;
    --hpcr-bg:      #F9FAFB;
    --hpcr-white:   #ffffff;
    --hpcr-radius:  12px;
    --hpcr-font:    'Inter', -apple-system, sans-serif;
}

.hpcr-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.hpcr-wrap {
    font-family: var(--hpcr-font);
    color: var(--hpcr-text);
    max-width: 100%;
}

/* ── SUMMARY ── */
.hpcr-summary {
    display: flex;
    gap: 32px;
    align-items: center;
    background: var(--hpcr-white);
    border: 1px solid var(--hpcr-border);
    border-radius: var(--hpcr-radius);
    padding: 24px 28px;
    margin-bottom: 16px;
}

.hpcr-summary-left {
    text-align: center;
    flex-shrink: 0;
    min-width: 90px;
}

.hpcr-score {
    font-size: 52px;
    font-weight: 700;
    color: var(--hpcr-text);
    line-height: 1;
    letter-spacing: -2px;
}

.hpcr-stars-display {
    display: flex;
    justify-content: center;
    gap: 2px;
    font-size: 18px;
    margin: 6px 0 4px;
}

.hpcr-total {
    font-size: 12px;
    color: var(--hpcr-muted);
    font-weight: 500;
}

.hpcr-summary-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hpcr-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hpcr-bar-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--hpcr-muted);
    width: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.hpcr-bar-star { color: var(--hpcr-star); font-size: 11px; }

.hpcr-bar-track {
    flex: 1;
    height: 6px;
    background: var(--hpcr-border);
    border-radius: 99px;
    overflow: hidden;
}

.hpcr-bar-fill {
    height: 100%;
    background: var(--hpcr-star);
    border-radius: 99px;
}

.hpcr-bar-count {
    font-size: 12px;
    color: var(--hpcr-muted);
    width: 14px;
    text-align: right;
    flex-shrink: 0;
}

/* Stars */
.hpcr-star.full  { color: var(--hpcr-star); }
.hpcr-star.half  { color: var(--hpcr-star); opacity: 0.5; }
.hpcr-star.empty { color: var(--hpcr-border); }

/* ── REVIEWS LIST ── */
.hpcr-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.hpcr-review-item {
    background: var(--hpcr-white);
    border: 1px solid var(--hpcr-border);
    border-radius: var(--hpcr-radius);
    padding: 20px 22px;
}

.hpcr-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.hpcr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.hpcr-review-meta { flex: 1; }

.hpcr-reviewer-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--hpcr-text);
    margin-bottom: 3px;
}

.hpcr-review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
}

.hpcr-review-stars .full  { color: var(--hpcr-star); }
.hpcr-review-stars .empty { color: var(--hpcr-border); }

.hpcr-review-date {
    font-size: 12px;
    color: var(--hpcr-muted);
    font-weight: 400;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

.hpcr-review-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--hpcr-muted);
}

.hpcr-no-reviews {
    text-align: center;
    padding: 36px 24px;
    background: var(--hpcr-white);
    border: 1px dashed var(--hpcr-border);
    border-radius: var(--hpcr-radius);
    margin-bottom: 20px;
    color: var(--hpcr-muted);
    font-size: 14px;
}

/* ── FORM ── */
.hpcr-form-wrap {
    background: var(--hpcr-white);
    border: 1px solid var(--hpcr-border);
    border-radius: var(--hpcr-radius);
    padding: 24px 28px;
}

.hpcr-form-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--hpcr-text);
    margin-bottom: 20px;
}

/* Star Picker */
.hpcr-star-picker {
    margin-bottom: 18px;
}

.hpcr-stars-input {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.hpcr-star-btn {
    font-size: 32px;
    color: var(--hpcr-border);
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
    user-select: none;
    line-height: 1;
}

.hpcr-star-btn:hover,
.hpcr-star-btn.active {
    color: var(--hpcr-star);
    transform: scale(1.15);
}

.hpcr-rating-label {
    font-size: 12px;
    color: var(--hpcr-muted);
    font-weight: 500;
    display: block;
}

/* Fields */
.hpcr-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.hpcr-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.hpcr-field:last-child { margin-bottom: 0; }

.hpcr-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hpcr-text);
    margin-bottom: 6px;
}

.hpcr-required { color: #EF4444; }

.hpcr-input-wrap { position: relative; }

.hpcr-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.hpcr-input-wrap input { padding-left: 36px !important; }

.hpcr-field input,
.hpcr-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--hpcr-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hpcr-text);
    background: var(--hpcr-white);
    font-family: var(--hpcr-font);
    outline: none;
    transition: border-color 0.15s;
}

.hpcr-field input:focus,
.hpcr-field textarea:focus {
    border-color: #9CA3AF;
}

.hpcr-field input::placeholder,
.hpcr-field textarea::placeholder { color: #D1D5DB; }

.hpcr-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form footer */
.hpcr-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.hpcr-note {
    font-size: 12px;
    color: var(--hpcr-muted);
    font-weight: 400;
}

.hpcr-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--hpcr-orange);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--hpcr-font);
    transition: background 0.15s, transform 0.15s;
}

.hpcr-submit-btn:hover {
    background: #e55a25;
    transform: translateY(-1px);
}

.hpcr-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.hpcr-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hpcr-spin 0.6s linear infinite;
}

@keyframes hpcr-spin { to { transform: rotate(360deg); } }

.hpcr-message {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.hpcr-message.success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.hpcr-message.error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ── RATING STATUS SHORTCODE ── */
.hpcr-rating-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--hpcr-font);
    font-size: 14px;
}

.hpcr-rs-score { font-size: 15px; font-weight: 700; color: var(--hpcr-text); }
.hpcr-rs-stars { display: inline-flex; gap: 1px; font-size: 13px; }
.hpcr-rs-sep   { color: var(--hpcr-border); }
.hpcr-rs-count { font-size: 13px; color: var(--hpcr-muted); }
.hpcr-rating-status--none { color: var(--hpcr-muted); font-size: 13px; }

/* ── RESPONSIVE ── */
@media (max-width: 580px) {
    .hpcr-field-row    { grid-template-columns: 1fr; }
    .hpcr-form-wrap,
    .hpcr-summary      { padding: 18px 16px; }
    .hpcr-summary      { flex-direction: column; gap: 16px; }
    .hpcr-form-footer  { flex-direction: column; align-items: flex-start; }
    .hpcr-submit-btn   { width: 100%; justify-content: center; }
    .hpcr-score        { font-size: 42px; }
}

/* ── REVIEW STARS ON RIGHT (like screenshot) ── */
.hpcr-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.hpcr-review-stars-right {
    margin-left: auto;
    display: flex;
    gap: 2px;
    font-size: 16px;
    flex-shrink: 0;
}

.hpcr-review-stars-right .hpcr-star.full  { color: #FBBF24; }
.hpcr-review-stars-right .hpcr-star.empty { color: #E5E7EB; }
.hpcr-review-stars-right .hpcr-star.half  { color: #FBBF24; opacity: 0.5; }

.hpcr-review-meta {
    flex: 1;
}

.hpcr-review-date {
    display: block;
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
    margin-top: 2px;
}

/* ── REVIEW HEADER LAYOUT ── */
.hpcr-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.hpcr-review-meta { flex: 1; }
.hpcr-reviewer-name { display: block; font-size: 14px; font-weight: 600; color: var(--hpcr-text); margin-bottom: 2px; }
.hpcr-review-date   { display: block; font-size: 12px; color: #9CA3AF; font-weight: 400; }
.hpcr-review-stars-right { margin-left: auto; display: flex; gap: 2px; font-size: 16px; flex-shrink: 0; }
.hpcr-review-stars-right .hpcr-star.full  { color: #FBBF24; }
.hpcr-review-stars-right .hpcr-star.empty { color: #E5E7EB; }
.hpcr-review-stars-right .hpcr-star.half  { color: #FBBF24; opacity: 0.5; }

/* ── LIKE & REPLY ACTIONS ── */
.hpcr-review-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #F3F4F6;
}

.hpcr-like-btn,
.hpcr-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    font-family: var(--hpcr-font);
    transition: all 0.15s ease;
    line-height: 1;
}

.hpcr-like-btn:hover,
.hpcr-reply-toggle:hover {
    border-color: #D1D5DB;
    color: #374151;
    background: #F9FAFB;
}

.hpcr-like-btn.hpcr-liked {
    border-color: #FBBF24;
    color: #B45309;
    background: #FFFBEB;
}

.hpcr-like-btn svg,
.hpcr-reply-toggle svg { flex-shrink: 0; }

/* ── REPLIES ── */
.hpcr-replies {
    margin-top: 12px;
    margin-left: 20px;
    border-left: 2px solid #F3F4F6;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hpcr-reply-item {}

.hpcr-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.hpcr-reply-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--hpcr-text);
}

.hpcr-reply-date {
    font-size: 11px;
    color: #9CA3AF;
}

.hpcr-reply-text {
    font-size: 13px;
    line-height: 1.6;
    color: #6B7280;
    margin: 0;
}

/* ── REPLY FORM ── */
.hpcr-reply-form {
    margin-top: 12px;
    margin-left: 20px;
    padding: 14px 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
}

.hpcr-reply-name,
.hpcr-reply-text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--hpcr-font);
    color: var(--hpcr-text);
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
    margin-bottom: 8px;
}

.hpcr-reply-name:focus,
.hpcr-reply-text-input:focus { border-color: #9CA3AF; }

.hpcr-reply-text-input { resize: vertical; min-height: 60px; }

.hpcr-reply-form-footer {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hpcr-reply-submit {
    background: #1E3A5F;
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--hpcr-font);
    transition: background 0.15s;
}
.hpcr-reply-submit:hover { background: #2D6A9F; }

.hpcr-reply-cancel {
    background: none;
    border: 1px solid #E5E7EB;
    color: #6B7280;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--hpcr-font);
}
.hpcr-reply-cancel:hover { background: #F3F4F6; }

/* ── RATING BADGE WIDGET [hpcr_rating_badge] ── */
.hpcr-badge-widget {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--hpcr-font, -apple-system, sans-serif);
    line-height: 1;
}
.hpcr-bw-score {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.hpcr-bw-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 14px;
}
.hpcr-bw-stars .hpcr-star.full  { color: #FBBF24; }
.hpcr-bw-stars .hpcr-star.half  { color: #FBBF24; opacity: 0.5; }
.hpcr-bw-stars .hpcr-star.empty { color: #E5E7EB; }
.hpcr-badge-widget--empty {
    font-size: 13px;
    color: #9CA3AF;
    font-family: var(--hpcr-font, -apple-system, sans-serif);
}

/* ── REVIEW LAYOUT ── */
.hpcr-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.hpcr-review-meta       { flex: 1; }
.hpcr-reviewer-name     { display: block; font-size: 14px; font-weight: 600; color: var(--hpcr-text,#111827); margin-bottom: 2px; }
.hpcr-review-date       { display: block; font-size: 12px; color: #9CA3AF; font-weight: 400; }
.hpcr-review-stars-right{ margin-left: auto; display: flex; gap: 2px; font-size: 16px; flex-shrink: 0; }
.hpcr-review-stars-right .hpcr-star.full  { color: #FBBF24; }
.hpcr-review-stars-right .hpcr-star.empty { color: #E5E7EB; }
.hpcr-review-stars-right .hpcr-star.half  { color: #FBBF24; opacity:0.5; }

/* ── LIKE & REPLY ── */
.hpcr-review-actions {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid #F3F4F6;
}
.hpcr-like-btn, .hpcr-reply-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 1px solid #E5E7EB; border-radius: 20px;
    padding: 5px 12px; font-size: 12px; font-weight: 500; color: #6B7280;
    cursor: pointer; font-family: var(--hpcr-font,-apple-system,sans-serif);
    transition: all 0.15s; line-height: 1;
}
.hpcr-like-btn:hover, .hpcr-reply-toggle:hover { border-color: #D1D5DB; color: #374151; background: #F9FAFB; }
.hpcr-like-btn.hpcr-liked { border-color: #FBBF24; color: #B45309; background: #FFFBEB; }

/* ── REPLIES ── */
.hpcr-replies { margin-top: 12px; margin-left: 20px; border-left: 2px solid #F3F4F6; padding-left: 16px; display: flex; flex-direction: column; gap: 10px; }
.hpcr-reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hpcr-reply-author { font-size: 13px; font-weight: 600; color: var(--hpcr-text,#111827); }
.hpcr-reply-date   { font-size: 11px; color: #9CA3AF; }
.hpcr-reply-text   { font-size: 13px; line-height: 1.6; color: #6B7280; margin: 0; }

/* ── REPLY FORM ── */
.hpcr-reply-form { margin-top: 12px; margin-left: 20px; padding: 14px 16px; background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px; }
.hpcr-reply-name, .hpcr-reply-text-input { width: 100%; padding: 8px 12px; border: 1px solid #E5E7EB; border-radius: 7px; font-size: 13px; font-family: var(--hpcr-font,-apple-system,sans-serif); background: #fff; box-sizing: border-box; outline: none; transition: border-color 0.15s; margin-bottom: 8px; color: #111827; }
.hpcr-reply-name:focus, .hpcr-reply-text-input:focus { border-color: #9CA3AF; }
.hpcr-reply-text-input { resize: vertical; min-height: 60px; }
.hpcr-reply-form-footer { display: flex; gap: 8px; align-items: center; }
.hpcr-reply-submit { background: #1E3A5F; color: #fff; border: none; padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--hpcr-font,-apple-system,sans-serif); }
.hpcr-reply-submit:hover { background: #2D6A9F; }
.hpcr-reply-cancel { background: none; border: 1px solid #E5E7EB; color: #6B7280; padding: 7px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; font-family: var(--hpcr-font,-apple-system,sans-serif); }
.hpcr-reply-cancel:hover { background: #F3F4F6; }
