/**
 * GoGreen Directory AI - Advanced Reviews Styles
 *
 * Star ratings, review cards, photo grids, owner responses, vote buttons,
 * review form, and responsive design.
 *
 * @package GoGreenAI
 */

/* ==========================================================================
   Review Form
   ========================================================================== */

.ggd-review-form-wrap {
    margin: 32px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.ggd-review-form-wrap h3 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
    color: #333333;
}

.ggd-review-login-message {
    padding: 16px 20px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
}

.ggd-review-login-message p {
    margin: 0;
    color: #555555;
}

.ggd-review-login-message a {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

.ggd-review-login-message a:hover {
    text-decoration: underline;
}

.ggd-review-rate-limit-message {
    padding: 16px 20px;
    background: #fce4ec;
    border-left: 4px solid #e53935;
    border-radius: 4px;
}

.ggd-review-rate-limit-message p {
    margin: 0;
    color: #555555;
}

/* Rating Fields */

.ggd-rating-field {
    margin-bottom: 16px;
}

.ggd-rating-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #444444;
}

.ggd-rating-field--required label::after {
    content: '';
}

/* Star Rating Interactive */

.ggd-star-rating {
    display: inline-flex;
    gap: 4px;
}

.ggd-star-rating .ggd-star {
    font-size: 28px;
    color: #d0d0d0;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1;
}

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

.ggd-star-rating .ggd-star--active {
    color: #ffc107;
}

.ggd-star-rating .ggd-star:focus-visible {
    outline: 2px solid #2e7d32;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Text Inputs */

.ggd-review-field {
    margin-bottom: 16px;
}

.ggd-review-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #444444;
}

.ggd-review-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    background: #fafafa;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ggd-review-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
    background: #ffffff;
}

textarea.ggd-review-input {
    resize: vertical;
    min-height: 100px;
}

/* Photo Upload */

.ggd-review-photos-upload {
    margin-top: 6px;
}

.ggd-review-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555555;
    background: #f5f5f5;
    border: 1px dashed #bdbdbd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ggd-review-upload-btn:hover {
    background: #eeeeee;
    border-color: #2e7d32;
    color: #2e7d32;
}

.ggd-review-upload-btn.ggd-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ggd-review-photos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ggd-review-photo-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.ggd-review-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ggd-review-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ggd-review-photo-remove:hover {
    background: rgba(229, 57, 53, 0.9);
}

/* Submit Button */

.ggd-review-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: #2e7d32;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.ggd-review-submit-btn:hover {
    background: #256b29;
}

.ggd-review-submit-btn:active {
    transform: scale(0.98);
}

.ggd-review-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */

.ggd-review-messages {
    margin-bottom: 16px;
}

.ggd-review-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.ggd-review-message--success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.ggd-review-message--error {
    background: #fce4ec;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* ==========================================================================
   Reviews List
   ========================================================================== */

.ggd-reviews-wrap {
    margin: 32px 0;
}

.ggd-reviews-header {
    margin-bottom: 24px;
}

.ggd-reviews-header h3 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 600;
    color: #333333;
}

/* Reviews Summary */

.ggd-reviews-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: #f9fbe7;
    border-radius: 8px;
    border: 1px solid #e6ee9c;
}

.ggd-reviews-summary-overall {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ggd-reviews-avg-number {
    font-size: 36px;
    font-weight: 700;
    color: #333333;
    line-height: 1;
}

.ggd-reviews-avg-stars {
    display: flex;
    align-items: center;
}

.ggd-reviews-count {
    font-size: 13px;
    color: #777777;
}

.ggd-reviews-summary-criteria {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ggd-reviews-criteria-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.ggd-criteria-label {
    color: #666666;
    font-weight: 500;
}

.ggd-criteria-value {
    font-weight: 600;
    color: #333333;
}

/* Sort Dropdown */

.ggd-reviews-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ggd-reviews-sort label {
    font-size: 13px;
    font-weight: 500;
    color: #666666;
}

.ggd-reviews-sort-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
}

.ggd-reviews-sort-select:focus {
    outline: none;
    border-color: #2e7d32;
}

/* No Reviews */

.ggd-no-reviews {
    padding: 24px;
    text-align: center;
    color: #888888;
    font-size: 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #d0d0d0;
}

/* ==========================================================================
   Review Card
   ========================================================================== */

.ggd-review-card {
    padding: 20px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.ggd-review-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Review Header */

.ggd-review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.ggd-review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ggd-review-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.ggd-review-author-info {
    display: flex;
    flex-direction: column;
}

.ggd-review-author-name {
    font-weight: 600;
    font-size: 14px;
    color: #333333;
}

.ggd-review-date {
    font-size: 12px;
    color: #999999;
}

.ggd-review-rating-overall {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ggd-review-rating-number {
    font-weight: 600;
    font-size: 14px;
    color: #555555;
}

/* Star Icons (static display) */

.ggd-stars {
    display: inline-flex;
    gap: 1px;
}

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

.ggd-stars--small .ggd-star-icon {
    font-size: 14px;
}

.ggd-star-icon--full {
    color: #ffc107;
}

.ggd-star-icon--half {
    color: #ffc107;
    opacity: 0.6;
}

.ggd-star-icon--empty {
    color: #d0d0d0;
}

/* Criteria Ratings */

.ggd-review-criteria-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ggd-review-criteria {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #777777;
}

/* Review Title */

.ggd-review-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
}

/* Review Content */

.ggd-review-content {
    margin-bottom: 12px;
}

.ggd-review-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555555;
    white-space: pre-line;
}

/* ==========================================================================
   Review Photos
   ========================================================================== */

.ggd-review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ggd-review-photo-thumb {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ggd-review-photo-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ggd-review-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Vote Buttons
   ========================================================================== */

.ggd-review-actions {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.ggd-review-votes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ggd-review-helpful-label {
    font-size: 13px;
    color: #888888;
    margin-right: 4px;
}

.ggd-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #666666;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ggd-vote-btn:hover:not(.ggd-vote-disabled) {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}

.ggd-vote-btn.ggd-vote-disabled {
    opacity: 0.5;
    cursor: default;
}

.ggd-vote-icon {
    font-size: 14px;
    line-height: 1;
}

.ggd-vote-label {
    font-weight: 500;
}

.ggd-vote-count {
    color: #999999;
    font-size: 11px;
}

/* ==========================================================================
   Owner Response
   ========================================================================== */

.ggd-owner-response {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f1f8e9;
    border-left: 3px solid #8bc34a;
    border-radius: 0 6px 6px 0;
}

.ggd-owner-response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ggd-owner-response-header strong {
    font-size: 13px;
    color: #33691e;
}

.ggd-owner-response-date {
    font-size: 12px;
    color: #8c9e78;
}

.ggd-owner-response p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555555;
}

/* Owner Response Form */

.ggd-owner-response-form-wrap {
    margin-top: 12px;
}

.ggd-owner-respond-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #2e7d32;
    background: transparent;
    border: 1px solid #2e7d32;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ggd-owner-respond-btn:hover {
    background: #2e7d32;
    color: #ffffff;
}

.ggd-owner-response-form {
    margin-top: 8px;
}

.ggd-owner-response-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #333333;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    resize: vertical;
    min-height: 70px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.ggd-owner-response-textarea:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.ggd-owner-response-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ggd-owner-response-submit {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: #2e7d32;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ggd-owner-response-submit:hover {
    background: #256b29;
}

.ggd-owner-response-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ggd-owner-response-cancel {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666666;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ggd-owner-response-cancel:hover {
    background: #eeeeee;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .ggd-review-form-wrap {
        padding: 16px;
        margin: 20px 0;
    }

    .ggd-review-form-wrap h3 {
        font-size: 18px;
    }

    .ggd-star-rating .ggd-star {
        font-size: 32px;
    }

    .ggd-review-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .ggd-review-rating-overall {
        align-self: flex-start;
    }

    .ggd-reviews-summary {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .ggd-reviews-summary-overall {
        gap: 8px;
    }

    .ggd-reviews-avg-number {
        font-size: 28px;
    }

    .ggd-reviews-summary-criteria {
        gap: 10px;
    }

    .ggd-review-criteria-ratings {
        flex-direction: column;
        gap: 6px;
    }

    .ggd-review-photos {
        gap: 6px;
    }

    .ggd-review-photo-thumb {
        width: 64px;
        height: 64px;
    }

    .ggd-review-photo-item {
        width: 64px;
        height: 64px;
    }

    .ggd-review-votes {
        flex-wrap: wrap;
    }

    .ggd-owner-response-actions {
        flex-direction: column;
    }

    .ggd-reviews-sort {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ggd-reviews-sort-select {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .ggd-review-form-wrap {
        padding: 12px;
    }

    .ggd-review-submit-btn {
        width: 100%;
        text-align: center;
    }

    .ggd-reviews-header h3 {
        font-size: 18px;
    }

    .ggd-review-card {
        padding: 14px;
    }

    .ggd-star-rating .ggd-star {
        font-size: 36px;
        gap: 6px;
    }

    .ggd-review-photo-thumb {
        width: 56px;
        height: 56px;
    }

    .ggd-review-photo-item {
        width: 56px;
        height: 56px;
    }
}
