/* Good Review — Frontend Styles */

.gr-review-form {
    max-width: 560px;
    margin: 20px 0;
    padding: 28px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
}

.gr-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #1E3A5F;
    margin: 0 0 4px;
}

.gr-form-subtitle {
    font-size: 13px;
    color: #999;
    margin: 0 0 24px;
}

.gr-field {
    margin-bottom: 20px;
}

.gr-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.gr-required {
    color: #E8722A;
}

/* Star Rating — SVG icons (v1.0.9) */
.gr-stars {
    display: flex;
    gap: 6px;
}

.gr-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin: 0;
    color: #ddd;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 0;
}

.gr-star:hover,
.gr-star.gr-star-active {
    color: #F4A100;
}

.gr-star:hover {
    transform: scale(1.15);
}

/* Keyboard focus indicator (visible on Tab nav, hidden on mouse click) */
.gr-star:focus-visible {
    outline: 2px solid #F4A100;
    outline-offset: 2px;
    border-radius: 4px;
}
.gr-star:focus:not(:focus-visible) {
    outline: none;
}

.gr-star svg {
    display: block;
    width: 32px;
    height: 32px;
}

/* Option Buttons */
.gr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gr-option-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    outline: none;
}

.gr-option-btn:hover {
    border-color: #E8722A;
    color: #E8722A;
}

.gr-option-btn.selected {
    background: #E8722A;
    border-color: #E8722A;
    color: #fff;
}

/* Text Input */
.gr-text-input {
    width: 100%;
    max-width: 300px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.gr-text-input:focus {
    border-color: #E8722A;
}

/* Preview */
.gr-preview {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.gr-preview-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    font-style: italic;
}

/* Submit */
.gr-submit-wrap {
    text-align: center;
}

.gr-submit-btn {
    display: inline-block;
    background: #E8722A;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    outline: none;
}

.gr-submit-btn:hover {
    background: #d4641f;
}

.gr-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Success */
.gr-success {
    text-align: center;
    padding: 20px 0;
}

.gr-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.gr-success h3 {
    color: #1E3A5F;
    margin: 0 0 16px;
}

.gr-coupon-box {
    background: #FFF8E1;
    border: 2px dashed #F4A100;
    border-radius: 8px;
    padding: 16px;
    margin: 12px auto;
    max-width: 300px;
}

.gr-coupon-code {
    font-size: 24px;
    font-weight: 700;
    color: #E8722A;
    letter-spacing: 2px;
    margin: 0 0 4px;
}

.gr-coupon-info {
    font-size: 13px;
    color: #666;
}

/* Login notice */
.gr-login-notice,
.gr-already-reviewed {
    padding: 14px 18px;
    background: #f8f8f8;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.gr-login-notice a {
    color: #E8722A;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
    .gr-review-form {
        padding: 20px 16px;
    }
    .gr-star {
        font-size: 28px;
    }
    .gr-option-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* ----------------------------------------------------------------
   v1.0.9 — Product name heading + SVG success icon
   ---------------------------------------------------------------- */
.gr-form-product {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #f7f7f7;
    border-radius: 8px;
    border-left: 3px solid #F4A100;
}
.gr-form-product-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}
.gr-form-product-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.gr-success-icon {
    display: flex;
    justify-content: center;
    margin: 0 0 12px;
}
.gr-success-icon svg {
    width: 56px;
    height: 56px;
}

/* ----------------------------------------------------------------
   v1.0.9 — Avatar placeholder (rendered as <img> to keep WC layout)
   ---------------------------------------------------------------- */
.gr-avatar-placeholder {
    background: #f0f0f0;
    border-radius: 50%;
}

/* ----------------------------------------------------------------
   v1.1.6 — Client-side privacy mask for review listing
   - Avatar: completely hidden (display:none) — Daniel spec 完全不顯示
   - Author name: hidden until JS masks (avoids flash on slow connections)
   - JS handles full element removal + author text replacement
   - This approach replaces server-side CommentDisplay filter that conflicted
     with Astra Pro WooCommerce tab rendering and broke product page layout
   ---------------------------------------------------------------- */

/* Completely hide all avatar variants (img / div / span letter avatar)
   as a CSS fallback if JS hasn't run yet (slow connections, JS disabled) */
.commentlist .comment_container img.avatar,
.commentlist .comment_container img.photo,
.commentlist .comment_container .avatar,
.commentlist .comment_container [class*="avatar"],
.woocommerce-Reviews .commentlist img.avatar {
    display: none !important;
}

/* Hide author name until JS masks it (avoids privacy flash on slow connections) */
.commentlist .woocommerce-review__author,
.commentlist .comment_container .meta strong {
    visibility: hidden;
}
.commentlist .woocommerce-review__author.gr-name-masked,
.commentlist .comment_container .meta strong.gr-name-masked {
    visibility: visible;
}

/* ----------------------------------------------------------------
   v1.1.9 — Text input counter + warning state
   ---------------------------------------------------------------- */
.gr-text-wrap {
    position: relative;
    display: block;
}
.gr-counter {
    display: block;
    text-align: right;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
    user-select: none;
}
.gr-counter.gr-counter-warn {
    color: #e0a800;
}
.gr-counter.gr-counter-max {
    color: #d83232;
    font-weight: 600;
}
.gr-text-input.gr-input-warn {
    border-color: #d83232;
    background: #fff5f5;
}
.gr-link-warning {
    margin-top: 6px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #f5c2c2;
    color: #b32424;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

/* ----------------------------------------------------------------
   v1.2.0 — Submit-time violation feedback
   (replaces v1.1.9 input-time .gr-link-warning which was too aggressive)
   ---------------------------------------------------------------- */
.gr-text-input.gr-input-violation {
    border-color: #d83232 !important;
    background: #fff5f5 !important;
}
.gr-violation-msg {
    margin-top: 6px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #f5c2c2;
    color: #b32424;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    animation: gr-violation-shake 0.3s ease;
}
@keyframes gr-violation-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
