/* Общие стили */
* {
    box-sizing: border-box;
    
}

body {
   
}

/* Контейнер формы */
.review-form-container {
    max-width: 600px;
    margin: 30px auto 10px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}


.review-form-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Группы полей формы */
.form-group {
    margin-bottom: 25px;
}

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

.required {
    color: #e74c3c;
}

/* Стили для текстовых полей */
input[type="text"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Звездный рейтинг */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 8px;
}

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

.star-rating .star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-right: 4px;
    user-select: none;
}

/* Эффект наведения на звезды */
.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: #ff9500;
}

/* Выбранные звезды */
.star-rating input[type="radio"]:checked ~ .star {
    color: #ff9500;
}

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

/* Контейнер загрузки фотографий */
.photo-upload-container {
    position: relative;
}

.photo-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.photo-upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.photo-upload-area:hover {
    border-color: #2980b9;
    background-color: #e3f2fd;
}

.photo-upload-area.dragover {
    border-color: #27ae60;
    background-color: #e8f5e8;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: 500;
}

.upload-limit {
    font-size: 12px;
    color: #666;
}

/* Превью фотографий */
.photo-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.photo-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e1e8ed;
}

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

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.photo-remove:hover {
    background: rgba(231, 76, 60, 1);
}

/* Кнопка отправки */
.submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    display: inline-block;
}

/* Сообщения */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
    text-align: center;
}

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

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



/********2 отзывы************/
.review-container {
    max-width: 670px;
    margin: 15px auto;
}

.review-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.reviewer-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.rating-date {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #ffc107;
    font-size: 16px;
    font-weight: bold;
}

.star.empty {
    color: #dee2e6;
}

.review-date {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

.review-text {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    text-align: justify;
}

/*********3 общий рейтинг *********/

.rating-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    width: 300px;
}

.average-rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

#average-score {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.stars-display {
    display: inline-block;
    position: relative;
    font-size: 1.5em;
    color: #ccc; /* Grey for empty stars */
    margin-right: 10px;
    white-space: nowrap;
    line-height: 1;
}

.stars-display::before {
    content: '★★★★★';
    color: #FFD700; /* Gold color for filled stars */
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--rating) / 5 * 100%);
    overflow: hidden;
    z-index: 1; /* Ensure filled stars are on top */
}

#total-reviews {
    font-size: 0.9em;
    color: #666;
}

.rate-section p {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
}

.interactive-stars .star {
    font-size: 2em;
    color: #ccc; /* Grey for empty stars */
    cursor: pointer;
    transition: color 0.2s;
}

.interactive-stars .star.hover, .interactive-stars .star.selected {
    color: #FFD700;
}



/* Адаптивность */
@media (max-width: 768px) {
    .review-form-container {
        margin: 10px;
        padding: 20px;
    }
    
    .review-form-container h2 {
        font-size: 24px;
    }
    
    .star-rating .star {
        font-size: 28px;
        margin-right: 2px;
    }
    
    .photo-preview {
        width: 80px;
        height: 80px;
    }
    
    .submit-btn {
        font-size: 16px;
        padding: 12px 24px;
    }
	
	/*******/
	  
    .review-card {
        padding: 16px;
    }
    
    .reviewer-name {
        font-size: 16px;
    }
    
    .rating-date {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .review-text {
        font-size: 14px;
    }

}

@media (max-width: 480px) {
    .photo-preview-container {
        justify-content: center;
    }
    
    .photo-preview {
        width: 70px;
        height: 70px;
    }
    
    .star-rating .star {
        font-size: 24px;
    }
}

