/* Main Containers */
.reviews-section {
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.review-form-wrapper {
    margin: 0;
    padding: 0;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}

.review-form-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}

.reviews-display-section {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto 0;
    padding: 0;
    box-sizing: border-box;
}

/* Headers */
.reviews-display-section h2,
.review-form-heading {
    font-size: 16px;
    color: #1E3F7A;
    margin: 0 0 16px 0;
    padding: 0 0 12px 0;
    font-weight: 700;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(65,105,168,0.15);
}

/* Form Elements */
.review-form {
    padding: 0;
    margin: 0;
}

.review-form textarea,
.review-form input[type='text'],
.review-form input[type='email'],
.review-form input[type='tel'] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-shadow: none;
    background-color: #fff;
    box-sizing: border-box;
}

.review-form textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group {
    margin-bottom: 20px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.form-group label {
    display: block;
    position: relative;
    left: 0;
    top: 0;
    font-weight: 400;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.2;
    text-align: left;
    width: auto;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.3s ease;
    margin: 0;
    box-sizing: border-box;
    height: auto;
    line-height: normal;
}

.form-control:focus {
    outline: none;
    border-color: #666;
    box-shadow: none;
}

/* Textarea specific */
.review-textarea {
    min-height: 120px;
    resize: vertical;
    margin-bottom: 0;
}

/* Character Counter */
.char-counter {
    font-size: 14px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    text-align: right;
}

/* Verification Text */
.verification-text {
    margin: 0 0 15px 0;
    text-align: left;
}

.verification-text p {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #333;
    font-weight: 700 !important;
    text-align: left;
}

/* Name Field Row (First Name & Surname) */
.name-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.name-field-col {
    display: flex;
    flex-direction: column;
}

.name-field-col label .field-required {
    color: #dc2626;
    margin-left: 2px;
}

@media screen and (max-width: 768px) {
    .name-field-row {
        grid-template-columns: 1fr;
    }
}

/* Location Select Row (Country, Suburb & State) */
.location-select-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.location-select-col {
    display: flex;
    flex-direction: column;
}

.location-select-col label .field-required {
    color: #dc2626;
    margin-left: 2px;
}

.location-select-col select.form-control,
.location-select-col input.form-control {
    width: 100%;
    padding: 0 10px;          /* horizontal only — vertical comes from height */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease;
    margin: 0;
    box-sizing: border-box;
    height: 42px;             /* explicit, matches across input + select */
    line-height: normal;
}

.location-select-col select.form-control { cursor: pointer; }

.location-select-col select.form-control:focus,
.location-select-col input.form-control:focus {
    outline: none;
    border-color: #666;
    box-shadow: none;
}

.location-select-col select.form-control:disabled,
.location-select-col input.form-control:disabled {
    background-color: #f9f9f9;
    color: #999;
    cursor: not-allowed;
}

@media screen and (max-width: 768px) {
    .location-select-row {
        grid-template-columns: 1fr;
    }
}

/* ── Native combobox (replaces Select2 for suburb / state) ───────────────── */
.rev-combo { position: relative; }

.rev-combo__input { margin-bottom: 0 !important; }

.rev-combo__list {
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.rev-combo__option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.rev-combo__option--active,
.rev-combo__option:hover {
    background: #1E3F7A;
    color: #fff;
}

.rev-combo__empty {
    padding: 8px 12px;
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* Review Policy */
.review-policy-container {
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
}

.review-policy {
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    background: #f9f9f9;
    padding: 15px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border: none;
}

.review-policy a {
    color: #230344;
    text-decoration: none;
}

.review-policy a:hover {
    text-decoration: underline;
}

/* Emoji Section */
.custom-emoji-grid {
    display: flex;
    gap: 15px;
    margin: 5px 0 15px;
    flex-wrap: nowrap;
    align-items: center;
}

.custom-emoji-btn {
    border: none;
    background: none;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.custom-emoji-btn:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.05);
}

.custom-emoji-btn.emoji-selected {
    transform: scale(1.1);
    background-color: rgba(0, 130, 200, 0.1);
    border: 2px solid #005689;
}

/* ── SVG Star System (replaces Font Awesome) ──────────────────────────────
   .rev-star is the inline <svg> referencing #rev-star from the sprite.
   .rev-star--filled / .rev-star--empty control fill colour.
   .rating-star-icon is the clickable wrapper (used in the form picker only).
   ─────────────────────────────────────────────────────────────────────── */

.rev-star {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    /* Fill drives the colour for both filled and empty states */
    fill: currentColor;
    display: inline-block;
    flex: 0 0 auto;
}

.rev-star--filled { color: #ffd700; }
.rev-star--empty  { color: #ddd; }

/* Container for inline groups of stars (per-card rating, form picker) */
.rev-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 18px; /* drives star size via 1em */
    line-height: 1;
    color: inherit;
}

/* ── Half-star overlay for the rating summary ──────────────────────────────
   Two layers: empty stars on the bottom, filled stars on top clipped to a
   percentage width. Width is set inline as style="width: 73%;" by PHP.
   ─────────────────────────────────────────────────────────────────────── */
.rev-stars--summary {
    position: relative;
    display: inline-block;
    font-size: 24px;
    line-height: 1;
}

.rev-stars__empty,
.rev-stars__filled {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}

.rev-stars__filled {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
    /* width is set inline */
}

/* Star rating form picker — clickable star buttons */
.custom-rating-stars {
    display: flex;
    gap: 8px;
    margin: 5px 0 15px;
    align-items: center;
}

.rating-star-icon {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #ddd; /* default empty colour */
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.rating-star-icon:focus {
    outline: 2px solid rgba(65,105,168,0.4);
    outline-offset: 2px;
    border-radius: 2px;
}

.rating-star-icon:hover { transform: scale(1.1); }

/* State drives colour via the inner <svg>'s fill (currentColor) */
.rating-star-icon.star-filled { color: #ffd700; }
.rating-star-icon.star-empty  { color: #ddd; }

/* reCAPTCHA Container */
.recaptcha-container {
    margin: 15px 0;
    width: 100%;
}

.g-recaptcha {
    transform-origin: left top;
    -webkit-transform-origin: left top;
}

/* Submit Button Container */
.submit-button-container {
    margin: 10px 0;
    width: 100%;
}

/* Submit Button */
.submit-review,
.review-form .submit-review {
    background: #230344;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: none;
    display: inline-block;
    text-transform: none;
    text-align: center;
    min-width: 200px;
}

.submit-review:hover,
.review-form .submit-review:hover {
    background: #3a0570;
}

.submit-review:disabled,
.review-form .submit-review:disabled {
    background: #6c757d;
    cursor: not-allowed;
    color: #fff;
    opacity: 1;
}

/* Inline spinner used inside the Submit button while loading */
.loading-spinner--inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 6px;
    animation: spin 1s linear infinite;
}

/* Review Cards */
.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.review-card {
    background: #fff;
    border-radius: 0;
    padding: 16px 5px;
    box-shadow: none;
    transition: none;
    border-bottom: 1px solid rgba(65,105,168,0.15);
}

.review-card:hover {
    transform: none;
    box-shadow: none;
}

.review-card:last-child {
    border-bottom: none;
}

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

.rating-date-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.star-rating-display {
    color: #ffd700;
    font-size: 18px;
    line-height: 1;
}

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

.review-emotion {
    font-size: 24px;
}

.review-content {
    color: #666666;
    line-height: 1.75;
    margin: 12px 0;
    font-size: 14px;
}

.reviewer-name {
    font-weight: 700;
    color: #1E3F7A;
    margin-top: 10px;
    font-size: 14px;
}

/* Rating Summary */
.rating-summary {
    background: transparent;
    padding: 0 0 16px 0;
    border-radius: 0;
    margin-bottom: 20px;
    box-shadow: none;
    text-align: left;
    border-bottom: 1px solid rgba(65,105,168,0.15);
}

.rating-summary p {
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
    line-height: 1.75;
}

.rating-score {
    font-weight: 700;
    color: #1E3F7A;
    font-size: 20px;
}

.rating-stars {
    margin-top: 10px;
    line-height: 1;
}

/* Review Response */
.review-response {
    margin-top: 16px;
    padding: 14px;
    background: #EBF0F8;
    border-radius: 8px;
    border-left: 3px solid #4169A8;
}

.response-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1E3F7A;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Generic SVG icon (response speech bubble) */
.rev-icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    flex: 0 0 auto;
    vertical-align: -0.125em;
}

.response-content {
    color: #666666;
    line-height: 1.75;
    font-size: 14px;
}

/* Pagination */
.reviews-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(65,105,168,0.15);
}

.rev-page-btn {
    background: #fff;
    border: 1px solid #c5d3e8;
    border-radius: 6px;
    color: #4169A8;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
    width: 110px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.rev-page-btn:hover:not(:disabled) {
    background: #EBF0F8;
    border-color: #4169A8;
}

.rev-page-btn:disabled {
    color: #b0b8c9;
    border-color: #e0e0e0;
    cursor: not-allowed;
    background: #f5f5f5;
}

.rev-page-info {
    font-size: 13px;
    color: #666666;
    white-space: nowrap;
}

.reviews-loading {
    text-align: center;
    padding: 20px;
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 0;
    margin-bottom: 20px;
    display: none;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #230344;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* No Reviews Message */
.no-reviews {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
    background: #fff;
    border-radius: 0;
    margin: 20px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .reviews-section {
        box-sizing: border-box !important;
    }

    .reviews-display-section {
        margin-top: 30px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .review-form-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .custom-emoji-grid {
        gap: 10px;
        flex-wrap: wrap;
    }

    .custom-emoji-btn {
        font-size: 18px;
        width: 36px;
        height: 36px;
    }

    .custom-rating-stars { gap: 5px; }

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

    .rev-stars { font-size: 16px; }
    .rev-stars--summary { font-size: 20px; }
}
