* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Kanit", sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 1rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #cc0000, #ff3333);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  display: flex;
  align-items: center;
}

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #555;
  position: relative;
  transition: all 0.3s ease;
  font-weight: 500;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #cc0000, #ff3333);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

nav a:hover {
  color: #cc0000;
  transform: translateY(-2px);
}

nav a:hover::after {
  width: 100%;
}

.dropdown {
  position: relative;
  display: inline-block;
  margin-left: 1.5rem;
}

.dropdown-toggle {
  text-decoration: none;
  color: #555;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
}

.dropdown:hover .dropdown-toggle {
  color: #cc0000;
  transform: translateY(-2px);
  
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.5rem 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  color: #555;
  transition: all 0.2s ease;
  margin: 0;
  border-radius: 8px;
}

.dropdown-menu a:hover {
  color: linear-gradient(135deg, #cc0000, #ff3333);;
  transform: translateX(5px);
}

.dropdown-menu a::after {
  display: none;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.search-section {
  text-align: center;
  margin-bottom: 3rem;
}

.search-section h1 {
  font-size: 2.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #333, #666);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 2rem;
}

#search-box {
  width: 100%;
  padding: 1.2rem 3rem 1.2rem 2rem;
  font-size: 1.1rem;
  font-family: "Kanit", sans-serif;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  outline: none;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

#search-box:focus {
  border-color: #cc0000;
  box-shadow: 0 8px 32px rgba(204, 0, 0, 0.2);
  transform: translateY(-2px);
}

#search-box::placeholder {
  color: #999;
  font-style: italic;
}

.search-container::after {
  content: '🔍';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
  opacity: 0.6;
}

.categories-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.category-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.category-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #cc0000;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-icon {
  font-size: 1.5rem;
}

.help-topics {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-topic {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.help-topic:last-child {
  border-bottom: none;
}

.help-topic.hidden {
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  border-bottom: none;
  overflow: hidden;
  transition: all 0.3s ease;
}

.help-topic {
  opacity: 1;
  max-height: 60px;
  transition: all 0.3s ease;
}

.help-topic:hover {
  color: #cc0000;
  padding-left: 1rem;
  background: linear-gradient(90deg, rgba(204, 0, 0, 0.05) 0%, transparent 100%);
}

.help-topic::before {

  position: absolute;
  left: -1rem;
  opacity: 0;
  transition: all 0.2s ease;
  color: #cc0000;
}

.help-topic:hover::before {
  opacity: 1;
  left: 0;
}

.show-more-btn {
  background: linear-gradient(135deg, #6c757d, #adb5bd);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-family: "Kanit", sans-serif;
  font-size: 0.9rem;
  margin-top: 1rem;
  width: 100%;
  transition: all 0.3s ease;
  font-weight: 500;
}

.show-more-btn:hover {
  background: linear-gradient(135deg, #5a6268, #95a2aa);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.show-more-btn.expanded {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.show-more-btn.expanded:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.topic-detail {
  display: none;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideDown 0.3s ease;
}

.topic-detail.active {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topic-detail h4 {
  color: #cc0000;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.topic-detail p {
  margin-bottom: 1rem;
  color: #555;
  line-height: 1.8;
}

.topic-detail .response-template {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 18px;
  margin: 1rem 0;
}

.response-template img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-top: 10px;
  margin-bottom: 30px;
  border-radius: 10px;
  box-shadow: 0 0px 8px rgba(0, 0, 0, 0.1);
}

.copy-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Kanit", sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-style: italic;
}

@media (max-width: 768px) {
  .search-section h1 {
    font-size: 2rem;
  }

  #search-box {
    padding: 1rem 2.5rem 1rem 1.5rem;
    font-size: 1rem;
  }

  .search-container::after {
    right: 1rem;
  }

  .categories-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .category-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .search-section h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 1rem;
  }

  .category-card {
    padding: 1rem;
  }
}

/* เพิ่ม CSS สำหรับ highlight ผลการค้นหา */
.help-topic.highlighted {
  background: linear-gradient(90deg, rgba(204, 0, 0, 0.15) 0%, transparent 100%);
  border-left: 3px solid #cc0000;
  padding-left: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}