/* --- CSS CHUNG CHO MODAL --- */
.modal {
    display: none; /* Mặc định ẩn */
    position: fixed;
    z-index: 1000; /* Tăng z-index nếu cần để nổi trên các element khác */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Cho phép cuộn nếu nội dung modal dài hơn màn hình */
    background-color: rgba(0,0,0,0.2); /* Lớp phủ mờ hơn một chút */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal *, 
.modal *::before, 
.modal *::after {
    box-sizing: border-box;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease-out; /* Animation khi hiện */
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.text-red-400 {
    color: red;
}

.modal-content {
    background: linear-gradient(to bottom, rgba(90, 86, 86, 0.35) 0%, #1a1a1a 50%, #1a1a1a 100%);
    margin: auto;
    padding: 25px 30px 40px; /* Giữ nguyên padding */
    border-radius: 2rem; /* Thay đổi giá trị này để bo tròn nhiều hơn hoặc ít hơn */
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Tăng độ đậm bóng đổ */
    color: #e3e6eb;  /* Màu chữ cơ bản trong modal */
    max-height: 90vh; /* Giới hạn chiều cao */
    overflow-y: auto; /* Cho phép cuộn nội dung bên trong nếu dài */
    overflow-x: hidden;
    opacity: 1;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out; /* Animation khi đóng */
}

.modal:not(.active) .modal-content { /* Animation khi ẩn đi */
    opacity: 0;
    transform: scale(0.95);
}

.checkbox-round {
    width: 1.6em;
    height: 1em;
    background-color: white;
    border-radius: 50%;
    vertical-align: middle;
    border: 2px solid #ddd;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}
        
.checkbox-round:checked {
    background-color: gray;
}

/* Scrollbar styling for WebKit browsers (Chrome, Safari, Edge) to remove white bar */
.modal-content::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

.modal-content::-webkit-scrollbar-track {
    background: #1E202C; /* Background of the scrollbar track, match modal content background */
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #4A5568; /* Color of the scrollbar thumb (the draggable part), a darker gray */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid #1E202C; /* Padding around the thumb, match modal content background */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #6B7280; /* Lighter gray on hover */
}


/* --- Header của Modal --- */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #33394D; /* Màu đường kẻ từ event-detail */
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: #F8FAFC; /* slate-50 từ event-detail */
    line-height: 1.2;
}

.close-button {
    color: #94A3B8; /* gray-400 */
    font-size: 1.8rem; /* Tăng kích thước nút X */
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    padding: 0.25rem; /* Thêm chút padding để dễ click hơn */
}

.close-button:hover,
.close-button:focus {
    color: #F8FAFC; /* slate-50 */
    text-decoration: none;
    transform: rotate(90deg); /* Hiệu ứng xoay khi hover */
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem; /* Khoảng cách dưới label */
    font-weight: 500; /* medium */
    font-size: 0.875rem; /* text-sm */
    color: #ffffff; /* gray-400 từ event-detail */
}
.modal-body {
    overflow-x: hidden;
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="tel"],
.modal-body textarea{
    width: 100%;
    padding: 0.6rem 1rem; /* py-3 px-4 */
    margin-bottom: 1rem; /* Khoảng cách giữa các trường input */
    background-color: #4b4c4d; /* gray-800, nền tối cho input */
    border: 1px solid #4A5568; /* gray-600, viền input */
    border-radius: 0.8rem; /* rounded-md */
    color: #E2E8F0; /* slate-200, màu chữ trong input */
    font-size: 0.9rem; /* Hơi nhỏ hơn text-base một chút */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: block;
}

.modal-content #reg_ticket_selection_modal, #modal-predefined-questions-container select{ 
    background-color: #4b4c4d; /* gray-800, nền tối cho input */
    border: 1px solid #4A5568; /* gray-600, viền input */
    border-radius: 0.8rem; /* rounded-md */
    color: #ffffff; /* slate-200, màu chữ trong input */
    font-size: 0.9rem; /* Hơi nhỏ hơn text-base một chút */
    cursor: pointer;
    appearance: none !important; /* Loại bỏ style mặc định của browser */
    /*-webkit-appearance: none !important;*/
    /*-moz-appearance: none !important;*/
}


.modal-body input[type="text"]:focus,
.modal-body input[type="email"]:focus,
.modal-body input[type="tel"]:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #4F46E5; /* indigo-600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3); /* Ring effect */
}

.modal-body textarea {
    min-height: 80px;
    resize: vertical; /* Cho phép resize theo chiều dọc */
}

/* --- Footer của Modal --- */
.modal-footer {
    padding-top: 1.5rem;
    text-align: center;
}

.modal-footer .btn-submit-registration {
    background: linear-gradient(90deg, #262626 0%, #868686 100%);
    box-shadow: -2px -4px 15px rgba(0, 0, 0, 0.45), inset 0 2px 6px rgba(220, 220, 220, 0.11);
    color: white;
    padding: 1rem 1.7rem;
    border-radius: 15px; 
    transition: transform 0.3s ease;
    font-size: 20px;
    border: none;
    margin-left: auto;
    margin-right: auto;
    font-weight: 700;
    cursor: pointer;
}