body {
  font-family: "Kanit", sans-serif;
  margin: 0;
  padding: 0;
  text-align: left;
  
}

/* แถบบนสุด */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f8f8;
  padding: 5px 20px;
  font-size: 14px;
  border-bottom: 1px solid #ddd;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.top-right input[type="text"] {
  padding: 5px;
  font-size: 14px;
}

/* Header */
header {
  background-color: #fff;
  padding: 20px;
}

/* โลโก้และชื่อวิทยาลัย */
.header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding-left: 240px;
}

.logo {
  height: 80px;
}

/* เมนู */
nav ul.main-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  padding: 10px 0;
  margin: 0;
}

nav li {
  position: relative;
}

nav a {
  text-decoration: none;
  color: #000;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #1da1f2;
}

/* เมนูย่อย */
nav ul.submenu {
  display: none;
  position: absolute;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 10px 0;
  margin: 0;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 1000;
}

nav li.dropdown:hover .submenu {
  display: block;
}

nav ul.submenu li {
  padding: 5px 20px;
}

nav ul.submenu li a {
  color: #000;
  text-decoration: none;
  display: block;
  white-space: nowrap;
}

nav ul.submenu li a:hover {
  background-color: #f0f0f0;
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  background: #fff;
}

.marquee {
  display: inline-block;
  white-space: nowrap;
  padding: 10px 0;
  font-size: 16px;
  font-weight: 600;
  animation: marquee 20s linear infinite;
  color: #333;
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Section หลัก */
.info-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  padding: 20px;
  background-color: #f9f9f9;
  flex-wrap: wrap;
  margin-top: 0;
}

.info-left-carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-track img {
  width: 100%;
  flex-shrink: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
  font-size: 24px;
  border-radius: 50%;
  transition: color 0.3s ease;
}

.carousel-btn:hover {
  color: #79292C;
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

.info-right {
  max-width: 1200px;
  width: 100%;
  text-align: center;
}

.director-photo {
  width: 60%;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.info-right h3 {
  margin-bottom: 15px;
  font-size: 20px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-right p {
  font-size: 16px;
  color: #000;
  line-height: 1.5;
  text-align: left;
}

/* ข่าว */
.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.news-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  transition: 0.3s ease;
  text-align: left;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Media Query สำหรับมือถือ */
@media screen and (max-width: 768px) {
  .top-bar,
  .top-left,
  .top-right,
  .header-content,
  nav ul.main-menu {
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    text-align: left;
  }

  .top-right input[type="text"] {
    width: 100%;
    max-width: 250px;
  }

  nav ul.main-menu {
    gap: 12px;
  }

  .info-section {
    flex-direction: column;
    margin-top: 20px;
  }

  .info-left-carousel {
    scale: 1;
    margin-left: 0;
    margin-top: 0;
  }

  .info-right {
    margin-left: 0;
    margin-top: 20px;
    width: 90%;
    text-align: left;
  }

  .marquee {
    font-size: 14px;
  }

  .news-container {
    grid-template-columns: 1fr;
  }
}
.input-group {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.input-group input.form-control {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    background-color: #fff;
}

.input-group input.form-control::placeholder {
    color: #aaa;
}

.input-group button.btn {
    background-color: #79292C;
    color: #fff;
    padding: 12px 20px;
    border: none;
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.input-group button.btn:hover {
    background-color: #a33b3e;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.book-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.book-card img {
    max-width: 70%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}
.book-card p {
  /* margin-left: 10vh; */
  margin: 6px 15px;
  font-size: 14px;
  line-height: 1.4;
}

.book-card p strong {
  color: #79292C;
}
.card-buttons {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.card-buttons .btn {
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    color: #fff;
    font-size: 14px;
}

.card-buttons .btn-warning {
    background-color: #f0ad4e;
}

.card-buttons .btn-danger {
    background-color: #d9534f;
}

.card-buttons .btn:hover {
    opacity: 0.8;
}
.btn-clear {
  background-color: #d9534f;
  color: #fff;
  border: none;
  padding: 8px 16px;
  /* border-radius: 5px; */
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-decoration: none;
  display: inline-flex;          /* ใช้ flex ช่วยจัดกลาง */
  justify-content: center;       /* จัดแนวนอน */
  align-items: center;           /* จัดแนวตั้ง */
  height: 38px;                  /* ให้สูงเท่าปุ่ม input ถ้าใช้ Bootstrap */
  min-width: 60px;              /* กำหนดความกว้างขั้นต่ำ */
  text-align: center;
}

.btn-clear:hover {
  background-color: #d9534f;
  color: #fff;
}

.btn.btn-success {
  background-color: #28a745; /* เขียวสด */
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s, transform 0.2s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn.btn-success:hover {
  background-color: #218838; /* เขียวเข้มขึ้นตอน hover */
  transform: translateY(-2px);
}

.btn.btn-success:active {
  background-color: #1e7e34; /* เขียวเข้มสุดตอนกด */
  transform: translateY(0);
}

.btn-borrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #79292C; /* สีแดงเข้ม */
  color: white;
  padding: 10px 20px;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-borrow i {
  font-size: 18px;
}

.btn-borrow:hover {
  background-color: #a04245; /* สีแดงอ่อนเมื่อ hover */
  text-decoration: none;
  color: white;
}

.btn-borrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #79292C; /* สีแดงเข้ม */
  color: white;
  padding: 10px 20px;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-borrow i {
  font-size: 18px;
}

.btn-borrow:hover {
  background-color: #a04245; /* สีแดงอ่อนเมื่อ hover */
  text-decoration: none;
  color: white;
}
