/**
 * Site Review Manager — Frontend Styles
 *
 * BEM methodology. All classes prefixed with srm-.
 * No external dependencies. Minimal opinionated styling.
 *
 * @package SiteReviewManager
 * @since   1.0.0
 */

/* ---------------------------------------------------------------------------
   Submission form
   --------------------------------------------------------------------------- */

.srm-form {
    max-width: 700px;
    margin: 0 auto;
}

.srm-form__title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: inherit;
}

.srm-form__success {
    background: #edfaef;
    border: 1px solid #b7e4bf;
    border-radius: 4px;
    color: #1a7e2a;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 15px;
}

/* Panel-style success — matches the guidelines panel appearance */
.srm-form__success.srm-form__success--panel {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #166534;
}

.srm-form__error {
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #b32d2e;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 15px;
}

.srm-form__notice {
    color: #787c82;
    font-style: italic;
    padding: 12px 0;
}

.srm-form__errors {
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    padding: 12px 18px;
    margin-bottom: 20px;
}

.srm-form__errors ul {
    margin: 0;
    padding-left: 18px;
}

.srm-form__errors li {
    color: #b32d2e;
    font-size: 14px;
    margin-bottom: 4px;
}

.srm-form__field {
    margin-bottom: 20px;
}

.srm-form__label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: inherit;
}

.srm-form__required {
    color: #d63638;
    margin-left: 2px;
}

.srm-form__input,
.srm-form__select,
.srm-form__textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: inherit;
    background: #ffffff;
    box-sizing: border-box;
    line-height: 1.5;
    transition: border-color 0.15s ease;
}

.srm-form__input:focus,
.srm-form__select:focus,
.srm-form__textarea:focus {
    border-color: #2271b1;
    outline: 2px solid rgba( 34, 113, 177, 0.2 );
    outline-offset: 0;
}

.srm-form__hint {
    display: block;
    font-size: 12px;
    color: #787c82;
    margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   Review Guidelines Panel
   --------------------------------------------------------------------------- */

.srm-form__guidelines {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.srm-form__guidelines-title {
    font-size: 16px;
    font-weight: 700;
    color: #166534;
    margin: 0 0 12px 0;
}

.srm-form__guidelines-content {
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
}

.srm-form__guidelines-intro {
    margin-bottom: 16px;
}

.srm-form__guidelines-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #166534;
    margin: 16px 0 6px 0;
}

.srm-form__guidelines-content p {
    margin: 0 0 10px 0;
}

.srm-form__guidelines-list {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.srm-form__guidelines-list li {
    margin-bottom: 4px;
}

/* ---------------------------------------------------------------------------
   Rating Section
   --------------------------------------------------------------------------- */

.srm-form__rating-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.srm-form__rating-title {
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 12px 0;
}

.srm-form__review-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.srm-form__section-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

/* ---------------------------------------------------------------------------
   Star rating selector
   --------------------------------------------------------------------------- */

.srm-star-rating {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: center;
}

.srm-star-rating .srm-star-rating__label {
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    color: #dcdcde;
    transition: color 0.15s ease;
    display: inline-block;
}

.srm-star-rating .srm-star-rating__input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none;
    clip: rect(0, 0, 0, 0);
}

.srm-star-rating .srm-star-rating__label:hover,
.srm-star-rating .srm-star-rating__label:hover ~ .srm-star-rating__label {
    color: #f0b429;
}

.srm-star-rating .srm-star-rating__input:checked ~ .srm-star-rating__label {
    color: #f0b429;
}

/* ---------------------------------------------------------------------------
   Submit button
   --------------------------------------------------------------------------- */

.srm-form__submit {
    margin-top: 24px;
}

.srm-form__button {
    display: inline-block;
    padding: 10px 24px;
    background: #2271b1;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.5;
    transition: background 0.15s ease;
}

.srm-form__button:hover {
    background: #135e96;
}

.srm-form__button:focus {
    outline: 2px solid rgba( 34, 113, 177, 0.4 );
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Terms checkbox
   --------------------------------------------------------------------------- */

.srm-form__terms {
    margin-bottom: 16px;
}

.srm-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.srm-form__checkbox {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.srm-form__checkbox-label a {
    color: #2271b1;
    text-decoration: underline;
}

.srm-form__checkbox-label a:hover {
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Notification opt-in
   --------------------------------------------------------------------------- */

.srm-form__notify {
    margin-bottom: 16px;
}

.srm-form__turnstile {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Star rating filter bar
   --------------------------------------------------------------------------- */

.srm-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.srm-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.srm-filter__btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.srm-filter__btn--active {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
}

.srm-filter__btn--active:hover {
    background: #135e96;
    border-color: #135e96;
    color: #ffffff;
}

.srm-filter__empty {
    color: #787c82;
    font-style: italic;
    padding: 12px 0;
}

/* ---------------------------------------------------------------------------
   Reviews grid
   --------------------------------------------------------------------------- */

.srm-reviews {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 300px, 1fr ) );
    gap: 24px;
}

.srm-reviews__empty {
    color: #787c82;
    font-style: italic;
    padding: 16px 0;
    grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------------
   Individual review card
   --------------------------------------------------------------------------- */

.srm-review {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.srm-review:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.srm-review__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 16px;
}

.srm-review__star {
    font-size: 22px;
    line-height: 1;
}

.srm-review__star--filled {
    color: #f0b429;
}

.srm-review__star--empty {
    color: #d1d5db;
}

.srm-review__body {
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: #374151;
    margin-bottom: 16px;
}

.srm-review__body p:first-child { margin-top: 0; }
.srm-review__body p:last-child  { margin-bottom: 0; }

/* Admin reply */
.srm-review__reply {
    background: #f9fafb;
    border-left: 3px solid #2271b1;
    border-radius: 0 6px 6px 0;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
}

.srm-review__reply-label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: #2271b1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.srm-review__reply p:first-child { margin-top: 0; }
.srm-review__reply p:last-child  { margin-bottom: 0; }

.srm-review__footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid #f3f4f6;
    padding-top: 14px;
    margin-top: auto;
}

.srm-review__author {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.srm-review__verified {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #00a32a;
    background: #edfcf2;
    border: 1px solid #b8e6c8;
    border-radius: 20px;
    padding: 1px 8px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.srm-review__category {
    display: inline-block;
    font-size: 11px;
    padding: 2px 10px;
    background: #f0f0f1;
    border-radius: 20px;
    color: #50575e;
    align-self: flex-start;
}

.srm-review__date {
    font-size: 12px;
    color: #9ca3af;
}

/* Single-column stack on narrow viewports */
@media ( max-width: 640px ) {
    .srm-reviews {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------------------------
   Testimonial carousel
   --------------------------------------------------------------------------- */

.srm-carousel {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
}

.srm-carousel__track {
    position: relative;
    min-height: 200px;
}

.srm-carousel__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* When JS takes over, the active slide is shown via class */
.srm-carousel--js .srm-carousel__slide {
    animation: none !important;
}

.srm-carousel--js .srm-carousel__slide--active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* Without JS: first slide visible as fallback */
.srm-carousel__slide:first-child {
    position: relative;
}

.srm-carousel__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 16px;
}

.srm-carousel__body {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    font-style: italic;
    margin: 0 0 16px 0;
    border: none;
    padding: 0;
}

.srm-carousel__body p:first-child { margin-top: 0; }
.srm-carousel__body p:last-child  { margin-bottom: 0; }

.srm-carousel__author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-style: normal;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.srm-carousel__category {
    display: inline-block;
    font-size: 11px;
    font-weight: 400;
    padding: 2px 10px;
    background: #f0f0f1;
    border-radius: 20px;
    color: #50575e;
}

/* Navigation arrows */
.srm-carousel__nav {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 0 4px;
}

.srm-carousel__prev,
.srm-carousel__next {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #ffffff;
    font-size: 22px;
    line-height: 1;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.srm-carousel__prev:hover,
.srm-carousel__next:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Dot indicators */
.srm-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.srm-carousel__dot {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
}

.srm-carousel__dot--active {
    background: #2271b1;
}

.srm-carousel__dot:hover {
    background: #9ca3af;
}

.srm-carousel__dot--active:hover {
    background: #2271b1;
}

/* ---------------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------------- */

.srm-pagination {
    margin-top: 24px;
    text-align: center;
}

.srm-pagination ul {
    display: flex;
    justify-content: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.srm-pagination li {
    display: inline-block;
}

.srm-pagination a,
.srm-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #2271b1;
    background: #ffffff;
    line-height: 1.4;
}

.srm-pagination a:hover,
.srm-pagination a:focus {
    background: #f0f0f1;
    border-color: #2271b1;
    color: #135e96;
}

.srm-pagination .current {
    background: #2271b1;
    border-color: #2271b1;
    color: #ffffff;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Rating summary
   --------------------------------------------------------------------------- */

.srm-rating-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.srm-rating-summary--empty {
    color: #787c82;
    font-style: italic;
}

.srm-rating-summary__stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.srm-rating-summary__average {
    font-weight: 700;
    font-size: 18px;
    color: inherit;
}

.srm-rating-summary__count {
    font-size: 14px;
    color: #787c82;
}

/* ---------------------------------------------------------------------------
   Aggregate rating
   --------------------------------------------------------------------------- */

.srm-aggregate {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.srm-aggregate--empty {
    color: #787c82;
    font-style: italic;
}

.srm-aggregate__stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.srm-aggregate__average {
    font-weight: 700;
    font-size: 18px;
    color: inherit;
}

.srm-aggregate__count {
    font-size: 14px;
    color: #787c82;
}

/* ---------------------------------------------------------------------------
   Reviews slider
   --------------------------------------------------------------------------- */

.srm-slider {
    position: relative;
    width: 100%;
    padding: 0 48px;
}

.srm-slider__viewport {
    overflow: hidden;
    border-radius: 4px;
}

.srm-slider__track {
    display: flex;
    gap: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.srm-slider__slide {
    flex: 0 0 calc(100% / var(--srm-per-view, 3) - 16px * (var(--srm-per-view, 3) - 1) / var(--srm-per-view, 3));
}

/* Slider cards inherit srm-review styling from grid section. */

.srm-slider__prev,
.srm-slider__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #d0d0d0;
    background: white;
    color: #666;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.srm-slider__prev:hover:not(:disabled),
.srm-slider__next:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

.srm-slider__prev:disabled,
.srm-slider__next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.srm-slider__prev {
    left: 0;
}

.srm-slider__next {
    right: 0;
}

/* Dot indicators */

.srm-slider__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.srm-slider__dot {
    width: 10px;
    height: 10px;
    border: none;
    padding: 0;
    background: #d0d0d0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s ease;
}

.srm-slider__dot:hover {
    background: #999;
}

.srm-slider__dot--active {
    background: #333;
}

/* Responsive: 2 cards visible at tablet */

@media (max-width: 768px) {
    .srm-slider {
        --srm-per-view: 2;
    }

    .srm-slider__slide {
        flex: 0 0 calc(100% / 2 - 8px);
    }
}

/* Responsive: 1 card visible on mobile */

@media (max-width: 480px) {
    .srm-slider {
        --srm-per-view: 1;
        padding: 0 40px;
    }

    .srm-slider__slide {
        flex: 0 0 100%;
    }

    .srm-slider__prev,
    .srm-slider__next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* CSS-only fallback when JS is disabled */

.srm-slider:not(.srm-slider--js) .srm-slider__track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.srm-slider:not(.srm-slider--js) .srm-slider__slide {
    scroll-snap-align: start;
}

.srm-slider:not(.srm-slider--js) .srm-slider__prev,
.srm-slider:not(.srm-slider--js) .srm-slider__next,
.srm-slider:not(.srm-slider--js) .srm-slider__dots {
    display: none;
}
