/* Base & Shared Styles */
.crp-star {
    width: 18px;
    height: 17px;
    display: inline-block;
    background: url("../content/images/StarOutlineVector.svg") no-repeat center/contain;
    margin: 0 1px;
}
.crp-star.full { background-image: url("../content/images/StarVector.svg"); }

.crp-loading-placeholder,
.crp-no-reviews-message,
.crp-error-message {
    text-align: center;
    padding: 40px 20px;
    font: italic 1.1em sans-serif;
    color: #777;
}
.crp-error-message {
    color: #dc3545;
    font-weight: bold;
}

@keyframes crp-spin {
    to { transform: rotate(360deg); }
}

.crp-loading-placeholder::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: crp-spin 1s linear infinite;
    vertical-align: middle;
}

/* Review Summary */
.crp-review-summary {
    display: inline-flex;
    align-items: center;
    font: 500 15px sans-serif;
    color: #444;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 5px 0;
}
.crp-summary-stars {
    margin-right: 8px;
}
.crp-summary-text {
    color: #555;
    white-space: nowrap;
}
.crp-summary-no-reviews {
    color: #777;
    font-style: italic;
}

/* Detailed AJAX Reviews */
.course-reviews-container {
    width: 100%;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e2e7ed;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.course-reviews-container.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}
.course-reviews-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: crp-spin 1s linear infinite;
    z-index: 11;
}

.reviews-analytics-section {
    padding: 24px 30px 12px;
    border-bottom: 1px solid #e2e7ed;
    background: #f8f9fa;
}
.reviews-list-section {
    padding: 20px 30px;
}

.reviews-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}
.reviews-header h2 {
    font: 600 24px sans-serif;
    margin: 0;
    color: #333;
}
.reviews-header .rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 600 18px sans-serif;
    color: #333;
}
.reviews-header .average-rating {
    font: 700 20px sans-serif;
}
.reviews-header .star {
    color: #ffb900;
    font-size: 24px;
    line-height: 1;
}
.reviews-header .total-reviews {
    font: normal 15px sans-serif;
    color: #555;
    margin-left: 4px;
}

.rating-filters {
    margin-bottom: 10px;
}
.rating-bar-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
    padding: 4px 0;
}
.rating-bar-container:hover {
    background: #e2e7ed;
}
.rating-bar-container label {
    display: contents;
    cursor: pointer;
}

.rating-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    accent-color: #007bff;
    margin-right: 5px;
    flex-shrink: 0;
}

.rating-label-text {
    min-width: 50px;
    font: 500 14px sans-serif;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
}

.rating-bar {
    flex-grow: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}
.rating-bar-fill {
    height: 100%;
    background: #6c757d;
    border-radius: 5px;
    transition: width 0.4s;
}

.rating-percentage {
    min-width: 45px;
    text-align: right;
    color: #444;
    font: 500 14px sans-serif;
    flex-shrink: 0;
}

.reviews-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e7ed;
}
.reviews-controls label {
    font: 600 14px sans-serif;
    margin-right: 8px;
    color: #555;
}
.reviews-controls select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.review-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.review-card:last-child {
    margin-bottom: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 15px;
}

.reviewer-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    background: #e5f7f3;
    border: 1px solid #ccece6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 16px sans-serif;
    color: #00a67e;
    flex-shrink: 0;
}

.reviewer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.reviewer-name {
    font: 600 16px sans-serif;
    color: #222;
}
.review-date {
    color: #777;
    font-size: 13px;
}

.review-rating {
    text-align: right;
}
.review-rating .crp-star {
    font-size: 18px;
}

.verified-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #58667E;
    font: 500 11px sans-serif;
    margin-top: 4px;
    justify-content: flex-end;
}
.verified-badge .dashicons {
    font-size: 16px;
    color: #00b67a;
}

.review-content {
    color: #333;
    font: 15px/1.7 sans-serif;
    margin-top: 12px;
}
.review-content p {
    margin: 0 0 12px;
}
.review-content p:last-child {
    margin-bottom: 0;
}

.rating-only-review {
    color: #555;
    font: italic 14px sans-serif;
    margin-top: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 30px 0 10px;
    flex-wrap: wrap;
}

.page-button, .dots {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #007bff !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font: 500 14px/1.4 sans-serif;
    min-width: 36px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.dots {
    border: none;
    background: none;
    cursor: default;
    box-shadow: none;
    padding: 6px 4px;
    color: #6c757d;
}

.page-button:hover:not(.active):not(.disabled),
.page-button:focus:not(.active):not(.disabled) {
    background: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-1px);
    outline: none;
}

.page-button.active {
    background: #007bff;
    border-color: #007bff;
    color: white !important;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0,123,255,0.2);
}
.page-button.disabled {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #adb5bd !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* Simple Reviews */
.simple-reviews-container {
    width: 100%;
    margin: 20px 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fff;
    position: relative;
    border: 1px solid #e3e3e3;
    overflow: hidden;
}

.simple-reviews-container.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 1;
}
.simple-reviews-container.loading::before {
    content: '';
    position: absolute;
    top: calc(50% - 12px);
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: crp-spin 1s linear infinite;
    z-index: 2;
}

.simple-reviews-header {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e3e3e3;
}
.header-content {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.trusted-reviews-logo {
    height: 2rem;
    width: auto;
    flex-shrink: 0;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    color: #000;
    flex-wrap: wrap;
}

.crp-rating-details-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rating-stars {
    display: flex;
    gap: 2px;
    line-height: 1;
    margin-right: 5px;
}
.rating-stars .star-box {
    font-size: 20px;
    color: #ddd;
    background: linear-gradient(180deg, #FFD700 0%, #FDB931 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.5;
}
.rating-stars .star-box.filled {
    opacity: 1;
}

.rating-number {
    font: 700 18px sans-serif;
}
.rating-number::after {
    content: ',';
    margin-right: 4px;
}
.rating-separator, .rating-scale {
    color: #000;
    font-weight: 500;
}
.reviews-separator {
    color: #aaa;
}
.reviews-count {
    font-weight: 600;
}
.reviews-label {
    color: #000;
    font-size: 18px;
    text-transform: capitalize;
}

.simple-reviews-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}
.simple-reviews-list::-webkit-scrollbar { width: 6px; }
.simple-reviews-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.simple-reviews-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.simple-reviews-list::-webkit-scrollbar-thumb:hover { background: #aaa; }

.simple-review-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: transparent;
    transition: background 0.2s;
}
.simple-review-item:last-child {
    border-bottom: none;
}
.simple-review-item:hover {
    background: #fdfdfd;
}
.simple-review-item.no-reviews {
    text-align: center;
    font-style: italic;
    color: #777;
    padding: 30px 20px;
}

.simple-review-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 6px;
}
.simple-review-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.simple-review-author {
    font: 600 15px sans-serif;
    color: #333;
}

.simple-review-rating {
    font-size: 16px;
    line-height: 1;
}
.simple-review-rating .crp-star {
    font-size: inherit;
    margin: 0;
    color: #FFB900;
}
.simple-review-rating .crp-star.empty {
    color: #ddd;
}

.simple-review-text {
    color: #444;
    margin-bottom: 12px;
    line-height: 1.5;
    font: normal 15px sans-serif;
}
.simple-review-text p {
    margin: 0 0 10px;
}
.simple-review-text p:last-child {
    margin-bottom: 0;
}

.simple-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.simple-review-date {
    color: #777;
    font-size: 13px;
}

.simple-review-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #555;
    font: 500 12px sans-serif;
}
.simple-review-verified svg {
    flex-shrink: 0;
}

.view-more-button {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    border-top: 1px solid #eee;
    color: #007bff;
    font: 600 14px sans-serif;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    display: block;
}
.view-more-button:hover {
    background: #e9ecef;
}
.view-more-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.view-more-loader {
    display: none;
    font-style: italic;
}
.view-more-button.loading .view-more-text {
    display: none;
}
.view-more-button.loading .view-more-loader {
    display: inline;
}

.simple-reviews-header p:empty {
    display: none;
}

@media (max-width: 767px) {
    .crp-rating-details-group {
        flex-basis: 100%;
    }
}