/* 
 * Review Plus - Main Stylesheet
 * This file contains all styles for the review system.
 * We are using a BEM-like methodology for clarity.
 */

/* ==========================================================================
   Review Summary
   ========================================================================== */
.review-summary.advanced {
    display: flex;
    margin-bottom: 30px;
    padding: 20px;
    gap: 80px;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}

.summary-left {
    width: 25%;
    text-align: center;
    padding-right: 20px;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.summary-left .average-rating {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}


.summary-left .total-reviews {
    font-size: 14px;
    color: #777;
    margin-top: 10px;
}

.summary-right {
    width: 65%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.rating-bar .star-label {
    margin-right: 20px;
    font-size: 13px;
    color: #555;
}

.rating-bar .bar-container {
    flex-grow: 1;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 20px;
}

.rating-bar .bar {
    height: 100%;
    background-color: #ffb900;
    transition: width 0.5s ease-in-out;
}

/* ==========================================================================
   Review Card Layout
   ========================================================================== */

.review-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px 10px 20px !important;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.comment-container {
    display: flex;
}

/* Column 1: Avatar */

.review-avatar .avatar {
    width: 40px !important;
    height: 40px !important;
}

/* Column 2: Main Content */
.review-content-wrapper {
    flex-grow: 1;
}

#reviews .commentlist li {

    border: 0.8px solid #e5e5e5 !important;
    overflow: unset !important;

}

.verified-badge {
    font-size: 12px;
    color: #12D585;
    border-radius: 4px;
}

.review-meta {

    display: flex;

}

.review-meta svg circle {

    fill: #12D585 !important;

}

.review-meta svg {

    width: 14px;
    float: left;
    margin-right: 5px;

}

.review-images a {
    margin-right: 1px;
}

.review-text p {
    margin: auto 0px;
    line-height: 1.6;
    color: #555;
}

/* ==========================================================================
   Global Styles (re-used in different components)
   ========================================================================== */

/* WooCommerce Star Rating */
.star-rating {
    overflow: hidden;
    position: relative;
    height: 1.25em;
    /* Adjusted for better alignment */
    line-height: 1.25;
    font-size: 1em;
    /* Can be adjusted */
    width: 5.4em;
    font-family: "star";
}

.star-rating::before {
    content: "sssss";
    color: #d3ced2;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
}

.star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
    /* Visually hide text */
}

.star-rating span::before {
    content: "SSSSS";
    top: 0;
    position: absolute;
    left: 0;
    color: #ffb900;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.comment-form-attachment {
    margin-bottom: 20px;
}

.comment-form-attachment label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.review-images {
    margin-top: 15px;
}

.review-images a {
    display: inline-block;
    vertical-align: bottom;
}

.review-images img {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

#reviews #commentform .form-submit button[type="submit"] {
    background-color: #a44 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    text-transform: uppercase !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}


.review-card {
    list-style-type: none;
}


ul.commentlist {
    margin-left: 0;
}

/* General Form Container Styling */
#commentform {
    /* Slightly wider for a more spacious feel */
    margin: 0px auto 0px;
    /* More vertical space, centered */
    padding: 40px;
    /* More internal padding */
    background-color: #ffffff;
    border-radius: 10px;
    /* A slightly deeper, but still soft shadow */
    font-family: 'Inter', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Prioritize 'Inter' for modern look, then Open Sans */
    color: #333;
    line-height: 1.7;
    /* Increased line height for better readability */
    border: 0.8px solid #e5e5e5 !important;
    /* Remove subtle border, rely on shadow for definition */
    box-sizing: border-box;
    /* Ensure padding doesn't increase width */
}

/* Form Title / Respond Section */
#respond {
    text-align: center;
    padding-top: unset !important;
}

#reply-title {
    font-size: 2.4em;
    /* Slightly larger, more dominant title */
    color: #2c3e50;
    margin-bottom: 20px;
    /* Slightly less space if the underline has its own margin */
    font-weight: 700;
    padding-bottom: 15px;
    position: relative;
    line-height: 1.25;
    /* Tighter line height for the title */
}

#reply-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    /* Slightly wider underline */
    height: 3px;
    background-color: var(--rp-brand-color, #762130);
    border-radius: 2px;
}

#reply-title small a {
    font-size: 0.5em;
    color: #95a5a6;
    text-decoration: none;
    margin-left: 10px;
}

#reply-title small a:hover {
    color: var(--rp-brand-color, #762130);;
}

/* Labels for inputs */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1.05em;
    text-align: left;
    padding-left: 5px;
    /* Slight padding to align with input visual */
}

label .required {
    color: #e74c3c;
    margin-left: 3px;
    font-weight: normal;
}

/* Textarea Styling */
textarea#comment {
    width: calc(100% - 28px);
    /* Account for more padding */
    padding: 14px;
    /* More vertical padding */
    margin-bottom: 15px;
    /* More space below textarea */
    border: 1px solid #e0e0e0;
    /* Softer border color */
    border-radius: 6px;
    /* More rounded input fields */
    font-size: 1em;
    color: #444;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    min-height: 150px;
    /* Taller textarea for more input */
    resize: vertical;
}

textarea#comment:focus {
    border-color: var(--rp-brand-color, #762130);;
    box-shadow: 0 0 12px rgba(118, 33, 48, 0.1);
    /* Softer, wider glow with CTA color */
    outline: none;
}


/* Rating Stars Styling */
.comment-form-rating {
    margin-bottom: 30px;
    /* Consistent spacing */
    padding: 0;
    /* Remove padding if any, let outer padding handle it */
    background: none;
    /* No background needed if main form has it */
    border: none;
    /* No border needed */
    display: flex;
    /* Use flex for alignment */
    flex-direction: column;
    /* Stack label and stars */
    align-items: flex-start;
    /* Align label to the left */
}

.comment-form-rating label {
    text-align: left;
    /* Ensure label is left-aligned */
    width: 100%;
    /* Take full width */
}

p.stars {
    display: flex !important;
    justify-content: flex-start !important;
    /* Align stars to the left */
    margin-top: 10px !important;
    width: 100% !important;
    /* Take full width */
}

p.stars a {
    color: #ccc;
    font-size: 2em;
    /* Slightly larger stars */
    margin: 0 3px;
    /* Slightly adjusted spacing between stars */
    text-decoration: none;
    transition: color 0.2s ease, transform 0.1s ease;
    /* Add transform for subtle click effect */
}

p.stars a:hover {
    transform: scale(1.05);
    /* Slightly enlarge on hover */
}

p.stars a.active,
p.stars a:hover,
p.stars a:hover~a {
    color: #f39c12;
    /* Golden color for selected/hovered stars */
}


/* File Upload Section */
.comment-form-attachment {
    margin-top: 20px;
    /* Space above attachment section */
    margin-bottom: 30px;
    /* Space below attachment section */
    text-align: center;
}

/* CRITICAL FIX: Hide the actual file input */
.comment-form-attachment input[type="file"] {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0.1px !important;
    height: 0.1px !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

/* Style the label for the file input as a custom button */
.comment-form-attachment label[for="review_images"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 6px;
    /* Consistent roundedness with other inputs */
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 600;
    border: 1px solid #e0e0e0;

}

.comment-form-attachment label[for="review_images"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Icon for the upload button */
.comment-form-attachment label[for="review_images"]::before {
    content: '⬆️';
    /* Unicode upload arrow */
    margin-right: 10px;
    font-size: 1.2em;
    line-height: 1;
}

/* Styling for the filename display area (new element to be added with JS) */
#selected-files-display {
    margin-top: 15px;
    /* Space below the upload button */
    font-size: 0.95em;
    color: #666;
    min-height: 20px;
    /* Ensure space even when empty */
    word-break: break-all;
    /* Break long file names */
}

#selected-files-display strong {
    color: #333;
}

#selected-files-display ul {
    list-style: none;
    /* Remove bullet points */
    padding: 0;
    margin: 10px 0 0 0;
    max-height: 100px;
    /* Limit height for many files */
    overflow-y: auto;
    /* Add scroll if too many files */
}

#selected-files-display li {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#selected-files-display .remove-file {
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s ease;
}

#selected-files-display .remove-file:hover {
    color: #c0392b;
}

.review-plus-file-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.review-plus-file-list .file-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #e5e7eb;
}

.review-plus-file-list li span {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-plus-file-list .remove-file {
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 15px;
    line-height: 1;
    text-decoration: none;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.review-plus-file-list .remove-file:hover {
    color: #dc2626;
}


/* Submit Button Styling (CTA) */
.form-submit {
    text-align: center;
    margin-top: 40px;
    /* More space above the submit button */
}

#submit {
    background-color: var(--rp-brand-color, #762130);
    color: white;
    padding: 12px 45px;
    font-size: 20px;
    width: 100%;
    border: none;
    border-radius: 6px;
    margin-top: 15px;
    cursor: pointer;

}

/* Responsive adjustments */

/* Elemntor mobile */
@media (max-width: 767px) {

    #commentform {
        margin: 20px auto;
        padding: 25px;
        border-radius: 10px;
    }

    #reply-title {
        font-size: 1.8em;
    }

    .summary-left .total-reviews {
        font-size: 12px;
    }

    .summary-left {

        border-bottom: 1px solid #e5e5e5;
        padding-bottom: 15px !important;
    }


    .comment-form-attachment label[for="review_images"],
    #submit {
        padding: 12px 20px;
        font-size: 1.05em;
    }

    .summary-left,
    .summary-right {
        width: 100% !important;
        max-width: 100%;
        margin: 0 !important;
        padding: 0;
        margin-bottom: 20px;
    }

    .review-summary.advanced {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 15px;
    }


    div.comment-container {
        flex-direction: column;
        gap: 15px;
    }


    .review-avatar {
        order: 1;
    }

    .review-overall-rating {
        order: 2;
    }


    .review-content-wrapper {
        order: 3;
    }


    .review-identity {
        display: flex;
        flex-direction: row-reverse;
        width: 100%;
        justify-content: flex-end;
        gap: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e5e5e5;
    }

    .verified-purchase {
        display: flex;
    }

    .author-verified {
        display: flex;
        flex-direction: column;
    }

    .review-content-wrapper {
        width: 100%;
    }


    .review-main-text {
        margin-top: 15px;
    }


    .review-avatar .avatar {
        width: 35px !important;
        height: 35px !important;
    }


    #reviews .commentlist li {
        padding: 15px !important;
    }


}

/* Elemnentor tablet and desktop */
@media (min-width: 768px) {

    .summary-left {
        border-right: 1px solid #e5e5e5;
    }

}

/* Shoptimizer desktop */
@media (min-width: 993px) {

    .comment-container {
        padding: 0px 20px 0px 0px;
        gap: 40px;
    }

    .summary-left .average-rating {
        font-size: 50px;
    }

    .review-content-wrapper {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
    }
    
    .review-main-text {
        height: 100%;
        display: flex;
        flex-direction: column;
        margin-top: 4px;
    }
    
    .review-text {
        height: 100%;
        display: flex;
        width: 90%;
    }

}



/* Add new styles for new template */

.review-overall-rating {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

label[for=review_images] {
    text-align: center;
}


@media (min-width: 768px) {

    .review-identity {
        width: 16%;
        display: flex;
        flex-shrink: 0;
        position: relative;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-right: 1px solid #e5e5e5;
    }

    .verified-purchase {
        display: flex;
    }

    .review-author {
        font-weight: 600;
        font-size: 15px;
        color: #333;
        margin: 4px 0px 4px;
        display: block;
        word-break: break-all;
        text-align: center;
    }

    .author-verified {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

}