/* =========================================================================
   Clinic Reviews Section Styles
   Placed on single-place.php between FAQ and Nearby Clinics
   ========================================================================= */

:root {
    --eh-star-color: #f5a623;
    --eh-star-empty: #d1d5db;
    --eh-green: #00a67e;
    --eh-green-dark: #00875f;
    --eh-text: #1a1a2e;
    --eh-text-secondary: #6b7280;
    --eh-border: #e5e7eb;
    --eh-bg-light: #f9fafb;
    --eh-bg-card: #ffffff;
    --eh-radius: 12px;
}

/* ---- Section Container ---- */
.clinic-reviews-section {
    max-width: 1200px;
    margin: 56px auto 0;
    padding: 32px 2rem 0;
    position: relative;
}

.clinic-reviews-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2rem;
    width: 72px;
    height: 3px;
    background: #047727;
    border-radius: 2px;
}

.clinic-reviews-section h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: none !important;
}

.clinic-reviews-section .section-subtitle {
    color: var(--eh-text-secondary);
    font-size: 15px;
}

/* ---- Summary Block ---- */
.eh-review-summary {
    display: flex;
    align-items: stretch;
    gap: 24px;
    padding: 28px;
    background: var(--eh-bg-light);
    border-radius: var(--eh-radius);
    border: 1px solid var(--eh-border);
    margin-bottom: 32px;
}

.eh-summary-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding-right: 24px;
    border-right: 1px solid var(--eh-border);
}

.eh-summary-number {
    font-size: 48px;
    font-weight: 800;
    color: var(--eh-text);
    line-height: 1;
}

.eh-summary-stars-main {
    margin-top: 6px;
}

.eh-summary-count {
    font-size: 13px;
    color: var(--eh-text-secondary);
    margin-top: 4px;
}

.eh-summary-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.eh-summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.eh-summary-label {
    font-size: 13px;
    color: var(--eh-text-secondary);
    min-width: 80px;
    text-align: right;
}

.eh-summary-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    max-width: 200px;
}

.eh-summary-bar-fill {
    height: 100%;
    background: var(--eh-star-color);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.eh-summary-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--eh-text);
    min-width: 28px;
}

.eh-summary-imaging {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 24px;
    border-left: 1px solid var(--eh-border);
    min-width: 140px;
}

.eh-summary-imaging-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--eh-text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.eh-summary-imaging-item {
    font-size: 13px;
    color: var(--eh-text);
    padding: 2px 0;
}

/* ---- Stars (Shared) ---- */
.eh-stars {
    display: inline-flex;
    gap: 1px;
}

.eh-star {
    font-size: 16px;
    line-height: 1;
}

.eh-star-full {
    color: var(--eh-star-color);
}

.eh-star-half {
    color: var(--eh-star-color);
    position: relative;
    overflow: hidden;
}

.eh-star-empty {
    color: var(--eh-star-empty);
}

/* ---- Review Cards ---- */
.eh-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eh-review-card {
    background: var(--eh-bg-card);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius);
    padding: 24px;
    transition: box-shadow 0.2s ease;
}

.eh-review-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

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

.eh-review-rating-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eh-review-rating-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--eh-text);
}

.eh-review-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--eh-text-secondary);
}

.eh-review-meta-sep {
    color: var(--eh-border);
}

.eh-review-imaging-type {
    background: var(--eh-bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.eh-review-text {
    margin-bottom: 14px;
}

.eh-review-text p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--eh-text);
    margin: 0;
    font-style: italic;
}

.eh-review-sub-ratings {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.eh-sub-rating {
    font-size: 12px;
    color: var(--eh-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.eh-sub-rating .eh-stars {
    font-size: 12px;
}

.eh-sub-rating .eh-star {
    font-size: 12px;
}

.eh-review-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--eh-text-secondary);
    padding-top: 12px;
    border-top: 1px solid var(--eh-border);
}

.eh-reviewer-name {
    font-weight: 500;
}

/* ---- Load More ---- */
.eh-load-more-wrap {
    text-align: center;
    margin-top: 20px;
}

.eh-load-more-btn {
    background: none;
    border: 1px solid var(--eh-border);
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--eh-text);
    cursor: pointer;
    transition: all 0.2s;
}

.eh-load-more-btn:hover {
    background: var(--eh-bg-light);
    border-color: var(--eh-text-secondary);
}

/* ---- Empty State ---- */
.eh-reviews-empty {
    text-align: center;
    padding: 48px 20px;
    background: var(--eh-bg-light);
    border-radius: var(--eh-radius);
    border: 1px dashed var(--eh-border);
}

.eh-reviews-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.eh-reviews-empty h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--eh-text);
    margin-bottom: 6px;
}

.eh-reviews-empty p {
    font-size: 14px;
    color: var(--eh-text-secondary);
    margin: 0;
}

/* ---- Review Form ---- */
.eh-review-form-section {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--eh-border);
}

.eh-review-form-section h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--eh-text);
    margin-bottom: 24px;
}

.eh-review-form {
    background: var(--eh-bg-card);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius);
    padding: 28px;
}

/* Star Selector */
.eh-form-group {
    margin-bottom: 24px;
}

.eh-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--eh-text);
    margin-bottom: 8px;
}

.eh-form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.eh-form-hint {
    font-size: 12px;
    color: var(--eh-text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.eh-star-selector {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
}

.eh-star-selector .eh-star-btn {
    font-size: 28px;
    color: var(--eh-star-empty);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.eh-star-selector .eh-star-btn:hover,
.eh-star-selector .eh-star-btn.hovered {
    color: var(--eh-star-color);
    transform: scale(1.15);
}

.eh-star-selector .eh-star-btn.selected {
    color: var(--eh-star-color);
}

.eh-star-value-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--eh-text);
    margin-left: 12px;
    vertical-align: super;
}

/* Rating Grid */
.eh-rating-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.eh-sub-rating-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.eh-sub-rating-label {
    font-size: 14px;
    color: var(--eh-text);
    min-width: 100px;
}

/* Select / Input */
.eh-form-select,
.eh-form-input {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid var(--eh-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--eh-text);
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.eh-form-select:focus,
.eh-form-input:focus,
.eh-form-textarea:focus {
    outline: none;
    border-color: var(--eh-green);
    box-shadow: 0 0 0 3px rgba(0, 166, 126, 0.1);
}

.eh-form-other-input {
    display: none;
    margin-top: 8px;
}

.eh-form-other-input.visible {
    display: block;
}

/* Date Selectors */
.eh-date-selectors {
    display: flex;
    gap: 12px;
}

.eh-date-selectors .eh-form-select {
    max-width: 160px;
}

/* Textarea */
.eh-form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    border: 1px solid var(--eh-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--eh-text);
    background: #fff;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.eh-char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--eh-text-secondary);
    margin-top: 4px;
}

.eh-char-counter.warning {
    color: #f59e0b;
}

.eh-char-counter.danger {
    color: #ef4444;
}

/* PHI Notice */
.eh-phi-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    margin-top: 8px;
}

.eh-phi-notice-icon {
    flex-shrink: 0;
    font-size: 16px;
}

/* Submit */
.eh-form-submit-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
}

.eh-form-privacy-note {
    font-size: 12px;
    color: var(--eh-text-secondary);
    margin: 0;
}

.eh-form-submit {
    background: var(--eh-green);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.eh-form-submit:hover {
    background: var(--eh-green-dark);
}

.eh-form-submit:active {
    transform: scale(0.98);
}

.eh-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eh-form-submit.loading {
    position: relative;
    color: transparent;
}

.eh-form-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: eh-spin 0.6s linear infinite;
}

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

/* Validation */
.eh-form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.eh-form-group.has-error .eh-form-error {
    display: block;
}

.eh-form-group.has-error .eh-form-select,
.eh-form-group.has-error .eh-form-input,
.eh-form-group.has-error .eh-form-textarea {
    border-color: #ef4444;
}

.eh-form-group.has-error .eh-star-selector .eh-star-btn {
    color: #fca5a5;
}

/* Success Message */
.eh-review-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--eh-radius);
}

.eh-review-success.visible {
    display: block;
}

.eh-review-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.eh-review-success h4 {
    font-size: 18px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 6px;
}

.eh-review-success p {
    font-size: 14px;
    color: #047857;
    margin: 0;
}

/* ---- Logged-out Review CTA ---- */
.eh-review-cta {
    text-align: center;
    padding: 40px 32px;
    background: linear-gradient(135deg, #f0faf3 0%, #f9fafb 100%);
    border: 1.5px solid #d1e7d9;
    border-radius: var(--eh-radius);
    max-width: 520px;
    margin: 0 auto;
}

.eh-review-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #e0f2e7;
    border-radius: 50%;
    margin-bottom: 16px;
}

.eh-review-cta__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--eh-text);
    margin: 0 0 8px;
}

.eh-review-cta__empty {
    font-size: 14px;
    color: var(--eh-text-secondary);
    margin: 0 0 4px;
    font-style: italic;
}

.eh-review-cta__desc {
    font-size: 15px;
    color: var(--eh-text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

.eh-review-cta__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.eh-review-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eh-review-cta__btn--primary {
    background: #047727;
    color: #fff;
    border: 2px solid #047727;
}

.eh-review-cta__btn--primary:hover {
    background: #035e1f;
    border-color: #035e1f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 119, 39, 0.2);
    color: #fff;
}

.eh-review-cta__btn--secondary {
    background: #fff;
    color: #047727;
    border: 2px solid #047727;
}

.eh-review-cta__btn--secondary:hover {
    background: #f0faf3;
    transform: translateY(-1px);
    color: #047727;
}

/* Cooldown */
.eh-cooldown-notice {
    text-align: center;
    padding: 24px 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--eh-radius);
    color: #1e40af;
    font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .eh-review-summary {
        flex-direction: column;
        gap: 16px;
    }

    .eh-summary-overall {
        border-right: none;
        border-bottom: 1px solid var(--eh-border);
        padding-right: 0;
        padding-bottom: 16px;
    }

    .eh-summary-imaging {
        border-left: none;
        border-top: 1px solid var(--eh-border);
        padding-left: 0;
        padding-top: 16px;
        min-width: auto;
    }

    .eh-review-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .eh-review-sub-ratings {
        gap: 10px;
    }

    .eh-sub-rating-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .eh-date-selectors {
        flex-direction: column;
    }

    .eh-date-selectors .eh-form-select {
        max-width: 100%;
    }

    .eh-form-select,
    .eh-form-input {
        max-width: 100%;
    }

    .eh-review-cta {
        padding: 28px 20px;
    }

    .eh-review-cta__actions {
        flex-direction: column;
    }

    .eh-review-cta__btn {
        width: 100%;
    }
}