﻿/* --- CSS HIỆN ĐẠI CHO POPUP (Xu hướng 2025) --- */

/* 1. Định nghĩa biến màu (CSS Variables)
   Giúp bạn dễ dàng thay đổi màu sắc chủ đạo
*/
:root {
    --color-primary: #007aff; /* Màu xanh dương hiện đại */
    --color-primary-dark: #0056b3;
    --color-error: #f44336;
    --color-heading: #1d2129;
    --color-text: #495057;
    --color-text-light: #868e96;
    --color-border: #dee2e6;
    --color-bg-light: #f8f9fa;
    --color-bg-white: #ffffff;
}

/* 2. Lớp nền mờ (Backdrop) - Hiệu ứng "Glassmorphism"
   Đây là xu hướng rất thịnh hành
*/
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Hiệu ứng kính mờ */
    background: rgba(25, 25, 25, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 9998;
    /* Trạng thái ẩn (dùng cho animation) */
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 3. Khung Popup chính - Bo góc mềm & Bóng đổ tinh tế */
#popup-contact-form {
    position: fixed;
    top: 50%;
    left: 50%;
    /* Trạng thái ẩn (dùng cho animation) */
    display: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 9999;
    background: var(--color-bg-white);
    /* Bo góc 16px rất "mềm" và hiện đại */
    border-radius: 16px;
    /* Bóng đổ đa lớp, tinh tế hơn */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px; /* Kích thước tối ưu cho form */
    overflow: hidden;
    /* Animation khi xuất hiện */
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

    /* 4. Trạng thái HIỆN (khi JS thêm class '.show') */
    #popup-overlay.show,
    #popup-contact-form.show {
        display: block; /* Hiện ra */
    }

#popup-overlay.show {
    opacity: 1;
}

#popup-contact-form.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 5. Nút đóng (X) - Thiết kế lại tinh tế */
#popup-contact-form .btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f1f3f5;
    color: var(--color-text-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: all 0.3s ease;
    /* (class flex-center của bạn) */
    display: flex;
    justify-content: center;
    align-items: center;
}

    #popup-contact-form .btn-close:hover {
        background: var(--color-error);
        color: var(--color-bg-white);
        transform: rotate(90deg) scale(1.1);
    }

/* 6. Nội dung Form - Tăng cường "Whitespace" (không gian trắng) */
#popup-contact-form .item.form {
    width: 100%;
}

#popup-contact-form .lefts {
    width: 100%;
    /* Thêm nhiều đệm để form "dễ thở" hơn */
    padding: 2.5rem;
    box-sizing: border-box;
}

#popup-contact-form .form-group {
    width: 100%;
    padding-top: 17px;
}

/* 7. Typography (Tiêu đề, thông tin) */
#popup-contact-form .heading {
    font-size: 1.8rem; /* Cỡ chữ to, rõ ràng */
    font-weight: 700;
    color: var(--color-heading);
    margin-top: 0;
    margin-bottom: 2.5rem;
    text-align: center;
}

#popup-contact-form .form-group ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0; /* Tăng khoảng cách dưới */
    color: var(--color-text-light);
    font-size: 0.95rem;
    text-align: center;
}

    #popup-contact-form .form-group ul li {
        margin-bottom: 0.5rem;
    }

/* 8. Bố cục Input (Xếp chồng)
   Bỏ qua .left, .right và cho tất cả 100% 
*/
#popup-contact-form .form-group .left,
#popup-contact-form .form-group .right {
    width: 100%;
}

#popup-contact-form .form-group .right {
    margin-top: 1rem;
}

/* 9. Input & Textarea (Quan trọng nhất cho UX) */
#popup-contact-form .input {
    /* margin-bottom: 1rem; */
    position: relative;
}

    #popup-contact-form .input input[type="text"],
    #popup-contact-form .input textarea {
        width: 100%;
        padding: 14px 16px; /* Tăng padding bên trong */
        font-size: 1rem; /* Cỡ chữ dễ đọc */
        color: var(--color-text);
        background-color: var(--color-bg-light); /* Nền xám nhẹ */
        border: 1px solid var(--color-border);
        border-radius: 10px; /* Bo góc 10px */
        box-sizing: border-box;
        transition: all 0.3s ease;
        -webkit-appearance: none; /* Tắt style mặc định của mobile */
    }

    #popup-contact-form .input textarea {
        min-height: 80px;
        resize: vertical;
    }

        /* Hiệu ứng khi nhấp (Focus) vào Input */
        #popup-contact-form .input input[type="text"]:focus,
        #popup-contact-form .input textarea:focus {
            outline: none;
            border-color: var(--color-primary);
            background-color: var(--color-bg-white);
            /* Thêm "vòng sáng" (glow) hiện đại */
            box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
        }

/* 10. Lỗi Validator (ASP.NET) */
#popup-contact-form .erolh {
    color: var(--color-error);
    font-size: 0.875rem;
    display: block;
    padding-top: 5px;
    padding-left: 5px;
}

/* 11. Nút Gửi (Button) - Thêm hiệu ứng */
#popup-contact-form .btn-sumid-contact {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-bg-white);
    background: var(--color-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    margin-top: 19px;
}
    /* Hiệu ứng "nhấc" (lift) khi hover */
    #popup-contact-form .btn-sumid-contact:hover {
        background: var(--color-primary-dark);
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 123, 255, 0.2);
    }

/* 12. Responsive (Rất quan trọng)
   Trên mobile, popup sẽ chiếm toàn màn hình
*/
@media (max-width: 576px) {
    #popup-contact-form {
        width: 95%;
        height: 62%;
        max-width: 100%;
        top: 0;
        left: 0;
        transform: none; /* Reset vị trí */
        border-radius: 4;
        overflow-y: auto; /* Cho phép cuộn form */
    }

    /* Sửa lại animation cho mobile */
    #popup-contact-form {
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }

        #popup-contact-form.show {
            transform: translate(3%, 25%);
        }

        #popup-contact-form .lefts {
            padding: 2rem 1.5rem; /* Giảm padding trên mobile */
        }

        #popup-contact-form .btn-close {
            top: 20px;
            right: 20px;
        }
}
