/* Updated CSS for Library System */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #f9f9f9;
    --text-color: #333;
    --navbar-color: #2c3e50;
    --sidebar-color: #2c3e50;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
}

/* Base Styles */
body {
    font-family: 'Kanit', sans-serif;
    margin: 0;
    padding: 0;
    background-color: transparent;
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: 1.5;
}




/* Sidebar */
.sidebar {
    width: 20%;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 0 15px 15px 0;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.sidebar h3 {
    margin-top: 0;
    font-size: calc(var(--font-size-large) + 8px);
    font-weight: bold;
    text-transform: uppercase;
    text-align: left;
    color: white;
    background-color: #25438e;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(12, 14, 79, 0.2);
}

/* Sidebar Links */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    font-size: calc(var(--font-size-base) + 3px);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar ul li a:hover {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}


/* Main Content */
.container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: 100%;
    background-color: transparent;
}

.main {
    width: 80%;
    padding: 15px 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    margin: 0;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
    margin-top: 20px;
}

.search-bar form {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 10px;
}

.search-bar input[type="text"] {
    flex: 3;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.search-bar button {
    flex: 1;
    padding: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* ลดขนาดเล็กน้อยเพื่อแสดงหนังสือมากขึ้น */
    gap: 20px; /* ลดช่องว่างระหว่างการ์ด */
    margin-top: 20px;
    padding: 0; /* ลบ padding */
}

/* Book Cards */
.book-card {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card h4 {
    font-size: 1.1rem;
    color: #25438e;
    text-decoration: underline;
    text-decoration-color: #25438e;
    margin-bottom: 10px;
}
  
.book-card p {
    font-size: var(--font-size-small);
    margin: 5px 0;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px var(--card-shadow);
}

.add-to-cart {
    display: inline-block;
    padding: 8px 12px;
    background-color: #3498db;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: var(--secondary-color);
}


/* Card Styles */
.card {
    max-width: 400px;
    margin: auto;
    padding: 30px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    text-align: center;
    background-color: #fff;
}
.card h2 {
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.card form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.card form button {
    width: 100%;
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 1rem;
}

.card form button:hover {
    background: #3498db;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.navbar ul li form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* Cart Page Specific Styles */

/* Cart Table */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 4px 10px var(--card-shadow);
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    height: auto; /* ปรับความยาวตารางให้ยืดหยุ่น */
    table-layout: auto; /* ให้ตารางขยายตามเนื้อหา */
}

/* ขยายขนาดตัวอักษรในหัวตารางและข้อมูล */
.cart-table th,
.cart-table td {
    padding: 20px;  /* เพิ่มพื้นที่ภายในเซลล์ */
    text-align: center;
    border: 1px solid #ddd;
    height: 80px; /* เพิ่มความสูงของแถวเพื่อให้หนังสือมีพื้นที่มากขึ้น */
}

/* ขนาดฟอนต์สำหรับหัวตาราง */
.cart-table th {
    background-color: var(--navbar-color);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.2rem; /* ปรับขนาดฟอนต์ใหญ่ขึ้น */
}

/* ขนาดฟอนต์สำหรับข้อมูลในตาราง */
.cart-table td {
    font-size: 1.1rem; /* เพิ่มขนาดฟอนต์ */
    vertical-align: middle;
}

/* เน้นแถวคู่เพื่อให้ง่ายต่อการอ่าน */
.cart-table tr:nth-child(even) {
    background-color: #fff;
}

/* ขนาดของภาพในตาราง */
.cart-table img.cart-img {
    max-width: 120px; /* ขยายขนาดภาพ */
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px var(--card-shadow);
}

/* ปรับขนาดปุ่ม Proceed to Borrow */
.proceed-to-borrow {
    font-size: 1.2rem; /* เพิ่มขนาดฟอนต์ปุ่ม */
    padding: 12px 20px; /* เพิ่มขนาดปุ่ม */
}

/* เพิ่มระยะห่างระหว่างแถว */
.cart-table tr {
    line-height: 1.8; /* เพิ่มระยะห่างระหว่างบรรทัด */
}

/* ปรับขนาดของคอลัมน์ให้เหมาะสม */
.cart-table th, .cart-table td {
    min-width: 150px; /* กำหนดความกว้างขั้นต่ำ */
    max-width: 200px; /* กำหนดความกว้างสูงสุด */
    width: auto; /* ให้คอลัมน์ยืดหยุ่นตามเนื้อหา */
}

/* ปรับขนาดคอลัมน์ที่เหมาะสมสำหรับแต่ละคอลัมน์ */
.cart-table th:nth-child(1), .cart-table td:nth-child(1) {
    width: 20%; /* เพิ่มขนาดคอลัมน์ภาพ */
}

.cart-table th:nth-child(2), .cart-table td:nth-child(2) {
    width: 30%; /* ขยายคอลัมน์ชื่อหนังสือ */
}

.cart-table th:nth-child(3), .cart-table td:nth-child(3) {
    width: 15%; /* คอลัมน์จำนวน */
}

.cart-table th:nth-child(4), .cart-table td:nth-child(4) {
    width: 20%; /* คอลัมน์รวม */
}

.cart-table th:nth-child(5), .cart-table td:nth-child(5) {
    width: 15%; /* คอลัมน์ปุ่ม */
}



/* Quantity Form */
.quantity-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.quantity-btn {
    background-color:#3498db;
    border: none;
    color: white;
    font-size: var(--font-size-small);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: var(--secondary-color);
}

.quantity {
    font-weight: bold;
    color: var(--text-color);
    font-size: var(--font-size-base);
}

/* Remove Button */
.remove-btn {
    background-color: #e74c3c;
    border: none;
    color: white;
    font-size: var(--font-size-small);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.remove-btn:hover {
    background-color: #b33325;
}
.proceed-to-borrow {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db; /* สีหลัก */
    color: white; /* สีตัวอักษร */
    font-size: var(--font-size-base);
    text-align: center;
    text-decoration: none;
    border: none; /* ลบเส้นขอบ */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.proceed-to-borrow:hover {
    background-color: #2980b9; /* สีรอง */
}

.proceed-to-borrow:disabled {
    background-color: #bdc3c7; /* Disabled color */
    cursor: not-allowed;
}
:root {
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --border-color: #e0e0e0;
    --background-light: #f5f7fa;
    --text-primary: #2c3e50;
    --text-secondary: #546e7a;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
}
.container-cart {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background-color: transparent;
}


.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 500;
}

.status-ดำเนินการ { 
    color: white;
    background-color: #3498db;
}
.status-ยกเลิก { 
    color: white;
    background-color: var(--warning-color);
}
.status-สำเร็จ { 
    color: white;
    background-color: var(--success-color);
}

.due-date-section {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.dates-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 0.9em;
    color: #2c3e50;
}

.date-value {
    font-weight: 500;
    color: #1a237e;
}

.date-value.highlight {
    color:#1a237e;
    font-weight: 600;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background-color: #e8f5e9;
    margin-top: 8px;
}

.status-info.warning {
    background-color: #fff3e0;
}

.status-info.danger {
    background-color: #ffebee;
}

.remaining-days {
    font-weight: 500;
}

.overdue, .fine {
    color: var(--danger-color);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 48px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
    transform: translateY(-2px);
}

.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #e8f5e9;
    border-left: 4px solid var(--success-color);
    color: #2e7d32;
}

.alert-danger {
    background-color: #ffebee;
    border-left: 4px solid var(--danger-color);
    color: #c62828;
}

/* CSS สำหรับ Loader */
.loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex; /* กำหนดเป็น flexbox */
flex-direction: column; /* spinner อยู่ด้านบนข้อความ */
align-items: center;
justify-content: center;
background-color: rgba(255, 255, 255, 0.8);
z-index: 9999;
backdrop-filter: blur(5px); /* ทำให้พื้นหลังเบลอ */
}

.loader .spinner {
width: 60px; /* ขยายขนาดของ spinner */
height: 60px; /* ขยายขนาดของ spinner */
border: 6px solid #f3f3f3;
border-top: 6px solid #1a237e;
border-radius: 50%;
animation: spin 1s linear infinite;
}

.loader p {
margin-top: 16px; /* ระยะห่างจาก spinner */
font-size: 1.2em;
color: #3498db;
font-weight: bold;
text-align: center;
}

/* การทำ spin */
@keyframes spin {
from {
    transform: rotate(0deg);
}
to {
    transform: rotate(360deg);
}
}

/* Banner Section */
.banner {
    width: 100%;
    height: 580px; /* ปรับความสูงตามต้องการ */
    background-image: url('images/TSU_Banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

* Footer Styles */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}
footer {
    background-color: var(--navbar-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    width: 100%;
    margin-top: 100px;
}
.footer-container {
    flex: 1; /* ขยายพื้นที่ว่างระหว่างเนื้อหากับ footer */
    padding-bottom: 50px; /* เพิ่มช่องว่างก่อนถึง Footer */
}
.footer-header {
    margin-bottom: 24px;
}
.footer-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.647); /* เพิ่มเงาให้ตัวอักษร */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-menu, .footer-contact, .footer-social {
    width: calc(33.333% - 20px);
}

.footer-menu h3,
.footer-contact h3,
.footer-social h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.647); /* เพิ่มเงาให้ตัวอักษร */
}

.footer-menu ul {
    list-style: none;
    padding: 0;
}

.footer-menu ul li {
    margin-bottom: 8px;
}

.footer-menu ul li a {
    color: white;
    text-decoration: none;
}

.footer-menu ul li a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.footer-contact p {
    margin: 8px 0;
}
.map-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.map-link:hover {
    text-decoration: underline;
}

.footer-social i {
    color: #fefefe; /* สีฟ้า Facebook */
    font-size: 30px; /* ขนาดไอคอน */
    transition: color 0.3s ease; /* เพิ่มเอฟเฟกต์การเปลี่ยนสี */
  }

  .footer-social i:hover {
    color: #7a9eec; /* สีเมื่อ Hover */
  }
  .footer-bottom {
    text-align: center;
    margin-top: 40px;
    font-size: 0.9rem;
    border-top: 1px solid var(--secondary-color);
    padding-top: 20px;
    color: white;
}
.footer-bottom p {
    margin: 0px;
}




