/* --- LAYOUT RESET --- */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #fff;
  color: #333;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- HEADER WRAPPER --- */
.header-wrapper {
  flex-shrink: 0;
  z-index: 20; /* Z-index tinggi agar dropdown search di atas konten */
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: relative;
}

.desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  border-bottom: 1px solid #eee;
}
.desktop-header img {
  height: 45px;
}
.desktop-header a {
  text-decoration: none;
  color: #222;
  font-size: 16px;
}

.mobile-header {
  display: none;
  background: #5a9600;
  color: white;
  padding: 15px 20px;
  justify-content: space-between;
  align-items: center;
}
.mobile-header .logo {
  font-size: 22px;
  font-weight: bold;
}
.menu-icon {
  border: 2px solid white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
}

/* --- SEARCH BAR (HERO) --- */
.hero {
  background: #5a9600;
  padding: 20px 0;
  text-align: center;
  transition: all 0.3s ease;
  position: relative; /* Penting untuk positioning dropdown */
}

.search-wrapper {
  position: relative;
  width: 55%;
  max-width: 700px;
  margin: 0 auto;
}

.hero input {
  width: 100% !important;
  padding: 12px 20px 12px 20px;
  padding-right: 45px; /* Space for loader/x */
  border-radius: 35px;
  border: none;
  font-size: 16px;
  outline: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  box-sizing: border-box; /* Agar padding tidak merusak width */
}

/* Loading Spinner */
.search-loader {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-top-color: #5a9600;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
@keyframes spin {
  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* Tombol Clear */
.search-clear {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #999;
  font-size: 16px;
  display: none;
}

/* --- SEARCH RESULTS DROPDOWN (BARU) --- */
.search-dropdown {
  position: absolute;
  top: 100%; /* Tepat di bawah input */
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 10px; /* Sedikit rounded */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* Shadow lebih tebal agar terlihat melayang */
  margin-top: 8px;
  z-index: 1000;
  text-align: left; /* Reset text align */
  max-height: 400px; /* Batas tinggi agar bisa di-scroll */
  overflow-y: auto;
  display: none; /* Default hidden */
  border: 1px solid #eee;
}

/* Custom Scrollbar dropdown */
.search-dropdown::-webkit-scrollbar {
  width: 6px;
}
.search-dropdown::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.search-result-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
}
.search-result-card:last-child {
  border-bottom: none;
}
.search-result-card:hover {
  background: #f9f9f9;
}

.search-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background: #eee;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}

.search-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.search-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #444;
}
.search-badge {
  font-size: 11px;
  background: #eef5ff;
  color: #2b6aff;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  font-weight: 500;
}

.highlight-text {
  background-color: #fff3cd;
  color: #856404;
  font-weight: bold;
  padding: 0 2px;
}

/* --- CONTAINER --- */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 300px;
  background: #fff;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 5;
}
.sidebar-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 10px;
}

.sidebar-header {
  font-size: 14px;
  font-weight: bold;
  padding: 10px 10px;
  cursor: pointer;
  color: #555;
  border-radius: 6px;
  background: #f9f9f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.sidebar-section.open .sidebar-list {
  display: block;
  margin-bottom: 15px;
}
.sidebar-list {
  display: none;
  padding-left: 5px;
}

.menu-item {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #555;
  font-size: 14px;
}
.menu-item:hover {
  background: #f0f0f0;
}
.menu-item.active {
  background: #eef5ff;
  color: #2b6aff;
  font-weight: bold;
}

/* --- CONTENT --- */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px;
  position: relative;
  background: #fff;
}
.breadcrumb {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}
.title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.2;
}

.share-buttons {
  margin-bottom: 25px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.share-buttons a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f5f5;
  color: #555;
  text-decoration: none;
  transition: all 0.2s ease;
}
.share-buttons a:hover {
  background: #5a9600;
  color: #fff;
}

footer {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid #eee;
  margin-top: 50px;
  font-size: 14px;
  color: #999;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: none;
}
#overlay.show {
  display: block;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .desktop-header {
    display: none;
  }
  .mobile-header {
    display: flex;
  }

  /* Agar dropdown search di mobile lebar full mengikuti input */
  .search-wrapper {
    width: 90%;
  }
  .hero {
    display: block;
    padding: 15px 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 85%;
    max-width: 320px;
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .content {
    padding: 20px;
  }
  .title {
    font-size: 24px;
  }
}
