/* Reset & Base */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url('images/bg1.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #f5c518;
  -webkit-font-smoothing: antialiased; 
  -moz-osx-font-smoothing: grayscale; 
} 
a {
  color: #f5c518;
  text-decoration: none;
}
a:hover {
  color: #d1a800;
}

/* Header */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  background-color: rgba(0, 0, 0, 0.75);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo img {
  height: 40px;
  user-select: none;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  padding: 0;
  margin: 0;
}
nav ul li {
  font-weight: 700;
}
nav ul li a {
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}
nav ul li a:hover,
nav ul li a:focus {
  background-color: #d1a800;
  color: #222;
  outline: none;
}

/* Home Section */
.home-container {
  max-width: 1000px;
  margin: 30px auto;
  display: flex;
  gap: 30px;
  padding: 0 15px;
  align-items: flex-start;
  justify-content: center;
}
.video-trailer,
.slideshow-container {
  width: 480px;
  height: 270px;
  background-color: #222;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 15px rgba(245, 197, 24, 0.8);
}
.video-trailer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  border-radius: 12px;
}
.slide.active {
  opacity: 1;
}
.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: #f5c518;
  cursor: pointer;
  user-select: none;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  transition: background-color 0.3s ease;
  z-index: 5;
}
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.6);
}
.prev {
  left: 10px;
}
.next {
  right: 10px;
}

/* Features Section */
.features-section {
  max-width: 960px;
  margin: 40px auto;
  padding: 20px 25px;
  background-color: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  color: #f5c518;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 600;
}
.features-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffd54f;
  text-align: center;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}
.features-section ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0;
}
.features-section ul li {
  margin-bottom: 12px;
  color: #fffacd;
  font-weight: 500;
}

/* Download Section */
#download {
  max-width: 960px;
  margin: 40px auto;
  padding: 25px 20px;
  background-color: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  color: #f5c518;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 600;
  text-align: center;
}
#download h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffd54f;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* ปรับแต่งปุ่มดาวน์โหลดให้น่ากด */
#download .btn {
  background: linear-gradient(135deg, #f5c518, #d1a800);
  color: #222;
  font-weight: 700;
  padding: 15px 35px;
  border-radius: 35px;
  cursor: pointer;
  transition: 
    background 0.4s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease;
  user-select: none;
  max-width: 220px;
  margin: 0 auto;
  display: inline-block;
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.6);
  text-shadow: 0 0 5px rgba(255 255 255 / 0.3);
  letter-spacing: 1px;
  font-size: 1.2rem;
}

#download .btn:hover,
#download .btn:focus {
  background: linear-gradient(135deg, #d1a800, #f5c518);
  box-shadow: 0 8px 30px rgba(209, 168, 0, 0.9);
  color: #111;
  outline: none;
  transform: scale(1.05);
}

#download p,
#download .download-item p {
  color: #fffacd;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 10px;
}
.download-sections {
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 25px;
}
.download-item {
  background-color: rgba(245, 197, 24, 0.15);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgb(245 197 24 / 0.3);
  padding: 15px 20px;
  width: 250px;
  text-align: center;
  color: #222;
  font-weight: 600;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.download-item img {
  max-width: 64px;
  margin: 0 auto;
}

/* News Section */
.news-section {
  max-width: 960px;
  margin: 40px auto 60px auto;
  padding: 20px 25px;
  background-color: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  color: #f5c518;
}
.news-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffd54f;
  text-align: center;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}
.news-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}
.news-filters .filter {
  background-color: transparent;
  border: 2px solid #f5c518;
  border-radius: 20px;
  color: #f5c518;
  font-weight: 600;
  padding: 6px 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
}
.news-filters .filter.active,
.news-filters .filter:hover {
  background-color: #f5c518;
  color: #222;
}
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}
.news-item {
  background-color: #222;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  gap: 15px;
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.6);
  transition: transform 0.3s ease;
}
.news-item:hover {
  transform: translateY(-6px);
}
.news-img {
  flex-shrink: 0;
  width: 140px;
  height: 100px;
  background-size: cover;
  background-position: center;
  border-radius: 12px 0 0 12px;
}
.news-content {
  padding: 12px 15px;
  color: #fffacd;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.news-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd54f;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}
.news-content p {
  margin: 0 0 8px 0;
  line-height: 1.4;
  font-weight: 500;
  color: #fffacd;
}
.news-content time {
  font-size: 0.85rem;
  color: #f5c518;
  font-weight: 600;
}
.detail-link {
  align-self: flex-start;
  font-weight: 700;
  color: #d1a800;
  text-decoration: underline;
}
.detail-link:hover {
  color: #f5c518;
}

/* แท็กประเภทข่าว */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  user-select: none;
}
.tag.news {
  background-color: #2196f3;
  color: #fff;
}
.tag.event {
  background-color: #ff5722;
  color: #fff;
}
.tag.announce {
  background-color: #9c27b0;
  color: #fff;
}
.tag.patch {
  background-color: #4caf50;
  color: #fff;
}

/* ปุ่ม ดูทั้งหมด */
.see-all {
  display: block;
  margin: 30px auto 0 auto;
  max-width: 140px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 20px;
  padding: 8px 0;
  border: 2px solid #f5c518;
  background-color: transparent;
  color: #f5c518;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
}
.see-all:hover {
  background-color: #f5c518;
  color: #222;
}

/* Modal */
.modal {
  display: none; /* ซ่อน */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.85);
  backdrop-filter: blur(3px);
}
.modal-content {
  background-color: #111;
  margin: 50px auto 100px auto;
  padding: 25px 30px;
  border-radius: 16px;
  max-width: 700px;
  box-shadow: 0 0 40px #f5c518;
  color: #f5c518;
  position: relative;
}
.close {
  position: absolute;
  right: 25px;
  top: 20px;
  font-size: 2rem;
  color: #f5c518;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.close:hover {
  color: #d1a800;
}
.download-modal h2,
.download-modal h3,
.download-modal h4 {
  margin-top: 0;
  font-weight: 700;
  color: #ffd54f;
}
.download-modal ul {
  list-style: disc inside;
  padding-left: 0;
  margin: 0 0 20px 0;
}
.download-modal hr {
  border-color: #d1a800;
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 1100px) {
  .home-container {
    flex-wrap: wrap;
    justify-content: center;
  }
  .video-trailer,
  .slideshow-container {
    width: 90vw;
    height: 50vw;
    max-height: 300px;
  }
  .download-sections {
    flex-direction: column;
    align-items: center;
  }
  .download-item {
    width: 80vw;
    max-width: 350px;
  }
}



/* Custom Alert Styles */
.custom-alert {
    position: fixed;
    top: 20px;
    right: -300px;
    padding: 12px 20px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    opacity: 0.95;
    z-index: 9999;
    transition: right 0.3s ease-in-out;
}
.custom-alert.show {
    right: 20px;
}
.custom-alert.success {
    background-color: #28a745;
}
.custom-alert.error {
    background-color: #dc3545;
}
.custom-alert.warning {
    background-color: #ffc107;
    color: #000;
}
.custom-alert.info {
    background-color: #17a2b8;
}


/* --- Toast alerts --- */
#toast-stack { pointer-events: none; }
.toast-item {
  pointer-events: auto;
  min-width: 220px;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #0e1116;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.2);
  background: #e6f4ea;
  transition: opacity .3s ease;
}
.toast-item + .toast-item { margin-top: 0; }
.toast-success { background: #b7f0c2; color:#0e1116; }
.toast-danger  { background: #ffd1d1; color:#3b0c0c; }
.toast-warning { background: #ffe9b6; color:#3a2200; }
.toast-info    { background: #cfe8ff; color:#0d243a; }

