/* Review Option Styles - Enhanced specificity to override conflicts */
.review-rating-form .rate-item-inputs .review-option-item {
    display: inline-block !important;
    margin-right: 20px;
    margin-bottom: 10px;
    vertical-align: top;
    float: none !important;
}

/* Flexbox approach to align text beneath icons */
.review-rating-form .rate-item-inputs .review-option-label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 12px !important;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 120px;
    border: 2px solid transparent;
    background-color: #f8f9fa;
    position: relative;
    float: none !important;
    clear: both;
}

.review-rating-form .rate-item-inputs .review-option-label:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.review-rating-form .rate-item-inputs .review-option-label i {
    font-size: 18px !important;
    margin: 0 !important;
    width: 20px !important;
    text-align: center !important;
    display: block !important;
    line-height: 1 !important;
    float: none !important;
    position: static !important;
}

.review-rating-form .rate-item-inputs .review-option-label span {
    font-size: 14px !important;
    font-weight: 500;
    white-space: nowrap;
    display: block !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
    text-align: center !important;
}

/* Specific styles for the exact classes used in HTML */
.review-rating-form .rate-item-inputs .review-option-icon {
    width: 50px !important;
    height: 50px !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: #fff !important;
    font-weight: 600 !important;
    border: 1px solid rgba(0,0,0,0.21) !important;
    text-shadow: 0px 2px 5px rgba(0,0,0,0.21) !important;
    flex-shrink: 0 !important;
    margin: 0 auto !important;
    float: none !important;
    position: static !important;
}

.review-rating-form .rate-item-inputs .review-option-icon i {
    color: #fff !important;
    font-size: 20px !important;
    margin: 0 !important;
    width: auto !important;
    text-align: center !important;
    display: inline !important;
    line-height: 1 !important;
    float: none !important;
    position: static !important;
}

.review-rating-form .rate-item-inputs .review-option-text {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    margin: 0 !important;
    width: 100% !important;
    white-space: normal !important;
    display: block !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
}

/* Color variants for different review option types */
.review-option-good-deals .review-option-icon {
    background: #6c8e6c !important;
    border-color: rgba(108, 142, 108, 0.3) !important;
}

.review-option-bad-deals .review-option-icon {
    background: #d4842d !important;
    border-color: rgba(212, 132, 45, 0.3) !important;
}

.review-option-no-sale .review-option-icon {
    background: #c44436 !important;
    border-color: rgba(196, 68, 54, 0.3) !important;
}

/* Selected state styling */
input[name="review_type"]:checked + .review-option-label {
    border-color: #3D4E94 !important;
    background: #f8f9ff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(61, 78, 148, 0.2) !important;
}

input[name="review_type"]:checked + .review-option-good-deals .review-option-icon {
    background: #5a7a5a !important;
    box-shadow: 0 2px 8px rgba(108, 142, 108, 0.3) !important;
}

input[name="review_type"]:checked + .review-option-bad-deals .review-option-icon {
    background: #c17325 !important;
    box-shadow: 0 2px 8px rgba(212, 132, 45, 0.3) !important;
}

input[name="review_type"]:checked + .review-option-no-sale .review-option-icon {
    background: #b03c2e !important;
    box-shadow: 0 2px 8px rgba(196, 68, 54, 0.3) !important;
}

.review-rating-form .rate-item-inputs .review-option-item input[type="radio"] {
    display: none !important;
}

/* This style is now handled above with more specific selectors */

/* Container for review options - Enhanced specificity and centered */
.review-rating-form .rate-item-inputs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: flex-start;
    clear: both;
    justify-content: center !important;
}

/* Fix the rate item title visibility */
.review-rating-form .rate-item-title {
    color: #566985 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    display: block !important;
}

/* Force clear any floats that might interfere */
.review-rating-form .rate-item-inputs::before,
.review-rating-form .rate-item-inputs::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive design for smaller screens - Keep buttons horizontal */
@media (max-width: 768px) {
    .review-rating-form .rate-item-inputs {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    
    .review-rating-form .rate-item-inputs .review-option-item {
        flex: 1 1 0 !important;
        margin-right: 0;
        width: auto !important;
        min-width: 0 !important;
    }
    
    .review-rating-form .rate-item-inputs .review-option-label {
        width: 100% !important;
        padding: 12px 8px !important;
        gap: 8px !important;
    }
    
    .review-rating-form .rate-item-inputs .review-option-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .review-rating-form .rate-item-inputs .review-option-icon i {
        font-size: 16px !important;
    }
    
    .review-rating-form .rate-item-inputs .review-option-text {
        font-size: 12px !important;
    }
}

.good-deals i {
    color: #5ECFB1;
}

.bad-deals i {
    color: #F75C96;
}

.no-sale i {
    color: #F9B90F;
}

/* Review Score Styles */
.review-score-total-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.review-score-total-icons i {
    margin: 0 5px;
    font-size: 18px;
}

.review-score-total-icons .fa-thumbs-up {
    color: #5ECFB1;
}

.review-score-total-icons .fa-thumbs-down {
    color: #F75C96;
}

.review-score-total-icons .fa-times {
    color: #F9B90F;
}

.review-score-total-icons span {
    margin-right: 15px;
    font-weight: bold;
}

/* Gallery Item Details Styles */
.gallery-item-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.box-item:hover .gallery-item-details {
    opacity: 1;
}

.gallery-item-user, .gallery-item-date {
    display: block;
    margin-bottom: 3px;
}

.gallery-item-user i, .gallery-item-date i {
    margin-right: 5px;
}

/* Review Image Upload Styles */
.review-image-upload {
    border: 2px dashed #e5e7f2;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    margin-top: 20px;
    text-align: center;
    position: relative;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    min-height: 80px;
    clear: both;
    overflow: hidden;
}

.review-image-upload:hover {
    border-color: #35a2e8;
}

.review-image-input {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.image-upload-hint {
    color: #878c9f;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.image-upload-hint::before {
    content: '\f030';
    font-family: 'Font Awesome 5 Pro', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 24px;
    color: #878c9f;
    opacity: 0.7;
}

/* Mobile responsive styles for image upload */
@media (max-width: 768px) {
    .review-image-upload {
        padding: 10px;
        min-height: 60px;
        margin-bottom: 15px;
    }
    
    .image-upload-hint {
        padding: 12px 8px;
        font-size: 12px;
        gap: 5px;
    }
    
    .image-upload-hint::before {
        font-size: 20px;
    }
    
    /* Fix textarea margin that causes overlap on mobile */
    .custom-form textarea {
        margin-bottom: 20px !important;
        position: relative !important;
        z-index: 1 !important;
        clear: both !important;
    }
    
    /* Ensure proper spacing between form elements on mobile */
    .custom-form .row {
        margin-bottom: 15px;
        clear: both;
    }
    
    /* Force image upload section to display properly on mobile */
    .review-image-upload {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        position: relative !important;
        display: block !important;
        clear: both !important;
        min-height: 60px !important;
    }
    
    /* Prevent any absolute positioning issues on mobile */
    .review-image-upload .review-image-input {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        z-index: 1;
    }
}

.upload-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-image-item {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

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

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #F75C96;
    font-size: 12px;
}

/* Review Like Styles */
.reviews-comments-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Old review like styles removed - now using .rate-review class */

/* Animation for like action */
@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.like-animation {
    animation: heartPulse 0.3s ease-in-out;
}

/* Responsive design - updated for new structure */
@media (max-width: 768px) {
    .reviews-comments-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Review Avatar Styles - using original absolute positioning */
.review-comments-avatar img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #f0f0f0 !important;
    float: left !important;
}

/* Fix reviews container width - ensure proper layout - Override style.css inline-table */
.list-single-main-item_content .reviews-comments-wrap,
.reviews-comments-wrap,
.list-single-main-item .reviews-comments-wrap,
#sec5 .reviews-comments-wrap {
    width: 100% !important;
    display: block !important;
    clear: both !important;
    margin-top: 20px !important;
    box-sizing: border-box !important;
    table-layout: auto !important; /* Override any table layout */
}

/* Ensure parent container also takes full width */
.list-single-main-item_content {
    width: 100% !important;
    display: block !important;
}

/* Work with original absolute positioning structure - don't override the positioning */
.reviews-comments-item {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
    /* Keep original positioning: relative positioning with left padding for avatar space */
    position: relative !important;
    padding: 0 0 20px 90px !important;
    float: left !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #eee !important;
}

.reviews-comments-item:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Keep original avatar positioning */
.review-comments-avatar {
    position: absolute !important;
    top: 0 !important;
    left: 10px !important;
    width: 60px !important;
    height: 60px !important;
}

/* Ensure text container takes full available width */
.reviews-comments-item-text {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Review Images in proper format - Override main style.css */
.reviews-comments-item .review-images {
    display: flex !important;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    width: 100% !important;
    clear: both !important;
}

.reviews-comments-item .review-images a {
    display: block !important;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    /* Override flex and max-width from style.css */
    flex: none !important;
    max-width: none !important;
    margin-right: 10px !important;
    float: none !important;
    position: static !important;
}

.reviews-comments-item .review-images a:hover {
    transform: scale(1.05);
}

/* More specific selector to override style.css */
.reviews-comments-item .review-images a img {
    width: 100px !important;
    height: 100px !important;
    object-fit: cover;
    border-radius: 8px;
    display: block !important;
    float: none !important;
}

/* Helpful Review Button Styles - Based on original template */
.rate-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-left: 15px;
}

.rate-review:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
}

.rate-review.liked {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.rate-review.liked:hover {
    background: #c3e6cb;
    border-color: #b8dabc;
}

.rate-review i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.rate-review.liked i {
    color: #28a745;
    transform: scale(1.1);
}

.rate-review .like-count {
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.rate-review.liked .like-count {
    background: #f8f9fa;
    color: #28a745;
}

/* Read-only helpful review styling */
.review-like-readonly {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    margin-left: 15px;
    cursor: default;
}

.review-like-readonly i {
    font-size: 14px;
}

.review-like-readonly .like-count {
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Mobile responsiveness - adapted for original absolute positioning */
@media (max-width: 768px) {
    .reviews-comments-item {
        padding: 0 0 20px 0 !important; /* Remove left padding on mobile */
        position: relative !important;
    }
    
    .review-comments-avatar {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        margin-bottom: 15px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .review-comments-avatar img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .reviews-comments-item-text {
        width: 100% !important;
    }
    
    .reviews-comments-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rate-review {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .review-images a img {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Hide "Helpful Review" text on mobile, keep only icon and count */
    .like-text {
        display: none;
    }
}

/* Additional responsive breakpoint for smaller screens */
@media (max-width: 480px) {
    .review-images {
        gap: 8px;
    }
    
    .review-images a {
        margin-right: 8px !important;
    }
    
    .review-images a img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* Avatar change link in hero */
.avatar-change-link {
    text-align: center;
    margin-top: 10px;
}

.change-avatar-link {
    display: inline-block;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.change-avatar-link:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-decoration: none;
}

.remove-avatar-link {
    display: inline-block;
    color: #fff;
    background: rgba(220, 53, 69, 0.7);
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 11px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.remove-avatar-link:hover {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.inline-avatar-form,
.inline-remove-form {
    display: inline-block;
}

/* Profile action links spacing and colors */
.profile-action-links {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-action-links .btn {
    width: auto;
    display: inline-block;
}

/* Custom muted red for delete button */
.profile-action-links .btn-danger {
    background-color: #c85450 !important;
    border-color: #c85450 !important;
}

.profile-action-links .btn-danger:hover {
    background-color: #b44440 !important;
    border-color: #b44440 !important;
}

/* Staff Review Styles */
.reviews-comments-item.staff-review {
    position: relative;
    border: 2px solid #ffd700;
    border-radius: 6px;
    padding: 30px 20px 20px;
}

.reviews-comments-item.staff-review .reviews-comments-item-text {
    background: #faf7e6;  /* More muted, cooler yellow background */
}

.staff-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffd700;
    color: #333;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

.staff-badge i {
    font-size: 14px;
}

/* Mobile Camera Options Styling */
.mobile-camera-options {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.camera-option-btn {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.camera-option-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.camera-option-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.camera-option-btn i {
    font-size: 18px;
}

/* Hide upload hint on mobile when camera options are shown */
.mobile-active .image-upload-hint {
    display: none;
}

/* Style the upload container for mobile */
.mobile-active .review-image-upload {
    background: transparent;
    border: none;
    padding: 0;
}

@media (max-width: 768px) {
    .camera-option-btn {
        padding: 18px 22px;
        font-size: 16px;
        border-radius: 14px;
    }
    
    .camera-option-btn i {
        font-size: 20px;
    }
}