/* พื้นฐานของหน้า */


/* หัวเรื่อง */
h1 {
    text-align: center;
    margin-top: 30px;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 600;
}

/* ฟอร์ม Dropdown */
form {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    padding: 10px;
    background-color: #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

form label {
    margin-right: 10px;
    font-size: 1rem;
    font-weight: bold;
    color: #34495e;
}

form select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 1px solid #34495e;
    border-radius: 4px;
    outline: none;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form select:hover, form select:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

/* ตาราง */
/* ตาราง */
table {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 12px;
    background-color: #222;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    table-layout: fixed; /* เพิ่ม table-layout ให้คอลัมน์มีขนาดคงที่ */
}

thead th {
    background-color: #222;
    color: #ffffff;
    text-transform: uppercase;
    padding: 15px;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid #444;
    transition: background-color 0.3s ease;
}

tbody tr:nth-child(odd) {
    background-color: #333;
}

tbody tr:hover {
    background-color: #111;
}

th, td {
    padding: 12px 15px;
    text-align: center;
    font-size: 0.9rem;
    word-wrap: break-word; /* บังคับให้ตัดคำ */
    max-width: 200px; /* ความกว้างสูงสุดของคอลัมน์ */
    overflow: hidden; /* ซ่อนข้อความส่วนที่เกิน */
    text-overflow: ellipsis; /* แสดง ... เมื่อข้อความยาวเกิน */
    white-space: nowrap; /* ป้องกันข้อความยาวเกินจนบรรทัดใหม่ */
}

/* กรณีให้ข้อความตัดเป็นบรรทัด (แทน ... ) */
td.break-word {
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
}


/* Pagination */
.pagination {
    text-align: center;
    margin: 20px auto;
}

.pagination a {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 12px;
    color: #fff;
    text-decoration: none;
    border: 1px solid #333;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a.active {
    background-color: #222;
    color: white;
    font-weight: bold;
}

.pagination a:hover {
    background-color: #2980b9;
    color: white;
}

/* สำหรับหน้าจอขนาดเล็ก */
@media (max-width: 768px) {
    table {
        width: 95%;
    }

    th, td {
        font-size: 0.8rem;
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    form select {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
}
