/* topbazaar-reviews/assets/css/frontend.css */

/* --- General Review Container --- */
.topbazaar-reviews-summary,
.topbazaar-review-form-wrapper,
.topbazaar-reviews-list {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* --- Average Rating Section (Main Display) --- */
.topbazaar-reviews-summary h2 {
    font-size: 1.9em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.average-rating-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.average-rating-display .rating-value {
    font-size: 2.8em;
    font-weight: bold;
    color: #28a745;
}

/* --- Star Styling (Applies to all stars across the plugin) --- */
.star {
    display: inline-block;
    color: #ccc;
    font-size: 2em;
    line-height: 1;
}

.star.filled {
    color: #ffc107;
}

.star.half {
    position: relative;
    overflow: hidden;
    width: 0.6em;
    display: inline-block;
    color: #ffc107;
}
.star.half::before {
    content: '\2605';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    overflow: hidden;
    color: #ffc107;
}
.star.half + .empty {
    margin-left: -0.4em;
}

/* Specific star sizes */
.star.star-lg { font-size: 2.5em; }
.star.star-sm { font-size: 1.2em; }


.star-rating-overall {
    /* Styles specific to the overall rating stars container */
}

.average-rating-display .total-reviews-count {
    font-size: 1.1em;
    color: #777;
    margin-left: 10px;
}

.topbazaar-add-review-btn {
    display: block;
    width: fit-content;
    margin: 0 auto;
    padding: 14px 30px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.15em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.topbazaar-add-review-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- Review Form --- */
.topbazaar-review-form-wrapper {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.topbazaar-review-form h3 {
    font-size: 1.6em;
    margin-bottom: 25px;
    color: #343a40;
    text-align: center;
    font-weight: 600;
}

.topbazaar-login-message {
    background-color: #ffe0b2;
    border: 1px solid #ffab40;
    color: #e65100;
    padding: 18px;
    border-radius: 5px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 20px;
}
.topbazaar-login-message a {
    color: #e65100;
    font-weight: bold;
    text-decoration: underline;
}
.topbazaar-login-message a:hover {
    color: #bf360c;
}

.topbazaar-review-form p {
    margin-bottom: 18px;
}

.topbazaar-review-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1em;
}
.topbazaar-review-form label .required {
    color: #dc3545;
    margin-left: 5px;
}

.topbazaar-review-form input[type="text"],
.topbazaar-review-form input[type="email"],
.topbazaar-review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topbazaar-review-form input[type="text"]:focus,
.topbazaar-review-form input[type="email"]:focus,
.topbazaar-review-form textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.topbazaar-review-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Rating Categories (Multi-dimensional) */
.rating-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #e9ecef;
    border-radius: 8px;
    border: 1px dashed #adb5bd;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}

.rating-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.rating-item label {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #495057;
    font-weight: bold;
}

.rating-item .stars {
    display: flex;
    gap: 2px;
}
.rating-item .stars .star {
    font-size: 2em;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
    line-height: 1;
}
.rating-item .stars .star:hover {
    transform: scale(1.1);
}
.rating-item .stars .star.selected {
    color: #ffc107;
}

/* File Upload Area */
.file-upload-area {
    border: 2px dashed #a2d2ff;
    background-color: #e0f2f7;
    padding: 25px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 25px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.file-upload-area.dragover {
    background-color: #d1ecf1;
    border-color: #007bff;
}
.file-upload-area.uploading {
    background-color: #e9f0f3;
    border-color: #6c757d;
}

.file-upload-area p {
    color: #555;
    margin-bottom: 15px;
    font-size: 1em;
}
.file-upload-trigger {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease;
}
.file-upload-trigger:hover {
    text-decoration: underline;
    color: #0056b3;
}

.file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    justify-content: center;
}
.file-preview-area .file-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.file-preview-area .file-preview-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}
.file-preview-area .file-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(220, 53, 69, 0.8);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 1em;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}
.file-preview-area .file-preview-item .remove-file:hover {
    background-color: #dc3545;
}

.form-submit button {
    padding: 14px 35px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.15em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: block;
    width: fit-content;
    margin: 0 auto;
}
.form-submit button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.topbazaar-message {
    padding: 18px;
    border-radius: 5px;
    margin-top: 25px;
    font-weight: 500;
    text-align: center;
    font-size: 1.05em;
    display: none;
}
.topbazaar-message.success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}
.topbazaar-message.error {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

/* --- Reviews List --- */
.topbazaar-reviews-list h3 {
    font-size: 1.6em;
    margin-bottom: 25px;
    color: #343a40;
    text-align: center;
    font-weight: 600;
}

.topbazaar-review-comments {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topbazaar-review-item {
    background-color: #fdfdfd;
    border: 1px solid #efefef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.topbazaar-review-item.topbazaar-reply-item {
    margin-left: 40px;
    border-left: 5px solid #a0d6b4;
    background-color: #f6fdf8;
    padding-left: 25px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reviewer-name {
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
}
.reviewer-name .admin-label {
    background-color: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
    vertical-align: middle;
}

.review-date {
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
}

.review-ratings {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #e9ecef;
    flex-wrap: wrap;
}

.rating-overall-display {
    text-align: center;
    flex-shrink: 0;
}
.rating-overall-display .rating-value {
    font-size: 1.6em;
    font-weight: bold;
    color: #28a745;
    display: block;
    margin-bottom: 5px;
}
.star-rating-individual .star {
    font-size: 1.4em;
}

.review-ratings ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}
.review-ratings ul li {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-content p {
    line-height: 1.7;
    color: #444;
    margin-bottom: 18px;
}

.review-files {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}
.review-files img.review-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.review-files img.review-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.review-actions {
    text-align: right;
    margin-top: 15px;
}
.topbazaar-reply-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
.topbazaar-reply-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.topbazaar-review-replies {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

/* --- Shortcode Specific Styles (for topbazaar_average_rating and topbazaar_reviews_count) --- */
.topbazaar-avg-rating-shortcode,
.topbazaar-reviews-count-shortcode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1em;
    color: #333;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fdfdfd;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.topbazaar-avg-rating-shortcode .rating-label {
    font-weight: 600;
    color: #555;
}

.topbazaar-avg-rating-shortcode .rating-value,
.topbazaar-reviews-count-shortcode .count-value {
    font-weight: bold;
    color: #28a745;
    font-size: 1.3em;
}

.star-rating-shortcode .star {
    font-size: 1.5em;
    color: #ccc;
    line-height: 1;
}
.star-rating-shortcode .star.filled {
    color: #ffc107;
}
.star-rating-shortcode .star.half {
    position: relative;
    overflow: hidden;
    width: 0.6em;
    display: inline-block;
    color: #ffc107;
}
.star-rating-shortcode .star.half::before {
    content: '\2605';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    overflow: hidden;
    color: #ffc107;
}


.topbazaar-avg-rating-shortcode .total-reviews-count-shortcode {
    font-size: 0.95em;
    color: #888;
    margin-left: 5px;
}

.topbazaar-no-post-id {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
}