body {
    font-family: 'Noto Sans Thai', sans-serif;
    margin: 0;
    padding: 0;
    background: url('images/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
}
/* Navigation Bar */
nav {
    background-color: #062146;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

nav .logo {
    display: flex;
    align-items: center;
    font-size: 26px;
    font-weight: bold;
}

nav .logo img {
    margin-right: 10px;
    width: 50px;
    height: 50px;
}

nav .menu {
    display: flex;
    gap: 15px;
}

/* Link Effects */
nav .menu a {
    position: relative;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    overflow: hidden; 
    transition: color 0.3s ease;
}

nav .menu a::before {
    content: '';
    position: absolute;
    bottom: 0; 
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,0,150,1) 0%, rgba(0,204,255,1) 100%);
    transform: scaleX(0); 
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 0;
}

nav .menu a:hover::before {
    transform: scaleX(1);
}

nav .menu a.active {
    color: #f0f0f0;
    font-weight: bold;
}

nav .menu a.active::before {
    transform: scaleX(1);
}

/* Main Heading */
h1 {
    color: rgb(255, 255, 255);
    text-align: center;
    margin: 50px auto;
    font-size: 35px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 img {
    width: 30px;
    height: 30px;
    margin-left: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.question-bar {
    background-color: #062146;
    padding: 20px 15px;
    margin: 30px auto 0;
    border-radius: 20px 20px 0 0;
    width: 79%;
    text-align: left;
    display: flex;
    align-items: center;
    box-shadow: -5px 0px 10px rgba(0, 0, 0, 0.4), 5px 0px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    margin-bottom: 0;
}

/* สไตล์หัวข้อ */
.question-bar h1 {
    color: white;
    font-size: 26px;
    margin: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.977);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.search-container label {
    margin-right: 10px;
}

.search-container input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #031d42;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-container input:focus {
    border-color: #063D8C;
    box-shadow: 0 0 8px rgba(0, 91, 187, 0.6);
}

/* Table Styling */
.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background-color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: center;
}

th {
    background-color: #062146;
    color: white;
    font-size: 16px;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Button Styling */
.button-container {
    text-align: center;
    margin-top: 20px;
}

button {
    background-color: #062146;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
}

button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    border: 1px solid #888;
    border-radius: 10px;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    margin: 5% auto;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-container {
        justify-content: flex-start;
        width: 100%;
    }
}

/* Pagination Styling */
.pagination {
    margin-top: 10px;
    text-align: right;
}

.pagination-link {
    margin: 0 5px;
    color: #007BFF;
    cursor: pointer;
    text-decoration: underline;
}

.pagination-link:hover {
    color: #0056b3;
}