/**
 * StarReviews & Testimonials - Public Styles
 */

:root {
    --spr-star-color: #f59e0b;
    --spr-star-empty: #cbd5e1;
    --spr-primary-btn: #2563eb;
    --spr-primary-btn-hover: #1d4ed8;
    --spr-card-border: #e2e8f0;
    --spr-card-bg: #ffffff;
    --spr-text-dark: #0f172a;
    --spr-text-muted: #64748b;
    --spr-success-bg: #ecfdf5;
    --spr-success-text: #065f46;
    --spr-error-bg: #fef2f2;
    --spr-error-text: #991b1b;
}

.spr-container {
    max-width: 100%;
    margin: 2rem 0;
    font-family: inherit;
    color: var(--spr-text-dark);
    box-sizing: border-box;
}

.spr-container * {
    box-sizing: border-box;
}

/* Stars */
.spr-stars-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--spr-star-color);
}

.spr-star-icon {
    display: inline-block;
    vertical-align: middle;
}

.spr-star-icon.spr-star-empty {
    color: var(--spr-star-empty);
    fill: none;
}

/* Summary Card */
.spr-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid var(--spr-card-border);
    border-radius: 12px;
}

.spr-summary-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2.5rem;
    flex: 1;
}

.spr-summary-score {
    text-align: center;
    min-width: 130px;
}

.spr-score-num {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--spr-text-dark);
    margin-bottom: 0.35rem;
}

.spr-score-stars {
    margin-bottom: 0.35rem;
}

.spr-score-total {
    font-size: 0.875rem;
    color: var(--spr-text-muted);
}

.spr-summary-breakdown {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.spr-breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.spr-row-label {
    width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: 600;
    color: var(--spr-text-dark);
}

.spr-label-star {
    color: var(--spr-star-color);
    font-size: 11px;
    margin-left: 2px;
}

.spr-progress-track {
    flex: 1;
    height: 9px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.spr-progress-fill {
    height: 100%;
    background: var(--spr-star-color);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.spr-row-pct {
    width: 35px;
    text-align: right;
    color: var(--spr-text-muted);
    font-size: 0.8rem;
}

.spr-row-count {
    width: 30px;
    color: var(--spr-text-muted);
    font-size: 0.8rem;
}

/* Buttons */
.spr-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    line-height: 1.4;
}

.spr-button.spr-outline-btn {
    background: #ffffff;
    border: 1.5px solid #0f172a;
    color: #0f172a;
}

.spr-button.spr-outline-btn:hover {
    background: #0f172a;
    color: #ffffff;
}

.spr-button.spr-submit-btn {
    background: var(--spr-primary-btn);
    color: #ffffff;
}

.spr-button.spr-submit-btn:hover {
    background: var(--spr-primary-btn-hover);
}

/* Form Styles */
.spr-form-collapsible {
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.spr-form-collapsible.spr-hidden {
    display: none;
}

.spr-form-wrapper {
    background: #ffffff;
    border: 1px solid var(--spr-card-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.spr-form-heading {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.spr-form-group {
    margin-bottom: 1.25rem;
}

.spr-form-row {
    display: flex;
    gap: 1rem;
}

.spr-col-half {
    flex: 1;
}

.spr-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--spr-text-dark);
}

.spr-input,
.spr-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--spr-text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.spr-input:focus,
.spr-textarea:focus {
    outline: none;
    border-color: var(--spr-primary-btn);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Star Rating Picker */
.spr-star-picker {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

.spr-star-picker input[type="radio"] {
    display: none;
}

.spr-star-picker label {
    cursor: pointer;
    color: var(--spr-star-empty);
    transition: color 0.15s ease, transform 0.15s ease;
}

.spr-star-picker label:hover,
.spr-star-picker label:hover ~ label,
.spr-star-picker input[type="radio"]:checked ~ label {
    color: var(--spr-star-color);
}

.spr-star-picker label:hover {
    transform: scale(1.15);
}

/* Spinner */
.spr-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spr-spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Form Feedback */
.spr-form-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1.15rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.spr-form-feedback.spr-success {
    background: var(--spr-success-bg);
    color: var(--spr-success-text);
    border: 1px solid #a7f3d0;
}

.spr-form-feedback.spr-error {
    background: var(--spr-error-bg);
    color: var(--spr-error-text);
    border: 1px solid #fecaca;
}

/* Review Cards */
.spr-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.spr-reviews-list.spr-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.spr-review-card {
    background: var(--spr-card-bg);
    border: 1px solid var(--spr-card-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spr-review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.spr-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.spr-reviewer-avatar .spr-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.spr-reviewer-info {
    flex: 1;
}

.spr-reviewer-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.spr-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--spr-text-dark);
}

.spr-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.spr-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.spr-reviewer-title {
    font-size: 0.8rem;
    color: var(--spr-text-muted);
    margin-bottom: 4px;
}

.spr-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.spr-date {
    font-size: 0.8rem;
    color: var(--spr-text-muted);
}

.spr-review-headline {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--spr-text-dark);
}

.spr-review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}

.spr-review-text p {
    margin: 0 0 0.75rem 0;
}

.spr-review-text p:last-child {
    margin-bottom: 0;
}

/* Empty Notice */
.spr-empty-notice {
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    color: var(--spr-text-muted);
}

/* Testimonials Layout */
.spr-testimonials-wrapper.spr-testimonial-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.spr-testimonials-wrapper.spr-testimonial-layout-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 2rem 0;
}

.spr-testimonial-card {
    background: #ffffff;
    border: 1px solid var(--spr-card-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.spr-testimonial-stars {
    margin-bottom: 0.75rem;
}

.spr-testimonial-quote {
    font-size: 1rem;
    font-style: italic;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 1.25rem;
    flex: 1;
}

.spr-testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.spr-author-avatar .spr-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.spr-author-meta {
    display: flex;
    flex-direction: column;
}

.spr-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--spr-text-dark);
}

.spr-author-role {
    font-size: 0.8rem;
    color: var(--spr-text-muted);
}

/* Inline Rating Badge */
.spr-inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    color: var(--spr-text-dark);
}

.spr-badge-star {
    color: var(--spr-star-color);
    font-size: 1.15rem;
}

.spr-badge-score {
    font-weight: 700;
}

.spr-badge-count {
    color: var(--spr-text-muted);
}

/* Pagination */
.spr-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2rem;
}

.spr-pagination .page-numbers {
    padding: 6px 12px;
    border: 1px solid var(--spr-card-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--spr-text-dark);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.spr-pagination .page-numbers.current {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.spr-pagination .page-numbers:hover:not(.current) {
    background: #f1f5f9;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .spr-top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .spr-summary-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .spr-form-row {
        flex-direction: column;
        gap: 0;
    }

    .spr-toggle-action {
        text-align: center;
    }

    .spr-button.spr-outline-btn {
        width: 100%;
    }
}
