/* --- CSS FORM ĐÁNH GIÁ CELESTIA WINE BAR --- */

.celestia-review-form-wrapper {
    background: #38824d; /* Màu nền xanh rêu sáng nhẹ Celestia */
    border: 1.5px solid #46a260; /* Viền màu xanh lá nhạt */
    padding: 35px 30px;
    border-radius: 12px;
    max-width: 800px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.celestia-review-form-wrapper .form-title {
    color: #fff; /* Màu chữ trắng đồng bộ */
    font-size: 26px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    font-weight: 700;
}

.celestia-review-form-wrapper .form-subtitle {
    color: #e2e2e2;
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.celestia-review-form-wrapper .form-group-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .celestia-review-form-wrapper .form-group-row {
        flex-direction: column;
        gap: 15px;
    }

    /* Mobile: Fix text xuống dòng */
    .celestia-review-form-wrapper {
        padding: 25px 18px;
    }

    .celestia-review-form-wrapper .form-title {
        font-size: 20px;
        letter-spacing: 0.5px;
    }

    .celestia-review-form-wrapper .form-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .overall-star-field label {
        font-size: 13px !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .celestia-review-form-wrapper .form-field label {
        font-size: 12px;
        text-transform: none;
        letter-spacing: 0;
    }

    .big-stars {
        font-size: 32px !important;
        gap: 5px !important;
    }

    .overall-rating-container {
        padding: 15px;
    }

    #celestia-submit-review {
        font-size: 14px;
        padding: 12px 20px;
        letter-spacing: 0.5px;
    }
}

.celestia-review-form-wrapper .form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.celestia-review-form-wrapper .form-field label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff; /* Nhãn chữ trắng đồng bộ */
    margin-bottom: 8px;
    font-weight: 600;
}

.celestia-review-form-wrapper input[type="text"],
.celestia-review-form-wrapper input[type="number"],
.celestia-review-form-wrapper select,
.celestia-review-form-wrapper textarea {
    background: rgba(0, 0, 0, 0.25) !important; /* Nền tối bắt buộc, chống theme đè trắng */
    border: 1px solid rgba(70, 162, 96, 0.4) !important; /* Viền màu xanh #46a260 */
    color: #fff !important; /* Chữ trắng bắt buộc */
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    -webkit-text-fill-color: #fff !important; /* Fix cho Safari/iOS */
    text-transform: none !important; /* Cho phép viết chữ hoa bình thường */
    -webkit-appearance: none; /* Xóa style mặc định iOS */
    opacity: 1 !important; /* Fix iOS làm mờ input */
}

/* Placeholder màu trắng mờ */
.celestia-review-form-wrapper input::placeholder,
.celestia-review-form-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.5) !important;
}

.celestia-review-form-wrapper input:focus,
.celestia-review-form-wrapper select:focus,
.celestia-review-form-wrapper textarea:focus {
    border-color: #46a260 !important;
    outline: none !important;
    box-shadow: 0 0 8px rgba(70, 162, 96, 0.5) !important;
    background: rgba(0, 0, 0, 0.4) !important; /* Nền tối hơn khi focus - BẮT BUỘC */
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.celestia-review-form-wrapper select option {
    background: #38824d !important;
    color: #fff !important;
}

/* Container cho Đánh giá chung */
.overall-rating-container {
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(70, 162, 96, 0.3); /* Viền màu xanh #46a260 */
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overall-star-field {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
}

.overall-star-field label {
    font-size: 16px !important;
    color: #fff; /* Màu chữ trắng đồng bộ */
    font-weight: 700;
    margin-bottom: 10px !important;
}

.big-stars {
    font-size: 38px !important;
    gap: 8px !important;
}


.star-rating-field {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    width: 100%;
}

.star-rating-field label {
    margin-bottom: 0 !important;
    font-size: 13px !important;
    color: #e2e2e2 !important;
}

.celestia-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    font-size: 24px;
    gap: 4px;
    cursor: pointer;
    width: 100%;
}

.celestia-star-rating .star {
    color: rgba(255, 193, 7, 0.3); /* Sao mờ màu vàng nhạt để khách thấy rõ hơn */
    transition: color 0.2s ease, transform 0.1s ease;
    text-shadow: 0 0 2px rgba(255, 193, 7, 0.15); /* Nhẹ glow để nổi bật trên nền tối */
}

.celestia-star-rating .star:hover,
.celestia-star-rating .star:hover ~ .star,
.celestia-star-rating .star.selected,
.celestia-star-rating .star.selected ~ .star {
    color: #ffc107; /* Màu sao giữ nguyên vàng Google */
}

.celestia-star-rating .star:active {
    transform: scale(0.85);
}


/* Nút Submit */
#celestia-submit-review {
    background: #46a260; /* Nút chính màu xanh lá nhạt #46a260 */
    border: none;
    color: #fff; /* Chữ trắng */
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 10px;
}

#celestia-submit-review:hover {
    background: #57c577; /* Hover sáng hơn tí */
    box-shadow: 0 6px 20px rgba(70, 162, 96, 0.4);
}

#celestia-submit-review:disabled {
    background: #305b3a;
    color: #a3c4ab;
    cursor: not-allowed;
}

#celestia-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

#celestia-form-message.success {
    display: block;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

#celestia-form-message.error {
    display: block;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}


/* --- CSS DANH SÁCH ĐÁNH GIÁ (FRONT-END) --- */

.celestia-reviews-list-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

/* Summary Box kiểu Google Maps */
.celestia-reviews-summary {
    display: flex;
    align-items: center;
    background: #38824d; /* Màu nền xanh rêu sáng nhẹ Celestia */
    border: 1.5px solid #46a260; /* Viền xanh #46a260 */
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    gap: 30px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    .celestia-reviews-summary {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

.summary-score-box {
    display: flex;
    align-items: baseline;
}

.summary-score-box .average-score {
    font-size: 48px;
    font-weight: 800;
    color: #fff; /* Số điểm màu trắng */
    line-height: 1;
}

.summary-score-box .score-max {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.summary-stars {
    font-size: 22px;
    margin-bottom: 5px;
}

.summary-stars .star {
    color: rgba(255, 255, 255, 0.2);
}

.summary-stars .star.filled {
    color: #ffc107;
}

.summary-stars .star.half-filled {
    background: linear-gradient(90deg, #ffc107 50%, rgba(255, 255, 255, 0.2) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.total-count {
    font-size: 13px;
    color: #e2e2e2;
}

/* Grid Reviews */
.celestia-reviews-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 25px;
    align-items: stretch !important; /* Card cùng hàng cao bằng nhau */
}

.celestia-review-card {
    background: #38824d; /* Màu nền xanh rêu sáng nhẹ Celestia */
    border: 1px solid rgba(70, 162, 96, 0.3); /* Viền xanh #46a260 mờ */
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    color: #fff;
    height: 100%; /* Kéo dài bằng card cao nhất cùng hàng */
    min-height: 0; /* Fix cho flex trong grid */
}

.celestia-review-card:hover {
    transform: translateY(-5px);
    border-color: #46a260;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    min-width: 45px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #305b3a; /* Nền avatar xanh #305b3a */
    color: #fff; /* Chữ avatar trắng */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.user-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.card-stars {
    font-size: 16px;
    margin-bottom: 8px;
}

.card-stars .star {
    color: rgba(255, 255, 255, 0.2);
}

.card-stars .star.filled {
    color: #ffc107;
}


.card-content {
    font-size: 14px;
    line-height: 1.6;
    color: #f0f0f0;
    margin-bottom: 15px;
    flex-grow: 1; /* Chiếm hết khoảng trống còn lại - card không có ảnh sẽ tự giãn đều */
}


.no-reviews {
    text-align: center;
    padding: 40px;
    background: #38824d; /* Màu nền xanh rêu sáng nhẹ Celestia */
    border: 1.5px dashed #46a260;
    border-radius: 12px;
    color: #e2e2e2;
}

/* --- POPUP THÀNH CÔNG + GOOGLE MAPS CTA --- */
.celestia-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.celestia-popup-overlay.active {
    opacity: 1;
}

.celestia-popup-content {
    background: #2d6b3f;
    border: 1.5px solid #46a260;
    border-radius: 16px;
    padding: 40px 35px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    font-family: 'Montserrat', 'Inter', sans-serif;
}

.celestia-popup-overlay.active .celestia-popup-content {
    transform: scale(1) translateY(0);
}

.popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #46a260;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(70, 162, 96, 0.4);
}

.popup-title {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}

.popup-message {
    color: #d4e8da;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
}

.popup-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 20px 0;
}

.popup-google-desc {
    color: #c5dece;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 18px;
}

.popup-google-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4285F4;
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.35);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.popup-google-btn:hover {
    background: #3367D6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.5);
    color: #fff !important;
    text-decoration: none !important;
}

.popup-google-btn svg {
    flex-shrink: 0;
}

.popup-close-btn {
    display: block;
    margin: 18px auto 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #b0c9b8;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
    .celestia-popup-content {
        padding: 30px 20px;
    }
    .popup-title {
        font-size: 20px;
    }
    .popup-google-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}