/* style yang dipakai bareng di hampir semua halaman: warna, navbar, footer, dll */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Times New Roman', serif;
  background-color: #FFFFFF;
  overflow-x: hidden;
}

/* navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 40px;
  background: #DCEAD3;
  flex-wrap: wrap;
}

.navbar-logo {
  display: flex;
  align-items: center;
}

.navbar-logo img {
  height: 35px;
  width: auto;
}

.navbar a {
  text-decoration: none;
  margin: 0 10px;
  color: #20291C;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.navbar a:hover {
  background: rgba(22, 41, 28, 0.10);
}

.navbar a.nav-active {
  background: #6FA46A;
  color: rgb(0, 0, 0);
  font-weight: bold;
  border-radius: 8px;
}

.navbar a.logout-btn {
  background: #b02a2a;
  color: #FFFFFF;
  border-radius: 8px;
}

.navbar a.logout-btn:hover {
  background: #8a1f1f;
}

.nav-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: rgba(22, 41, 28, 0.25);
  margin: 0 8px;
  vertical-align: middle;
}

/* section (dipakai index.php & product.php) */
.section {
  background-color: #FFFFFF;
  padding: 60px 40px;
}

.section h2 {
  text-align: center;
  font-family: 'Times New Roman', serif;
  font-size: 40px;
  margin-bottom: 80px;
  color: #16301F;
}

/* card dasar (dipakai index.php, jadi basis product.php) */
.card {
  background: #DCEAD3;
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  width: 250px;
  height: 320px;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(22, 48, 31, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(22, 48, 31, 0.14);
}

.card img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

/* tombol slider (dipakai product.php & training.php) */
.training-btn,
.prev-btn,
.next-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #16301F;
  background: #FFFFFF;
  font-size: 40px;
  cursor: pointer;
  transition: 0.3s;
}

.training-btn:hover,
.prev-btn:hover,
.next-btn:hover {
  background: #16301F;
  color: #FFFFFF;
}

/* footer contact (dari contact.php, muncul di index/about/product/training) */
.contact {
  background: #FFFFFF;
  padding: 30px 40px;
  font-family: 'Times New Roman', Times, serif;
  display: flex;
  justify-content: center;
}

.contact-wrap {
  max-width: 1000px;
  width: 100%;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 8px 4px;
  font-size: 12px;
  color: #5B6B54;
}

.footer-meta a {
  color: #5B6B54;
  text-decoration: none;
}

.footer-meta a:hover {
  text-decoration: underline;
}

.contact-container {
  background: #6FA46A;
  border-radius: 18px;
  padding: 28px 32px;
  max-width: 1000px;
  width: 100%;
  display: flex;
  gap: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.contact-info {
  flex: 1;
  padding-right: 30px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.35);
}

.contact-info h2 {
  font-size: 28px;
  font-family: 'Times New Roman', serif;
  color: #16301F;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 3px solid #2E5233;
  display: inline-block;
}

.contact-info p {
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.5;
  color: #16301F;
}

.contact-info i {
  font-size: 16px;
  margin-right: 8px;
  color: #16301F;
}

.contact-info a {
  text-decoration: none;
  color: #16301F;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-map {
  flex: 1;
  padding-left: 30px;
  display: flex;
  flex-direction: column;
}

.map-label {
  font-family: 'Times New Roman', serif;
  font-size: 14px;
  font-weight: bold;
  color: #16301F;
  margin: 0 0 10px;
}

.contact-map iframe {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* tombol AI mengambang (dari navbar.php, ada di semua halaman) */
.ai-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2E5233;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 4px 15px rgba(22, 41, 28, 0.25);
  z-index: 9999;
  user-select: none;
  transition: box-shadow 0.3s;
}

.ai-float:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ai-float img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  pointer-events: none;
}

.ai-chatbox {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 320px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Times New Roman', serif;
}

.ai-chatbox.open {
  display: flex;
}

.ai-chat-header {
  background: #2E5233;
  color: #FFFFFF;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.ai-close {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  cursor: pointer;
}

.ai-chat-messages {
  padding: 14px;
  height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFFFFF;
}

.ai-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ai-msg.bot {
  background: #DCEAD3;
  color: #16301F;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ai-msg.user {
  background: #2E5233;
  color: #FFFFFF;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-msg.loading {
  background: #F1F7ED;
  color: #5B6B54;
  align-self: flex-start;
  font-style: italic;
}

.ai-chat-input {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1px solid #C9D6C0;
  background: #FFFFFF;
}

.ai-chat-input input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #DCEAD3;
  font-size: 14px;
  font-family: 'Times New Roman', serif;
  outline: none;
}

.ai-chat-input input:focus {
  border-color: #2E5233;
}

.ai-chat-input button {
  background: #2E5233;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.ai-chat-input button:hover {
  background: #16301F;
}

/* responsive */
@media screen and (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
  }

  .navbar div {
    text-align: center;
  }

  .navbar a {
    display: inline-block;
    margin: 5px 10px;
    font-size: 16px;
  }

  .section {
    padding: 50px 20px;
  }

  .section h2 {
    font-size: 32px;
    margin-bottom: 40px;
  }

  .training-btn,
  .prev-btn,
  .next-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  .contact {
    padding: 20px 15px;
  }

  .contact-container {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .contact-info {
    padding-right: 0;
    border-right: none;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.35);
    padding-bottom: 20px;
  }

  .contact-info h2 {
    font-size: 24px;
  }

  .contact-info p {
    font-size: 14px;
  }

  .contact-map {
    padding-left: 0;
    width: 100%;
  }

  .contact-map iframe {
    height: 200px;
  }
}
