/* Override Custom Google Form styles to match review form */
#review_form_wrapper-gg {
    /* margin-top: 40px; */
    padding-bottom: 40px;
    border-bottom: 2px solid #EBEBEB;
}

/* Container */
.cgf__container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
}

/* Title */
.cgf__title {
    display: none !important;
}

/* Form content */
.cgf__content {
    background: transparent !important;
}

/* Field groups */
.cgf__group {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 14px !important;
}

/* Labels */
.cgf__label {
    font-size: 15px !important;
    font-weight: normal !important;
    color: #333 !important;
    margin-bottom: 8px !important;
    font-family: 'PoppinsRegular', sans-serif !important;
}

.cgf__label-required {
    color: #dc2626 !important;
}

/* Input fields */
.cgf__control,
.cgf__textarea {
    width: 100% !important;
    border: 2px solid #ACCED6 !important;
    background-color: #F1F9FB !important;
    border-radius: 6px !important;
    padding: 15px 20px !important;
    font-size: 14px !important;
    outline: none !important;
    font-family: 'PoppinsRegular', sans-serif !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.cgf__control:focus,
.cgf__textarea:focus {
    background: #fff !important;
    border-color: #EA8798 !important;
    box-shadow: 0 0 0 2px rgba(234, 135, 152, 0.2) !important;
}

/* Textarea */
.cgf__textarea {
    min-height: 145px !important;
    resize: vertical !important;
}

/* Radio buttons - Star Rating */
.cgf__radio-group {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.cgf__radio-item {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    position: relative !important;
}

/* Hide default radio button */
.cgf__radio {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Star icon using label */
.cgf__radio-label {
    font-size: 32px !important;
    color: #EA8798 !important;
    /* Default: all stars pink (5 stars) */
    font-family: Arial, sans-serif !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    line-height: 1 !important;
    position: relative !important;
    display: inline-block !important;
    text-indent: -9999px !important;
    width: 36px !important;
    height: 36px !important;
}

.cgf__radio-label::before {
    content: '★' !important;
    text-indent: 0 !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
}

/* Reset to gray when no selection or lower selection */
.cgf__radio-group:has(.cgf__radio:checked) .cgf__radio-label {
    color: #ddd !important;
}

/* Hover effect */
.cgf__radio-item:hover .cgf__radio-label {
    color: #EA8798 !important;
    transform: scale(1.1) !important;
}

/* Pure CSS: Highlight all stars when one is checked */
/* When radio 1 is checked, highlight star 1 */
.cgf__radio-item:nth-child(1) .cgf__radio:checked~.cgf__radio-label {
    color: #EA8798 !important;
}

/* When radio 2 is checked, highlight stars 1-2 */
.cgf__radio-item:nth-child(2) .cgf__radio:checked~.cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(2) .cgf__radio:checked) .cgf__radio-label {
    color: #EA8798 !important;
}

/* When radio 3 is checked, highlight stars 1-3 */
.cgf__radio-item:nth-child(3) .cgf__radio:checked~.cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(3) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(3) .cgf__radio:checked) .cgf__radio-label {
    color: #EA8798 !important;
}

/* When radio 4 is checked, highlight stars 1-4 */
.cgf__radio-item:nth-child(4) .cgf__radio:checked~.cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(4) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(4) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(3):has(~ .cgf__radio-item:nth-child(4) .cgf__radio:checked) .cgf__radio-label {
    color: #EA8798 !important;
}

/* When radio 5 is checked, highlight all 5 stars */
.cgf__radio-item:nth-child(5) .cgf__radio:checked~.cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(5) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(5) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(3):has(~ .cgf__radio-item:nth-child(5) .cgf__radio:checked) .cgf__radio-label,
.cgf__radio-item:nth-child(4):has(~ .cgf__radio-item:nth-child(5) .cgf__radio:checked) .cgf__radio-label {
    color: #EA8798 !important;
}

/* Hover effects - highlight stars on mouseover and dim stars after */
/* Hover star 1 - only star 1 highlighted, rest gray */
.cgf__radio-item:nth-child(1):hover~.cgf__radio-item .cgf__radio-label {
    color: #ddd !important;
}

.cgf__radio-item:nth-child(1):hover .cgf__radio-label {
    color: #EA8798 !important;
}

/* Hover star 2, highlight 1-2, rest gray */
.cgf__radio-item:nth-child(2):hover~.cgf__radio-item .cgf__radio-label {
    color: #ddd !important;
}

.cgf__radio-item:nth-child(2):hover .cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(2):hover) .cgf__radio-label {
    color: #EA8798 !important;
}

/* Hover star 3, highlight 1-3, rest gray */
.cgf__radio-item:nth-child(3):hover~.cgf__radio-item .cgf__radio-label {
    color: #ddd !important;
}

.cgf__radio-item:nth-child(3):hover .cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(3):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(3):hover) .cgf__radio-label {
    color: #EA8798 !important;
}

/* Hover star 4, highlight 1-4, rest gray */
.cgf__radio-item:nth-child(4):hover~.cgf__radio-item .cgf__radio-label {
    color: #ddd !important;
}

.cgf__radio-item:nth-child(4):hover .cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(4):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(4):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(3):has(~ .cgf__radio-item:nth-child(4):hover) .cgf__radio-label {
    color: #EA8798 !important;
}

/* Hover star 5, highlight all 5 */
.cgf__radio-item:nth-child(5):hover .cgf__radio-label,
.cgf__radio-item:nth-child(1):has(~ .cgf__radio-item:nth-child(5):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(2):has(~ .cgf__radio-item:nth-child(5):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(3):has(~ .cgf__radio-item:nth-child(5):hover) .cgf__radio-label,
.cgf__radio-item:nth-child(4):has(~ .cgf__radio-item:nth-child(5):hover) .cgf__radio-label {
    color: #EA8798 !important;
}

/* Submit button */
.cgf__btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #EA8798 !important;
    color: #fff !important;
    width: 100px !important;
    height: 35px !important;
    border-radius: 35px !important;
    font-size: 14px !important;
    border: none !important;
    cursor: pointer !important;
    font-family: 'PoppinsRegular', sans-serif !important;
    transition: all 0.3s ease !important;
    margin-left: auto !important;
}

.cgf__btn-primary:hover {
    background: #d97686 !important;
    transform: scale(1.05) !important;
}

/* Actions container */
.cgf__actions {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 20px !important;
}

/* Hide customgform branding */
.cgf__copy {
    display: none !important;
}

/* Fields group */
.cgf__fields-group {
    width: 100% !important;
}

/* Inline layout for name, email, phone fields */
.cgf__fields {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
}

/* Make first 3 fields (Họ Tên, Email, SĐT) display inline */
.cgf__fields>label.cgf__group:nth-child(1),
.cgf__fields>label.cgf__group:nth-child(2),
.cgf__fields>label.cgf__group:nth-child(3) {
    flex: 1 !important;
    min-width: 200px !important;
}

/* Review and Số sao fields take full width */
.cgf__fields>label.cgf__group:nth-child(4),
.cgf__fields>div.cgf__group:nth-child(5) {
    flex: 1 1 100% !important;
}

/* Mobile: stack all fields vertically */
@media only screen and (max-width: 767.98px) {

    /* Reduce wrapper padding on mobile */
    #review_form_wrapper-gg {
        margin-top: 30px !important;
        padding-top: 30px !important;
    }

    /* Stack fields vertically */
    .cgf__fields>label.cgf__group:nth-child(1),
    .cgf__fields>label.cgf__group:nth-child(2),
    .cgf__fields>label.cgf__group:nth-child(3) {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    /* Reduce input padding on mobile */
    .cgf__control,
    .cgf__textarea {
        padding: 12px 15px !important;
        font-size: 16px !important;
        margin: 0 !important;
        /* Prevent zoom on iOS */
    }

    .cgf-theme-base .cgf__radio-group {
        margin: 0 !important;
    }

    .cgf-theme-base .cgf__radio-label {
        margin: 0 !important;
    }

    /* Smaller star size on mobile */
    .cgf__radio-label {
        font-size: 24px !important;
        width: 28px !important;
        height: 28px !important;
    }

    /* Keep stars in single row on mobile */
    .cgf__radio-group {
        gap: 4px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }

    /* More refined button on mobile */
    .cgf__btn-primary {
        width: auto !important;
        min-width: 120px !important;
        margin-left: 0 !important;
        height: 40px !important;
        font-size: 15px !important;
        padding: 0 30px !important;
    }

    /* Right-align button on mobile */
    .cgf__actions {
        justify-content: flex-end !important;
    }

    /* Reduce textarea height on mobile */
    .cgf__textarea {
        min-height: 120px !important;
    }

    /* Reduce label font size slightly */
    .cgf__label {
        font-size: 14px !important;
    }
}