/* Navbar Styles - navbar.css */

/* General Navbar */
.navbar-custom {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: fixed;
  padding: 15px 0;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Scrolled state */
.navbar-custom.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
}

.navbar-brand img {
  max-height: 30px;
  width: auto;
  transition: all 0.3s ease;
}

.navbar-custom.scrolled .navbar-brand img {
  max-height: 30px;
}

.navbar-nav .nav-link {
  color: #4b5563 !important;
  font-weight: 450;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #26a375;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 80%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #26a375 !important;
}

/* Dropdown styling */
.navbar-nav .dropdown-toggle::after {
  display: none !important;
}

.navbar-nav .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

/* Custom caret */
.navbar-nav .dropdown-toggle::before {
  content: "▼";
  font-size: 10px;
  color: #6b7280 !important;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.navbar-nav .dropdown-toggle[aria-expanded="true"]::before {
  transform: rotate(180deg);
}

/* Search Box */
.search-box {
  position: relative;
  width: 300px;
  max-width: 100%;
}

.search-input {
  width: 100%;
  padding: 10px 45px 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #f8fafc;
}

.search-input:focus {
  border-color: #26a375;
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(38, 163, 117, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.search-icon:hover {
  color: #26a375;
  background-color: rgba(38, 163, 117, 0.1);
}

.search-box:hover .search-icon,
.search-input:focus + .search-icon {
  color: #26a375;
}

/* Dropdown Menu */
.dropdown-menu {
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin-top: 8px;
  padding: 8px 0;
  max-height: 100px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 12px 20px;
  color: #4b5563;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 0;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #26a375;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.dropdown-item:hover {
  background-color: #f0fdfa;
  color: #26a375;
  padding-left: 24px;
}

.dropdown-item:hover::before {
  transform: scaleY(1);
}

.dropdown-item.active {
  background-color: #e6fffa;
  color: #26a375;
  font-weight: 500;
}

/* Mobile toggler */
.navbar-toggler {
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(38, 163, 117, 0.25);
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2838, 163, 117, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 24px;
  height: 24px;
}

/* Body padding */
body {
  padding-top: 85px;
}

/* Large screens (desktops) */
@media (min-width: 1200px) {
  .search-box {
    width: 350px;
  }
  
  .navbar-custom {
    padding: 20px 0;
  }
  
  body {
    padding-top: 90px;
  }
}

/* Medium to large screens (tablets landscape, small desktops) */
@media (max-width: 1199px) and (min-width: 992px) {
  .search-box {
    width: 280px;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
  }
}

/* Tablets and small laptops */
@media (max-width: 991px) {
  .navbar-custom {
    padding: 12px 0;
  }
  
  /* Hide desktop search, show mobile search */
  .d-none.d-lg-block {
    display: none !important;
  }
  
  /* Mobile search styling */
  .mobile-search {
    display: block !important;
    margin: 15px 0;
    padding: 0 15px;
  }
  
  .mobile-search .search-box {
    width: 100%;
  }
  
  .navbar-nav {
    margin-top: 10px;
    padding: 0 15px;
  }
  
  .navbar-nav .nav-link {
    padding: 12px 15px;
    border-radius: 8px;
    margin: 2px 0;
    font-size: 1rem;
  }
  
  .navbar-nav .nav-link:hover {
    background-color: #f0fdfa;
    transform: translateX(5px);
  }
  
  .navbar-nav .nav-link::after {
    display: none;
  }
  
  .navbar-nav .nav-link.active {
    background-color: #e6fffa;
    color: #26a375 !important;
    font-weight: 500;
  }
  
  /* Mobile dropdown styling */
  .navbar-nav .dropdown-toggle::before {
    margin-left: auto;
    margin-right: 8px;
  }
  
.dropdown-menu {
  border: none;
  box-shadow: none;
  background-color: #f8fafc;
  margin: 5px 0 10px 15px;
  border-radius: 8px;
  padding: 5px 0;

  max-height: 250px; /* batas tinggi */
  overflow-y: auto;  /* scroll kalau lebih panjang */
}

  
  .dropdown-item {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  
  .dropdown-item:hover {
    padding-left: 20px;
  }
  
  /* Mobile menu container */
  .navbar-collapse {
    background-color: white;
    border-radius: 12px;
    margin-top: 10px;
    padding: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  }
  
  body {
    padding-top: 75px;
  }
}

/* Mobile phones (portrait) */
@media (max-width: 768px) {
  .navbar-custom {
    padding: 10px 0;
  }
  
  .navbar-brand img {
    max-height: 45px;
    width: 100px;
  }
  
  .navbar-custom.scrolled .navbar-brand img {
    max-height: 40px;
    width: 90px;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .navbar-nav .nav-link {
    font-size: 1.1rem;
    padding: 14px 15px;
  }
  
  body {
    padding-top: 70px;
  }
}

/* Small mobile phones */
@media (max-width: 576px) {
  .navbar-custom {
    padding: 8px 0;
  }
  
  .navbar-brand img {
    max-height: 40px;
    width: 85px;
  }
  
  .navbar-custom.scrolled .navbar-brand img {
    max-height: 35px;
    width: 75px;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .mobile-search {
    padding: 0 10px;
  }
  
  .search-input {
    padding: 12px 45px 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .navbar-nav {
    padding: 0 10px;
  }
  
  .navbar-nav .nav-link {
    padding: 15px 10px;
  }
  
  .navbar-collapse {
    margin-top: 8px;
    padding: 15px 0;
  }
  
  body {
    padding-top: 65px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .navbar-brand img {
    max-height: 35px;
    width: 75px;
  }
  
  .navbar-custom.scrolled .navbar-brand img {
    max-height: 30px;
    width: 65px;
  }
}

/* Landscape orientation for phones */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 500px) {
  body {
    padding-top: 60px;
  }
  
  .navbar-custom {
    padding: 6px 0;
  }
  
  .navbar-brand img {
    max-height: 35px;
  }
  
  .navbar-collapse {
    max-height: 300px;
    overflow-y: auto;
  }
}

/* Smooth animations */
html {
  scroll-behavior: smooth;
}

.navbar-collapse {
  transition: all 0.35s ease;
}

/* Loading and performance optimizations */
.navbar-brand img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Focus styles for accessibility */
.nav-link:focus,
.dropdown-item:focus,
.search-input:focus,
.navbar-toggler:focus {
  outline: 0px solid #26a375;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .navbar-custom {
    border-bottom: 2px solid #000;
  }
  
  .nav-link {
    color: #000 !important;
  }
  
  .nav-link:hover,
  .nav-link.active {
    color: #26a375 !important;
    font-weight: 600;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}