body {
    font-family: 'IBM Plex Sans Thai', sans-serif;
    background-color: var(--background-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    line-height: 1.6;
    color: var(--text-dark);
}
/* body {
    background-image: url('../images/background.png'); 
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    min-height: 100vh; 
} */
:root {
    --primary-blue: #1D3D70; /* สีน้ำเงินเข้มจากโปสเตอร์ */
    --light-blue: #00A2E8;   /* สีฟ้าจากโลโก้ AOT */
    --accent-yellow: #F7D32E; /* สีเหลืองเน้นจากโปสเตอร์ */
    --background-light: #e6f0f5; /* สีพื้นหลังอ่อนๆ คล้ายท้องฟ้า */
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-grey: #7f8c8d;
    --border-color: #cccccc;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --focus-glow: rgba(0, 162, 232, 0.2);
}
.form-wrapper {
    background-color: var(--text-light);
    border-radius: 12px;
    box-shadow: 0 8px 25px var(--shadow-light);
    max-width: 500px;
    width: 100%;
    overflow: hidden; /* เพื่อให้ border-radius แสดงผลที่ header ด้วย */
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.mb-3 {
    margin-bottom: 0.1rem !important;
}
.form-header {
    background-color: var(--primary-blue);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

.form-header img {
    max-width: 250px; /* เพิ่มขนาดโลโก้ให้เด่นขึ้น */
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3)); /* เพิ่มเงาให้โลโก้ */
}

.form-header h1 {
    font-size: 2.8em; /* ขนาดใหญ่ขึ้น */
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}
.form-header h2 {
    font-size: 1em; /* ขนาดใหญ่ขึ้น */
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-header p {
    font-size: 1.2em;
    margin-bottom: 0;
    font-weight: 300;
}

.form-body {
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 25px; /* ระยะห่างระหว่าง Form Section */
}
.submit-btn {
    background-color: var(--accent-yellow);
    color: var(--primary-blue); /* ใช้สีน้ำเงินเข้มจาก header */
    padding: 18px 45px;
    border: none;
    border-radius: 10px;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(247, 211, 46, 0.4);
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background-color: #e0be29; /* สีเหลืองเข้มขึ้น */
    transform: translateY(-3px);
    box-shadow: 0 9px 20px rgba(247, 211, 46, 0.5);
}



@media (max-width: 500px) {
    .form-wrapper {
        margin: 0 10px; /* ลด margin ด้านข้างบนมือถือ */
    }
    .form-header h1 {
        font-size: 2em;
    }
    .form-header p {
        font-size: 1em;
    }
    .form-body {
        padding: 20px;
        gap: 20px;
    }
    .form-section {
        padding: 20px;
    }
    .form-section h2 {
        font-size: 1.5em;
    }
    .form-group input, .form-group select, .form-group textarea {
        padding: 10px;
    }
    .submit-btn {
        width: 100%;
        padding: 15px 25px;
        font-size: 1.2em;
    }
    .privacy-note {
        font-size: 0.85em;
    }
}

/* เพิ่ม CSS สำหรับตารางที่นี่ */
.table-responsive {
    overflow-x: auto; 
    /* อาจจะไม่ต้องปรับอะไรเพิ่มเติมหากใช้ Bootstrap 5.x อย่างถูกต้อง */
}

.table td, .table th {
    /* ทำให้ข้อความในเซลล์สามารถตัดบรรทัดได้ตามความจำเป็น */
    word-wrap: break-word; /* สำหรับเบราว์เซอร์เก่า */
    overflow-wrap: break-word; /* สำหรับเบราว์เซอร์ใหม่ */
    /* white-space: nowrap; */
    white-space: nowrap;
}
.table th:nth-child(3), /* สำหรับคอลัมน์ 'ชื่อ' */
.table td:nth-child(3),
.table th:nth-child(4), /* สำหรับคอลัมน์ 'นามสกุล' */
.table td:nth-child(4) {
    white-space: nowrap; /* ป้องกันไม่ให้ข้อความตัดบรรทัด */
}

.table th:nth-child(1), .table td:nth-child(1) {
    position: sticky;
    left: 0;
    background-color: var(--bs-table-bg); /* ใช้สีพื้นหลังของตาราง Bootstrap */
    z-index: 2; /* ให้คอลัมน์ที่ sticky อยู่ด้านบนสุด */
    border-right: 1px solid var(--bs-border-color); /* เพิ่มเส้นขอบเพื่อแยกคอลัมน์ */
}

.table th:nth-child(2), .table td:nth-child(2) {
    position: sticky;
    left: var(--col1-width, 50px); /* ต้องกำหนด left ตามความกว้างของคอลัมน์แรก */
    background-color: var(--bs-table-bg);
    z-index: 2;
    border-right: 1px solid var(--bs-border-color);
}

.table th:nth-child(3), .table td:nth-child(3) {
    position: sticky;
    left: calc(var(--col1-width, 50px) + var(--col2-width, 100px)); /* left = กว้างคอลัมน์1 + กว้างคอลัมน์2 */
    background-color: var(--bs-table-bg);
    z-index: 2;
    border-right: 1px solid var(--bs-border-color);
}

.table th:nth-child(4), .table td:nth-child(4) {
    position: sticky;
    left: calc(var(--col1-width, 50px) + var(--col2-width, 100px) + var(--col3-width, 150px)); /* left = กว้างคอลัมน์1 + กว้างคอลัมน์2 + กว้างคอลัมน์3 */
    background-color: var(--bs-table-bg);
    z-index: 2;
    border-right: 1px solid var(--bs-border-color);
}

/* หากต้องการให้หัวตาราง sticky ด้วย (ไม่เกี่ยวกับ scroll แนวนอน แต่เป็นแนวตั้ง) */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 3; /* สูงกว่า z-index ของ sticky column ใน tbody */
    background-color: var(--bs-table-bg); /* ใช้สีพื้นหลังของตาราง Bootstrap */
}
/* ผสมผสาน sticky ของหัวตารางกับ sticky column */
.table thead th:nth-child(1),
.table thead th:nth-child(2),
.table thead th:nth-child(3),
.table thead th:nth-child(4) {
    z-index: 4; /* สูงกว่า z-index ของ sticky column ใน tbody และ sticky header ปกติ */
}

/* กำหนดความกว้างเริ่มต้นสำหรับคอลัมน์ที่ fixed
   ค่าเหล่านี้อาจต้องปรับตามเนื้อหาจริงของคุณ
   คุณสามารถใช้ JavaScript เพื่อคำนวณความกว้างจริงของแต่ละคอลัมน์แล้วตั้งค่าเป็น Custom Property ได้
*/
.table th:nth-child(1), .table td:nth-child(1) { width: 50px; min-width: 50px; } /* # */
.table th:nth-child(2), .table td:nth-child(2) { width: 100px; min-width: 100px; } /* คำนำหน้า */
.table th:nth-child(3), .table td:nth-child(3) { width: 150px; min-width: 150px; } /* ชื่อ */
.table th:nth-child(4), .table td:nth-child(4) { width: 150px; min-width: 150px; }

/* หากคอลัมน์ใดมีเนื้อหาเยอะมาก และต้องการจำกัดความกว้าง */
/* ตัวอย่าง: สำหรับคอลัมน์ Email หรือที่อยู่ */
.table th:nth-child(7), /* สำหรับ Email (คอลัมน์ที่ 7) */
.table td:nth-child(7) {
    max-width: 180px; /* กำหนดความกว้างสูงสุด เช่น 180px */
}

.table th:nth-child(10), /* สำหรับที่อยู่ (คอลัมน์ที่ 10) */
.table td:nth-child(10) {
    max-width: 250px; /* กำหนดความกว้างสูงสุด เช่น 250px */
}
.table th:nth-child(1), .table td:nth-child(1) { width: 50px; min-width: 50px; } /* # */
.table th:nth-child(2), .table td:nth-child(2) { width: 100px; min-width: 100px; } /* คำนำหน้า */
.table th:nth-child(3), .table td:nth-child(3) { width: 150px; min-width: 150px; } /* ชื่อ */
.table th:nth-child(4), .table td:nth-child(4) { width: 150px; min-width: 150px; } /* นามสกุล */
