/* เรียกใช้งานฟอนต์จาก Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Krub:wght@400;700&display=swap');

/* ตั้งค่าพื้นฐานสำหรับตัวหนังสือ */
body {
    font-family: 'Krub', sans-serif;
    font-size: 19px;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #343a40;
    margin: 0;
    padding: 0;
    /* 🚩 Path อ้างอิงจากโฟลเดอร์ css/ ไปยัง images/wallpaper-01.jpg (ห้ามแก้ไข) */
    background-image: url('../images/wallpaper-01.jpg'); 
    background-size: cover;
    background-attachment: fixed;
}

/* การจัดการสำหรับ container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    /* ปรับปรุงความโปร่งแสงเล็กน้อยเพื่อให้เห็น Wallpaper ชัดขึ้น */
    background: rgba(255, 255, 255, 0.95); 
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* การจัดสไตล์ Header */
h1 {
    font-size: 2rem;
    color: #007bff; /* ใช้สีธีมหลัก (เดิมคือ #495057) */
    text-align: center;
    margin-bottom: 20px;
}

/* ตั้งค่าการแสดงผลสำหรับตาราง */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px; /* ปรับจาก 18px เป็น 16px เพื่อให้ข้อมูลในตารางพอดี */
    text-align: left;
}

table th, table td {
    border: 1px solid #dee2e6;
    padding: 12px 15px;
}

table th {
    background-color: #007bff; /* ใช้สีธีมหลัก */
    color: white;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

/* สไตล์สำหรับปุ่มลบ (ใช้ในไฟล์อื่น) */
table img {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    width: 20px;
    height: 20px;
}

table img:hover {
    transform: scale(1.2);
}

/* สไตล์สำหรับ Modal Popup (ใช้ในไฟล์อื่น) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: auto; 
    padding: 20px;
    border-radius: 10px;
    width: 90%; 
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-buttons button.close {
    background-color: #f44336;
    color: white;
}

.modal-buttons button.close:hover {
    background-color: #d32f2f;
}

.modal-buttons button.confirm {
    background-color: #4CAF50;
    color: white;
}

.modal-buttons button.confirm:hover {
    background-color: #388E3C;
}

/* สไตล์สำหรับปุ่มปิด Modal */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* สไตล์สำหรับ Pagination (ใช้ในไฟล์อื่น) */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.pagination-link {
    text-decoration: none; 
    color: #007bff;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: #f8f9fa;
    border: 0.1px solid #dee2e6;
    font-size: 0.875rem; 
    transition: background-color 0.3s, color 0.3s;
}

.pagination-link:hover {
    background-color: #007bff;
    color: white;
}

.pagination-link.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* -------------------------------------------------- */
/* 🚩 สไตล์เพิ่มเติมสำหรับ queue.php (คิวเผยแพร่) */
/* -------------------------------------------------- */

.action-container { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.unit-list { 
    max-height: 150px; 
    overflow-y: auto; 
    border: 1px solid #ccc; 
    padding: 10px; 
    border-radius: 4px;
    background-color: #f9f9f9;
}
.unit-list label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: normal; 
    font-size: 16px;
}

.action-btn { 
    padding: 8px 12px; 
    background-color: #28a745; /* สีเขียวสำหรับปุ่มเผยแพร่ */
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.3s;
    width: 100%; 
    box-sizing: border-box;
}
.action-btn:hover { 
    background-color: #218838; 
}
.action-btn.view { 
    background-color: #007bff; /* สีน้ำเงินสำหรับปุ่มดูไฟล์ */
}
.action-btn.view:hover { 
    background-color: #0056b3; 
}
.no-records { 
    text-align: center; 
    color: #6c757d; 
    padding: 20px; 
    font-size: 1.2em; 
    border: 1px dashed #ccc;
    border-radius: 5px;
    margin-top: 20px;
}