/* Review System Styles */
.review-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.review-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.review-form h3 {
    color: #005E44;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #005E44;
    box-shadow: 0 0 5px rgba(0,94,68,0.3);
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin: 10px 0;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 25px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s;
    margin-right: 5px;
}

.star-rating label:before {
    content: "★";
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffd700;
}

/* File Upload */
.file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 12px 20px;
    background: #005E44;
    color: white;
    border-radius: 5px;
    border: none;
    transition: background 0.3s;
}

.file-upload:hover {
    background: #004a36;
}

.file-upload input[type="file"] {
    position: absolute;
    left: -9999px;
}

/* CAPTCHA */
.captcha-container {
    background: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
}

.captcha-question {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.captcha-input {
    width: 80px;
    text-align: center;
    font-size: 16px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 3px;
}

/* Submit Button */
.btn-submit {
    background: #005E44;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #004a36;
}

/* Review Display */
.review-list {
    margin-top: 40px;
}

/* Multiple Images Display */
.review-images {
    margin-top: 15px;
}

.review-images .review-image {
    display: inline-block;
    margin: 3px;
    position: relative;
    transition: transform 0.3s ease;
}

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

.review-images img {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.review-images img:hover {
    border-color: #005E44;
    box-shadow: 0 4px 8px rgba(0,94,68,0.3);
}

/* Image Preview in Form */
#image-preview {
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#image-preview:empty::before {
    content: "รูปภาพที่เลือกจะแสดงที่นี่";
    color: #999;
    font-style: italic;
}

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

.review-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

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

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

.review-stars {
    color: #ffd700;
    font-size: 16px;
    margin: 5px 0;
}

.review-comment {
    color: #555;
    line-height: 1.6;
    margin: 15px 0;
}

.review-image {
    margin-top: 15px;
}

.review-image img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 5px;
}

/* Rating Summary */
.rating-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.average-rating {
    font-size: 48px;
    font-weight: bold;
    color: #005E44;
    margin-bottom: 10px;
}

.rating-stars {
    font-size: 24px;
    color: #ffd700;
    margin-bottom: 10px;
}

.total-reviews {
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .review-container {
        padding: 20px;
    }
    
    .review-form {
        padding: 20px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .star-rating {
        justify-content: center;
    }
    
    .average-rating {
        font-size: 36px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #005E44;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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