/**
 * Public Styles for WooCommerce Review Addon
 */

/* Star Rating Display */
.wc-review-addon-star-rating {
    margin: 5px 0;
}

.star-rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-rating-display .stars {
    color: #ffa500;
    font-size: 20px;
    letter-spacing: 2px;
}

.star-rating-display .star.full {
    color: #ffa500;
}

.star-rating-display .star.half {
    color: #ffa500;
    opacity: 0.6;
}

.star-rating-display .star.empty {
    color: #ddd;
}

.rating-text {
    color: #666;
    font-size: 14px;
}

/* Reviews Section */
.wc-review-addon-reviews-section {
    margin: 30px 0;
}

.reviews-list h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.reviews-container {
    margin-bottom: 30px;
}

.reviews-container .review-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
}

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

.reviews-container .reviewer-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.reviews-container .review-rating {
    color: #ffa500;
    font-size: 18px;
}

.reviews-container .review-date {
    color: #999;
    font-size: 13px;
    margin-left: auto;
}

.reviews-container .review-text {
    line-height: 1.6;
    color: #555;
}

.no-reviews {
    color: #999;
    font-style: italic;
}

/* Add Review Button */
.add-review-button-container {
    margin: 20px 0;
}

.add-review-button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
}

.add-review-button:hover {
    background: #005a87;
}

/* Review Modal */
.wc-review-public-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.wc-review-public-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 5px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.wc-review-public-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 15px;
    right: 20px;
}

.wc-review-public-modal-close:hover,
.wc-review-public-modal-close:focus {
    color: #000;
}

.wc-review-public-modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    padding-right: 40px;
}

/* Review Form (in Modal) */
.wc-review-addon-form .form-row {
    margin-bottom: 20px;
}

.wc-review-addon-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.wc-review-addon-form input[type='text'],
.wc-review-addon-form input[type='email'],
.wc-review-addon-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.wc-review-addon-form textarea {
    resize: vertical;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.star-rating-input input[type='radio'] {
    display: none;
}

.star-rating-input label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
    margin: 0;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input[type='radio']:checked ~ label {
    color: #ffa500;
}

/* Form Buttons */
.submit-review-button,
.cancel-review-button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-review-button {
    background: #46b450;
    color: #fff;
}

.submit-review-button:hover {
    background: #3a9640;
}

.cancel-review-button {
    background: #ddd;
    color: #333;
    margin-left: 10px;
}

.cancel-review-button:hover {
    background: #ccc;
}

/* Form Messages */
.form-message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 3px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Loading State */
.wc-review-addon-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .reviews-container .review-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reviews-container .review-date {
        margin-left: 0;
    }

    .star-rating-display {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .rating-text {
        white-space: nowrap;
    }

    /* Modal responsive adjustments */
    .wc-review-public-modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }

    .wc-review-public-modal-close {
        font-size: 28px;
        top: 10px;
        right: 15px;
    }

    .wc-review-public-modal h3 {
        padding-right: 35px;
        font-size: 20px;
    }
}
