/* ----------------------------
   General Reset & Body
---------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #e0f7fa, #f0f4f8);
  color: #222;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----------------------------
   Header
---------------------------- */
header {
  background: linear-gradient(135deg, #0a2342, #1c3c70, #3058a0);
  color: #fff;
  text-align: center;
  padding: 30px 20px;
  border-radius: 0 0 25px 25px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.05), transparent 70%);
  transform: rotate(45deg);
}

header h1 {
  font-family: 'Kanit', sans-serif;
  font-size: 2rem;
  margin-bottom: 8px;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

header p {
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem;
  opacity: 0.9;
}

/* ----------------------------
   Footer
---------------------------- */
footer {
  background: linear-gradient(135deg, #0a2342, #1c3c70, #3058a0);
  color: #fff;
  text-align: center;
  padding: 25px 15px;
  margin-top: auto;
  border-radius: 25px 25px 0 0;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle at 70% 70%, rgba(255,255,255,0.05), transparent 70%);
  transform: rotate(-30deg);
}

footer p {
  margin: 0;
  font-family: 'Sarabun', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

/* ----------------------------
   Intro Section
---------------------------- */
.intro-section {
  max-width: 900px;
  margin: 30px auto;
  padding: 25px 30px;
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  line-height: 1.8;
}

.intro-section h2 {
  font-family: 'Kanit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #1e3a8a;
  text-align: center;
}

.intro-section p {
  font-size: 1rem;
  text-align: justify;
  margin-bottom: 15px;
}

.sensor-types, .sensor-usage {
  margin-top: 20px;
  background: #f1f5f9;
  padding: 15px 20px;
  border-left: 5px solid #1e3a8a;
  border-radius: 10px;
}

.sensor-types h3, .sensor-usage h3 {
  font-family: 'Kanit', sans-serif;
  margin-top: 0;
  color: #1e3a8a;
}

.sensor-types ul {
  margin: 10px 0;
  padding-left: 20px;
}

.sensor-types li {
  margin-bottom: 8px;
}

/* ----------------------------
   Search Section
---------------------------- */
.search-section {
  text-align: center;
  margin: 20px 0;
}

#searchInput {
  width: 80%;
  max-width: 400px;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

/* ----------------------------
   Sensor Grid / Card
---------------------------- */
.sensor-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.sensor-card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.sensor-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.sensor-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.sensor-card h2 {
  margin: 0.5rem 1rem;
  font-size: 1.2rem;
}

.sensor-card p {
  margin: 0 1rem 1rem;
  font-size: 0.9rem;
}

.card-buttons {
  margin: 0 1rem 1rem;
}

.card-buttons .btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #1e3c72;
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  transition: background 0.3s;
}

.card-buttons .btn:hover {
  background: #2a5298;
}

/* ----------------------------
   Project Grid / Card
---------------------------- */
.project-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 40px auto;
  background: #f0f4f8;
  border-radius: 15px;
}

.project-section h2 {
  text-align: center;
  font-family: 'Kanit', sans-serif;
  margin-bottom: 40px;
  color: #1e3c72;
}

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.project-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.project-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.project-card-content {
  padding: 1rem;
}

.project-card-content h3 {
  margin-bottom: 0.5rem;
  color: #1e3c72;
}

.project-card-content p {
  font-size: 0.9rem;
}

/* ----------------------------
   Game Section
---------------------------- */
.game-section {
  text-align: center;
  margin: 50px 0;
}

.game-section .btn {
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, #1c3c70, #3058a0);
  color: #fff;
  border-radius: 25px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.game-section .btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: linear-gradient(135deg, #3058a0, #1c3c70);
}

/* ----------------------------
   Responsive
---------------------------- */
@media (max-width: 768px) {
  .intro-section, .project-section {
    padding: 1rem;
  }

  #searchInput {
    width: 90%;
  }

  .sensor-card img,
  .project-card img {
    height: 120px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  header p {
    font-size: 0.9rem;
  }

  .sensor-card img,
  .project-card img {
    height: 100px;
  }

  .sensor-card h2,
  .project-card-content h3 {
    font-size: 1rem;
  }

  .sensor-card p,
  .project-card-content p {
    font-size: 0.8rem;
  }

  .game-section .btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}
/* ----------------------------
   Sensor Detail Page
---------------------------- */
.sensor-detail {
  max-width: 700px;
  margin: 40px auto;
  padding: 25px 30px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}

.sensor-detail img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 20px;
}

.sensor-detail h2 {
  font-family: 'Kanit', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #1e3a8a;
}

.sensor-detail p {
  font-size: 1rem;
  margin-bottom: 12px;
  text-align: left;
  line-height: 1.7;
}

.detail-buttons {
  margin-top: 20px;
}

.detail-buttons .btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #1c3c70, #3058a0);
  color: #fff;
  text-decoration: none;
  border-radius: 25px;
  transition: all 0.3s;
}

.detail-buttons .btn:hover {
  background: linear-gradient(135deg, #3058a0, #1c3c70);
  transform: translateY(-3px) scale(1.05);
}
