/* HoseJoy Reviews - Styles for review forms and display */

/* Review Form Styles */
.hosejoy-review-form-wrapper {
    max-width: 600px;
    margin: 20px 0;
}

.hosejoy-review-form .form-row {
    margin-bottom: 20px;
}

.hosejoy-review-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.hosejoy-review-form .required {
    color: #d32f2f;
}

.hosejoy-review-form input[type="text"],
.hosejoy-review-form input[type="email"],
.hosejoy-review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 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 .star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* Image Preview */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Submit Row */
.submit-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hosejoy-submit-review {
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.hosejoy-submit-review:hover {
    background: #555;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.active {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.form-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.form-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Reviews Display Styles */
.hosejoy-reviews-display {
    margin: 30px 0;
}

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

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

.reviewer-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.reviewer-info img {
    border-radius: 50%;
}

.reviewer-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reviewer-name {
    font-weight: 600;
    font-size: 16px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #4caf50;
    font-weight: 500;
}

.verified-badge::before {
    content: "✓";
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
}

.review-date {
    font-size: 13px;
    color: #666;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #ffc107;
    font-size: 18px;
}

.star.empty {
    color: #ddd;
}

.review-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

/* Review Images */
.review-images.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.review-images.slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.review-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.review-images.slider .review-image-item {
    flex: 0 0 150px;
    scroll-snap-align: start;
}

.review-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.review-image-item:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.hosejoy-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
}

.lightbox-content {
    position: relative;
    z-index: 10000;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .review-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .review-images.grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .hosejoy-review-form-wrapper {
        max-width: 100%;
    }
}