/**
 * NearB Reviews Styles
 *
 * Styles for reviews slider, cards, modal, and star ratings.
 *
 * @package NearB\Assets
 */

/* ===========================================
   REVIEWS CONTAINER
   =========================================== */

.nearb-reviews {
    width: 100%;
    position: relative;
}

/* ===========================================
   SWIPER SLIDER
   =========================================== */

.nearb-reviews__slider {
    width: 100%;
    padding-bottom: 48px;
}

.nearb-reviews__slider .swiper-slide {
    height: auto;
    min-width: 280px;
}

.nearb-reviews__navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.nearb-reviews__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.nearb-reviews__nav:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.nearb-reviews__nav:disabled,
.nearb-reviews__nav.swiper-button-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nearb-reviews__pagination {
    display: flex;
    gap: 8px;
}

.nearb-reviews__pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ddd;
    border-radius: 50%;
    opacity: 1;
    transition: all 0.2s;
}

.nearb-reviews__pagination .swiper-pagination-bullet-active {
    background: #F5A623;
    width: 24px;
    border-radius: 4px;
}

/* ===========================================
   REVIEW CARD
   =========================================== */

.nearb-review-card {
    background: #F7F7F7;
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nearb-review-card__content {
    flex: 1;
    margin-bottom: 16px;
}

.nearb-review-card__text {
    margin: 0 0 16px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.nearb-review-card__photo {
    margin-top: 12px;
}

.nearb-review-card__photo a {
    display: inline-block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.nearb-review-card__photo img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s;
}

.nearb-review-card__photo a:hover img {
    transform: scale(1.05);
}

.nearb-review-card__photo-zoom {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.nearb-review-card__photo a:hover .nearb-review-card__photo-zoom {
    opacity: 1;
}

/* Meta (author, date) */
.nearb-review-card__meta {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.nearb-review-card__author {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nearb-review-card__author-name {
    font-weight: 600;
    font-size: 15px;
    color: #191923;
}

.nearb-review-card__visit-date {
    font-size: 13px;
    color: #666;
}

/* Ratings */
.nearb-review-card__ratings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nearb-review-card__rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nearb-review-card__rating-label {
    font-size: 14px;
    color: #666;
    min-width: 90px;
}

.nearb-review-card__stars {
    display: flex;
    gap: 2px;
}

.nearb-review-card__star {
    color: #ddd;
}

.nearb-review-card__star--filled {
    color: #F5A623;
}

/* ===========================================
   EMPTY STATE
   =========================================== */

.nearb-reviews__empty {
    text-align: center;
    padding: 48px 24px;
    background: #f9f9f9;
    border-radius: 16px;
}

.nearb-reviews__empty p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* ===========================================
   ACTIONS
   =========================================== */

.nearb-reviews__actions {
    margin-top: 24px;
    text-align: center;
}

.nearb-reviews__add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #191923;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nearb-reviews__add-btn:hover {
    background: #2a2a36;
    transform: translateY(-1px);
}

.nearb-reviews__already-reviewed,
.nearb-reviews__login-notice {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.nearb-reviews__login-notice a {
    color: #191923;
    font-weight: 500;
}

/* ===========================================
   MODAL
   =========================================== */

.nearb-review-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.nearb-review-modal[hidden] {
    display: none;
}

.nearb-review-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.nearb-review-modal__container {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.nearb-review-modal__container .nearb-review-modal__header button, .nearb-review-modal__container .nearb-review-modal__body button{
    background-color:#fff;
    color:#000
}

.nearb-review-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.nearb-review-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #191923;
}

.nearb-review-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.nearb-review-modal__close:hover {
    background: #f5f5f5;
    color: #333;
}

.nearb-review-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.nearb-review-modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.nearb-review-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nearb-review-modal__btn--secondary {
    background: #f5f5f5;
    color: #333;
}

.nearb-review-modal__btn--secondary:hover {
    background: #eee;
}

.nearb-review-modal__btn--primary {
    background: #191923;
    color: #fff;
    min-width: 140px;
}

.nearb-review-modal__btn--primary:hover {
    background: #2a2a36;
}

.nearb-review-modal__btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nearb-review-modal__btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ===========================================
   FORM FIELDS
   =========================================== */

.nearb-review-form__field {
    margin-bottom: 20px;
}

.nearb-review-form__field:last-child {
    margin-bottom: 0;
}

.nearb-review-form__field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.nearb-review-form__optional {
    font-weight: 400;
    color: #999;
}

.nearb-review-form__field textarea,
.nearb-review-form__field input[type="date"],
.nearb-review-form__field input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.nearb-review-form__field textarea:focus,
.nearb-review-form__field input:focus {
    outline: none;
    border-color: #191923;
}

.nearb-review-form__field textarea {
    resize: vertical;
    min-height: 100px;
}

.nearb-review-form__char-count {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
    text-align: right;
}

.nearb-review-form__char-count.is-warning {
    color: #F5A623;
}

.nearb-review-form__char-count.is-danger {
    color: #dc2626;
}

.nearb-review-form__hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #999;
}

/* ===========================================
   STAR RATING (Interactive)
   =========================================== */

.nearb-review-form__ratings {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.nearb-review-form__rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nearb-review-form__rating label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.nearb-star-rating {
    display: flex;
    gap: 4px;
}

.nearb-star-rating__star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #ddd;
    transition: all 0.15s;
}

.nearb-star-rating__star:hover,
.nearb-star-rating__star.is-hovered {
    color: #F5A623;
    transform: scale(1.1);
}

.nearb-star-rating__star.is-selected {
    color: #F5A623;
}

.nearb-star-rating__star.is-selected svg {
    fill: #F5A623;
}

/* ===========================================
   PHOTO UPLOAD
   =========================================== */

.nearb-review-form__photo-upload {
    position: relative;
}

.nearb-review-form__photo-upload input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.nearb-review-form__photo-upload input[type="file"]:hover {
    border-color: #999;
}

.nearb-review-form__photo-preview {
    margin-top: 12px;
    position: relative;
    display: inline-block;
}

.nearb-review-form__photo-preview img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.nearb-review-form__photo-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.nearb-review-form__photo-remove:hover {
    transform: scale(1.1);
}

/* ===========================================
   TOAST NOTIFICATIONS
   =========================================== */

.nearb-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nearb-toast {
    padding: 12px 24px;
    background: #191923;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: nearb-toast-in 0.2s ease-out;
}

.nearb-toast--success {
    background: #059669;
}

.nearb-toast--error {
    background: #dc2626;
}

.nearb-toast.is-hiding {
    animation: nearb-toast-out 0.2s ease-in forwards;
}

@keyframes nearb-toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nearb-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ===========================================
   PANEL REVIEW CARD STYLES
   =========================================== */

.nearb-panel-review-ratings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.nearb-panel-review-rating__label {
    font-size: 13px;
    color: #666;
    min-width: 80px;
}

.nearb-panel-review-rating__stars {
    display: flex;
    gap: 2px;
}

.nearb-panel-star {
    color: #ddd;
}

.nearb-panel-star.is-filled {
    color: #F5A623;
}

/* ===========================================
   BODY LOCK (Modal Open)
   =========================================== */

body.nearb-modal-open {
    overflow: hidden;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .nearb-review-modal__container {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
    }

    .nearb-review-modal__body {
        padding: 16px;
    }

    .nearb-review-modal__footer {
        flex-direction: column;
    }

    .nearb-review-modal__btn {
        width: 100%;
    }

    .nearb-review-form__rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nearb-review-card__rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
