/* User Feedback and Review System Styles */

/* Star Rating Component */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

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

.star-rating .star.active,
.star-rating .star.hover {
    color: #ffd700;
}

.star-rating.readonly .star {
    cursor: default;
}

.star-rating .rating-text {
    margin-left: 8px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Star Rating Sizes */
.star-rating-small .star {
    font-size: 16px;
}

.star-rating-small .rating-text {
    font-size: 12px;
}

.star-rating-medium .star {
    font-size: 20px;
}

.star-rating-large .star {
    font-size: 24px;
}

.star-rating-large .rating-text {
    font-size: 16px;
}

/* Review Section */
.review-section {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.review-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.btn-write-review {
    background: #8B4513;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-write-review:hover {
    background: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* Review Summary */
.review-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.average-rating {
    text-align: center;
}

.rating-number {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.rating-count {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.rating-bar .stars {
    width: 40px;
    color: #ffd700;
    font-weight: 500;
}

.rating-bar .bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar .fill {
    height: 100%;
    background: #ffd700;
    transition: width 0.3s ease;
}

.rating-bar .count {
    width: 30px;
    text-align: right;
    color: #666;
}

/* Review Filters */
.review-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #8B4513;
    color: #8B4513;
}

.filter-btn.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

/* Review Items */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.review-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #8B4513;
}

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

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

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

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

.review-content {
    margin-bottom: 15px;
}

.review-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.review-text {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

.recommend-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 8px;
    background: #28a745;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.review-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-helpful,
.btn-report {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-helpful:hover {
    background: #f8f9fa;
    border-color: #28a745;
    color: #28a745;
}

.btn-report:hover {
    background: #f8f9fa;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-helpful:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    padding: 12px 30px;
    background: #f8f9fa;
    border: 2px solid #8B4513;
    color: #8B4513;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-load-more:hover {
    background: #8B4513;
    color: white;
}

/* Review Modal */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

/* Review Form */
.review-form {
    padding: 30px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #8B4513;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel,
.btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #ddd;
}

.btn-cancel:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-submit {
    background: #8B4513;
    color: white;
}

.btn-submit:hover {
    background: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* Feedback Widget */
.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.feedback-trigger {
    background: #8B4513;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-trigger:hover {
    background: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.4);
}

.feedback-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-feedback {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-feedback:hover {
    background: #f0f0f0;
    color: #333;
}

.feedback-form {
    padding: 20px;
}

.feedback-type,
.feedback-message,
.feedback-contact {
    margin-bottom: 15px;
}

.feedback-type label,
.feedback-message label,
.feedback-contact label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.feedback-type select,
.feedback-message textarea,
.feedback-contact input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.feedback-type select:focus,
.feedback-message textarea:focus,
.feedback-contact input:focus {
    outline: none;
    border-color: #8B4513;
}

.feedback-contact small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.feedback-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.feedback-actions .btn-cancel,
.feedback-actions .btn-submit {
    padding: 8px 16px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .review-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .review-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .review-summary {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .review-filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .review-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .feedback-panel {
        width: 300px;
        right: -10px;
    }
    
    .feedback-widget {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .review-section {
        padding: 15px;
    }
    
    .review-header h3 {
        font-size: 20px;
    }
    
    .rating-number {
        font-size: 36px;
    }
    
    .review-item {
        padding: 15px;
    }
    
    .review-item .review-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .review-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .feedback-panel {
        width: calc(100vw - 30px);
        right: -5px;
    }
    
    .feedback-trigger {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Animation for new reviews */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-item.new {
    animation: slideInUp 0.5s ease;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility improvements */
.star-rating .star:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

.btn-write-review:focus,
.filter-btn:focus,
.btn-helpful:focus,
.btn-report:focus,
.btn-load-more:focus,
.feedback-trigger:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .review-item {
        border-width: 2px;
    }
    
    .star-rating .star.active {
        color: #ff8c00;
    }
    
    .btn-write-review,
    .btn-submit,
    .feedback-trigger {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .star-rating .star,
    .btn-write-review,
    .filter-btn,
    .review-item,
    .feedback-trigger,
    .feedback-panel {
        transition: none;
    }
    
    .review-item.new {
        animation: none;
    }
}

/* Print styles */
@media print {
    .feedback-widget,
    .btn-write-review,
    .review-filters,
    .review-actions,
    .load-more-container {
        display: none;
    }
    
    .review-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .review-item {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
}