/**
 * Contact Widget - Frontend Styles
 * 
 * Based on reference code from hanoitropicalgarden.com.vn
 * với prefix hdev- thay vì CR-
 * 
 * @package HDev_Theme
 * @since 1.0.0
 */

/* ============================================
   STICKY WIDGET CONTAINER
   ============================================ */

.hdev-custom-sticky-icons {
    position: fixed;
    bottom: 4.375rem;
    right: 3.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 14;
}

/* Left position variant */
.hdev-custom-sticky-icons[data-position="left"] {
    right: auto;
    left: 3.75rem;
}

.hdev-custom-sticky-icons ul {
    gap: 0.8rem;
    display: flex;
    flex-direction: column;
    transition: .5s ease-in-out;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hdev-custom-sticky-icons .item {
    position: relative;
}

/* Pulse effect backgrounds */
.hdev-custom-sticky-icons .item:before,
.hdev-custom-sticky-icons .item:after {
    content: '';
    z-index: -1;
    border-radius: 50%;
    transition: .5s ease-in-out;
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% + .8125rem);
    height: calc(100% + .8125rem);
}

.hdev-custom-sticky-icons .item:before {
    background: rgba(228, 180, 119, .2);
    transform: translate(-50%, -50%) scale(1);
}

.hdev-custom-sticky-icons .item:after {
    background: rgba(0, 79, 56, .2);
    transform: translate(-50%, -50%) scale(0);
}

/* ============================================
   ICON BUTTON CONTAINER
   ============================================ */

.hdev-custom-sticky-icons .item .icon--box {
    width: 2.55rem;
    height: 2.575rem;
    position: relative;
    border-radius: 50%;
    transition: .5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translatey(0px);
    animation: hdevAniTada 2s ease-in-out infinite;
}

.hdev-custom-sticky-icons .item .icon--box img {
    max-width: 1.15rem;
    max-height: 1.15rem;
    width: auto;
    height: auto;
}

/* ============================================
   WRAP BACKGROUND GRADIENT
   ============================================ */

.hdev-custom-sticky-icons .item .wrap {
    position: relative;
    z-index: 1;
}

.hdev-custom-sticky-icons .item .wrap:before,
.hdev-custom-sticky-icons .item .wrap:after {
    content: '';
    z-index: -1;
    border-radius: 50%;
    transition: .5s ease-in-out;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

.hdev-custom-sticky-icons .item .wrap:before {
    background: linear-gradient(147deg, #c69b5d 21.71%, #ffce7b 58.16%, #c69b5d 94.62%);
    transform: translate(-50%, -50%) scale(1);
}

.hdev-custom-sticky-icons .item .wrap:after {
    background: var(--cl-main, #004f38);
    transform: translate(-50%, -50%) scale(0);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Tada bounce animation */
@keyframes hdevAniTada {
    0% {
        transform: scale(1) rotate(0deg);
    }

    10%,
    20% {
        transform: scale(0.9) rotate(-3deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(3deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(-3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================
   POPUP CONTACT FORM 7
   ============================================ */

.hdev-popup-default-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.hdev-popup-default-wrap.active {
    display: flex;
}

.hdev-popup-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.hdev-popup-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 46.25rem;
}

.hdev-popup-container .box {
    background: linear-gradient(180deg, #f3facf 0%, #eef1db 100%);
    padding: 2.375rem 5.5rem;
    position: relative;
    border-radius: 1.25rem;
}

.hdev-close-popup-btn {
    position: absolute;
    top: 1.875rem;
    right: 1.875rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.hdev-close-popup-btn:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

/* Popup heading */
.hdev-heading-title--group.center {
    text-align: center;
    margin-bottom: 1.25rem;
}

.hdev-heading-title--group .sub-title {
    font-family: var(--font-nvn, 'Georgia', serif);
    font-size: 1.875rem;
    font-weight: 400;
    color: #d4af37;
    margin: 0 0 0.5rem 0;
}

.hdev-heading-title--group .heading-title {
    font-family: var(--font-utm, 'Arial', sans-serif);
    font-size: 2.8125rem;
    font-weight: 700;
    color: #004f38;
    text-transform: uppercase;
    margin: 0;
}

/* Contact Form 7 styling */
.hdev-form-wrapper {
    margin-top: 2rem;
}

.hdev-form-wrapper .wpcf7-form p {
    margin-bottom: 1rem;
}

.hdev-form-wrapper .wpcf7-form input[type="text"],
.hdev-form-wrapper .wpcf7-form input[type="email"],
.hdev-form-wrapper .wpcf7-form input[type="tel"],
.hdev-form-wrapper .wpcf7-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d4af37;
    border-radius: 0.5rem;
    font-size: 1rem;
    background: #fff;
    transition: .3s ease;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

.hdev-form-wrapper .wpcf7-form input:focus,
.hdev-form-wrapper .wpcf7-form textarea:focus {
    outline: none;
    border-color: #004f38;
    box-shadow: 0 0 0 3px rgba(0, 79, 56, 0.1);
}

.hdev-form-wrapper .wpcf7-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* ===================================
   Contact Form 7 - Newsletter Style
   =================================== */

/* Wrapper cho form */
.hdev-form-subscribe-newsletter {
    border-radius: 1.25rem;
    position: relative;
    overflow: hidden;
}

/* Tiêu đề form */
.hdev-form-subscribe-newsletter .form-heading {
    font-family: var(--hdev-font-heading);
    color: #fff;
    font-size: 2rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
    margin: 0 0 1.875rem 0;
    position: relative;
    padding-bottom: 1rem;
}

/* Đường kẻ dưới heading */
.hdev-form-subscribe-newsletter .form-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 4.6875rem;
    height: 2px;
    background: linear-gradient(90deg, #e4b477 0%, #f7da81 50%, #e4b477 100%);
}

/* Container cho các fields */
.hdev-form-subscribe-newsletter ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hdev-form-subscribe-newsletter .hdev-form-field {
    margin: 0;
    padding: 0;
}

/* Full width fields */
.hdev-form-subscribe-newsletter .hdev-form-field-full {
    width: 100%;
}

/* Input field styling */
.hdev-form-subscribe-newsletter input[type="email"],
.hdev-form-subscribe-newsletter input[type="text"],
.hdev-form-subscribe-newsletter input[type="tel"] {
    width: 100%;
    height: 2.875rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    padding: 0;
    color: #fff;
    font-family: var(--hdev-font-sans);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    transition: border-color 0.3s ease;
    outline: none;
    box-shadow: none !important;
}

.hdev-form-subscribe-newsletter input[type="email"]::placeholder,
.hdev-form-subscribe-newsletter input[type="text"]::placeholder,
.hdev-form-subscribe-newsletter input[type="tel"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.hdev-form-subscribe-newsletter input[type="email"]:focus,
.hdev-form-subscribe-newsletter input[type="text"]:focus,
.hdev-form-subscribe-newsletter input[type="tel"]:focus {
    background: none;
    border-bottom-color: rgba(255, 206, 123, 0.8);
    outline: none;
    color: #fff;
}

/* Submit button */
.hdev-form-subscribe-newsletter input[type="submit"] {
    background: linear-gradient(90deg, #e4b477 0%, #f7da81 50%, #e4b477 100%);
    color: #004f38;
    font-family: var(--hdev-font-heading);
    font-size: 1rem;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
    border-radius: 1.25rem 0;
    padding: 0 1.625rem;
    height: 2.75rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none !important;
    outline: none;
}

.hdev-form-subscribe-newsletter input[type="submit"]:hover {
    background: linear-gradient(90deg, #f7da81 0%, #e4b477 50%, #f7da81 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 180, 119, 0.4);
}

/* WPCF7 Spinner */
.hdev-form-subscribe-newsletter .wpcf7-spinner {
    display: inline-block;
    margin-left: 0;
}

/* WPCF7 Response Messages */
.hdev-form-subscribe-newsletter .wpcf7-response-output {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hdev-form-subscribe-newsletter .wpcf7-mail-sent-ok {
    background: rgba(165, 176, 92, 0.2);
    border-color: #a5b05c;
}

.hdev-form-subscribe-newsletter .wpcf7-validation-errors,
.hdev-form-subscribe-newsletter .wpcf7-mail-sent-ng {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
}

/* Validation Error Text */
.hdev-form-subscribe-newsletter .wpcf7-not-valid-tip {
    color: #ffce7b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* ===================================
   Contact Form 7 - Custom Contact Popup  
   Class wrapper: .hdev-cf7-popup (để phân biệt với newsletter .hdev-form-subscribe-newsletter)
   =================================== */

/* Wrapper chính - áp dụng cho popup contact form */
#hdev-popup-contact .hdev-form-wrapper,
.hdev-cf7-popup {
    position: relative;
}

/* Background decorative cho popup contact box */
#hdev-popup-contact .box::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18.75rem;
    height: 18.75rem;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" fill="none"%3E%3Cpath opacity="0.1" d="M150 50C150 77.6 127.6 100 100 100C72.4 100 50 77.6 50 50C50 22.4 72.4 0 100 0C127.6 0 150 22.4 150 50Z" fill="%23004f38"/%3E%3Cpath opacity="0.08" d="M280 150C280 194.2 244.2 230 200 230C155.8 230 120 194.2 120 150C120 105.8 155.8 70 200 70C244.2 70 280 105.8 280 150Z" fill="%23a5b05c"/%3E%3Cpath opacity="0.06" d="M100 250C100 272.1 82.1 290 60 290C37.9 290 20 272.1 20 250C20 227.9 37.9 210 60 210C82.1 210 100 227.9 100 250Z" fill="%23ffce7b"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: bottom right;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

/* Đảm bảo nội dung form nằm trên background */
#hdev-popup-contact .hdev-popup-content,
#hdev-popup-contact .hdev-form-wrapper {
    position: relative;
    z-index: 1;
}

/* Container cho row 2 cột */
.hdev-cf7-popup .hdev-form-row,
#hdev-popup-contact .hdev-form-row {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0;
}

/* Field wrapper */
.hdev-cf7-popup .hdev-form-field-full,
#hdev-popup-contact .hdev-form-field-full {
    width: 100%;
}

.hdev-cf7-popup .hdev-form-field-half,
#hdev-popup-contact .hdev-form-field-half {
    flex: 1;
    min-width: 0;
}

/* Label styling */
.hdev-cf7-popup .hdev-form-field label,
#hdev-popup-contact .hdev-form-field label {
    display: block;
    color: var(--color-primary);
    font-family: var(--hdev-font-sans);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
}

.hdev-cf7-popup .hdev-form-field label .required,
#hdev-popup-contact .hdev-form-field label .required {
    color: #c90100;
    margin-left: 0.25rem;
}

/* Placeholder styling */
.hdev-cf7-popup .wpcf7-form-control::placeholder,
#hdev-popup-contact .wpcf7-form-control::placeholder {
    color: rgba(0, 79, 56, 0.5);
    font-style: italic;
}

/* Focus states */
.hdev-cf7-popup .wpcf7-form-control:focus,
#hdev-popup-contact .wpcf7-form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 79, 56, 0.1);
}

/* Textarea specific */
.hdev-cf7-popup .wpcf7-textarea,
#hdev-popup-contact .wpcf7-textarea {
    min-height: 7.5rem;
    resize: vertical;
}

/* Submit button wrapper */
.hdev-cf7-popup .hdev-form-submit,
#hdev-popup-contact .hdev-form-submit {
    margin-top: 2rem;
    text-align: center;
}

/* Submit button styling - giống style trong theme */
.hdev-cf7-popup .wpcf7-submit,
#hdev-popup-contact .wpcf7-submit {
    border-radius: 1.25rem 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    height: 3rem;
    color: var(--color-primary);
    text-align: center;
    font-family: var(--hdev-font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease-in-out;
    border: 1px solid var(--color-primary);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

/* Button hover gradient background */
.hdev-cf7-popup .wpcf7-submit::before,
#hdev-popup-contact .wpcf7-submit::before {
    content: '';
    background: linear-gradient(90deg, #e4b477 0%, #f7da81 50%, #e4b477 100%);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 100%;
    transition: 0.5s ease-in-out;
    z-index: -1;
    border-radius: 1.25rem 0;
}

.hdev-cf7-popup .wpcf7-submit:hover,
#hdev-popup-contact .wpcf7-submit:hover {
    border-color: var(--color-secondary);
    color: var(--color-primary);
}

.hdev-cf7-popup .wpcf7-submit:hover::before,
#hdev-popup-contact .wpcf7-submit:hover::before {
    right: 0;
}

/* Validation messages */
.hdev-cf7-popup .wpcf7-not-valid-tip,
#hdev-popup-contact .wpcf7-not-valid-tip {
    color: #c60000;
    font-size: 0.875rem;
    margin-top: 0.375rem;
    display: block;
}

.hdev-cf7-popup .wpcf7-response-output,
#hdev-popup-contact .wpcf7-response-output {
    margin: 1.5rem 0 0;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.9375rem;
}

.hdev-cf7-popup .wpcf7-mail-sent-ok,
#hdev-popup-contact .wpcf7-mail-sent-ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.hdev-cf7-popup .wpcf7-validation-errors,
.hdev-cf7-popup .wpcf7-mail-sent-ng,
#hdev-popup-contact .wpcf7-validation-errors,
#hdev-popup-contact .wpcf7-mail-sent-ng {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}


/* Input focus states for newsletter and form wrappers */
.hdev-form-wrapper input[type=email]:focus,
.hdev-form-subscribe-newsletter input[type=email]:focus {
    background: transparent !important;
}

/* Footer newsletter input focus */
.hdev-footer input[type=email]:focus {
    color: var(--color-white) !important;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media only screen and (max-width: 992px) {

    /* Sticky Icons */
    .hdev-custom-sticky-icons {
        right: 1rem;
        bottom: 1.875rem;
    }

    .hdev-custom-sticky-icons[data-position="left"] {
        left: 1rem;
    }

    .hdev-custom-sticky-icons .item .icon--box {
        width: 2.5rem;
        height: 2.5rem;
    }

    .hdev-custom-sticky-icons .item .icon--box img {
        max-width: 1.2rem;
        max-height: 1.2rem;
    }

    /* Popup Container */
    .hdev-popup-container .box {
        padding: 1.25rem;
    }

    .hdev-heading-title--group .sub-title {
        font-size: 1.125rem;
    }

    .hdev-heading-title--group .heading-title {
        font-size: 1.5625rem;
    }

    .hdev-close-popup-btn {
        top: 0.625rem;
        right: 0.625rem;
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }

    /* Contact Popup */
    #hdev-popup-contact .box {
        padding: 3rem 2.5rem;
    }

    #hdev-popup-contact .box::before {
        width: 15rem;
        height: 15rem;
    }
}

@media only screen and (max-width: 768px) {

    /* Sticky Icons */
    .hdev-custom-sticky-icons ul {
        gap: 0.75rem;
    }

    /* Newsletter Form */
    .hdev-form-subscribe-newsletter .form-heading {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .hdev-form-subscribe-newsletter ul {
        gap: 0.75rem;
    }

    .hdev-form-subscribe-newsletter input[type="submit"] {
        height: 2.5rem;
        font-size: 0.875rem;
        padding: 0 1rem;
        min-width: 100px;
    }

    .hdev-form-subscribe-newsletter input[type="email"],
    .hdev-form-subscribe-newsletter input[type="text"],
    .hdev-form-subscribe-newsletter input[type="tel"] {
        height: 2.5rem;
        font-size: 0.875rem;
    }

    /* Contact Popup */
    #hdev-popup-contact .box {
        padding: 2rem 1.5rem;
    }

    #hdev-popup-contact .box::before {
        width: 12.5rem;
        height: 12.5rem;
        opacity: 0.4;
    }

    /* Stack fields vertically on mobile */
    .hdev-cf7-popup .hdev-form-row,
    #hdev-popup-contact .hdev-form-row {
        flex-direction: column;
        gap: 0;
    }

    .hdev-cf7-popup .hdev-form-field-half,
    #hdev-popup-contact .hdev-form-field-half {
        width: 100%;
    }

    .hdev-cf7-popup .hdev-form-field label,
    #hdev-popup-contact .hdev-form-field label {
        font-size: 0.9375rem;
    }

    .hdev-cf7-popup .wpcf7-submit,
    #hdev-popup-contact .wpcf7-submit {
        width: 100%;
        height: 2.75rem;
        font-size: 0.9375rem;
    }
}

@media only screen and (max-width: 480px) {

    /* Newsletter Form */
    .hdev-form-subscribe-newsletter .form-heading {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .hdev-form-subscribe-newsletter ul {
        gap: 0.5rem;
    }

    .hdev-form-subscribe-newsletter input[type="submit"] {
        height: 2.25rem;
        font-size: 0.75rem;
        padding: 0 0.875rem;
        min-width: 85px;
    }

    .hdev-form-subscribe-newsletter input[type="email"],
    .hdev-form-subscribe-newsletter input[type="text"],
    .hdev-form-subscribe-newsletter input[type="tel"] {
        height: 2.25rem;
        font-size: 0.8125rem;
    }

    /* Contact Popup */
    #hdev-popup-contact .box {
        padding: 1.5rem 1rem;
    }

    #hdev-popup-contact .box::before {
        width: 9.375rem;
        height: 9.375rem;
    }

    .hdev-cf7-popup .wpcf7-textarea,
    #hdev-popup-contact .wpcf7-textarea {
        min-height: 6.25rem;
    }
}