/* Main Header Styles */
.main-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important; /* Ensure header is always on top */
  width: 100% !important;
  border-bottom: 1px solid #e5e7eb !important;
  background-color: #ffffff !important; /* Changed to white */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.main-header .container {
  display: flex !important;
  height: 64px !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

@media (min-width: 768px) {
  .main-header .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Logo Section */
.logo-section {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important; /* Reduced gap for tighter logo/text */
  flex-direction: row !important;
  flex-shrink: 0 !important;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700; /* Bolder */
  text-decoration: none;
  color: #000; /* Black color */
}

.logo-link:hover {
  color: #000;
  text-decoration: none;
}

.logo-link .icon {
  height: 24px;
  width: 24px;
  color: #000; /* Black color for icon */
}

.logo-text {
  font-size: 22px; /* Slightly larger */
  font-weight: 700; /* Bolder */
  color: #000; /* Black color */
}

/* Actions Section */
.actions-section {
  display: flex !important;
  flex: 1 !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 20px !important; /* Adjusted gap for new elements */
  flex-direction: row !important;
  flex-wrap: nowrap !important;
}

@media (min-width: 768px) {
  .actions-section {
    gap: 24px;
  }
}

.contact-link {
  color: #000; /* Black for contact link */
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-link {
  color: #000; /* Black for login link */
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-link:hover,
.login-link:hover {
  color: #333333;
  text-decoration: none;
}

.avatar-container {
  height: 36px; /* Slightly larger */
  width: 36px;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid #e0e0e0; /* Subtle border */
  cursor: pointer; /* Indicate clickable */
  transition: border-color 0.2s ease;
}

.avatar-container:hover {
  border-color: #007bff; /* Highlight on hover */
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Menu Button */
.hamburger-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #333333;
}

/* Mobile Navigation */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001;
}

.mobile-nav-container {
  position: fixed;
  top: 0;
  right: -300px; /* Start off-screen to the right */
  width: 280px; /* Width of the slide-in menu */
  height: 100%;
  background-color: #fff;
  z-index: 1002; /* Above the overlay */
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-out;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mobile-nav-container.is-open {
  right: 0; /* Slide into view */
}

.mobile-nav-close-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #333333;
  margin-bottom: 20px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.mobile-list-button {
  width: 100%;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .hamburger-menu-btn {
    display: block;
  }
  
  .contact-link,
  .login-link {
    display: none;
  }
  
  .mobile-nav-overlay.active {
    display: block;
  }
  
  .mobile-nav-container.active {
    display: block;
  }
}

/* Custom Header Styles */
.navbar-brand {
    font-weight: bold;
  }
  .nav-link.active {
    font-weight: 600;
  }
  .realtor-badge {
    background-color: #28a745;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 3px;
  }
  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-item {
    position: relative;
  }
  /* Avatar image style */
  .avatar-image-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px; /* Spacing from text */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Light border for dark navbar */
  }
  .navbar-dark .dropdown-toggle::after {
    color: rgba(255, 255, 255, 0.75); /* Dropdown arrow color */
  }
  .list-business-btn-header {
    background-color: #007bff; /* Bootstrap primary blue */
    color: white;
    border-radius: 0.25rem; /* Bootstrap default */
    padding: 0.375rem 0.75rem;
    text-decoration: none;
    font-weight: 400;
    transition: background-color 0.15s ease-in-out;
  }
  .list-business-btn-header:hover {
    background-color: #0056b3;
  }
  
  .list-business-button {
    display: inline-flex; /* Default to inline-flex for desktop */
    padding: 10px 20px;
    border-radius: 25px; /* More rounded, pill shape */
    background-color: #0c29ab; /* Black */
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    text-decoration: none; /* Ensure it's a link style */
    align-items: center;
    justify-content: center;
    font-size: 15px; /* Match nav links */
  }
  
  .list-business-button:hover {
    background-color: #001a66;
    color: #ffffff;
  }
  
  @media (max-width: 767px) {
    .list-business-button {
      display: none; /* Hide desktop list button on mobile */
    }
  }
  
  /* Refined Dropdown Menu Styles for Avatar Dropdown */
  .dropdown-menu {
    border-radius: 0.75rem; /* More rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    padding: 0.5rem 0; /* Adjust overall padding */
    border: none; /* Remove default border */
    background-color: #fff; /* Ensure white background */
    overflow: hidden; /* To make sure border-radius applies to content */
  }
  
  .dropdown-item {
    padding: 0.75rem 1.25rem; /* More generous padding */
    font-size: 1rem; /* Standard font size */
    color: #333; /* Darker text color */
    font-weight: 400; /* Normal font weight */
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  }
  
  .dropdown-item:hover,
  .dropdown-item:focus {
    background-color: #f8f9fa; /* Light grey hover background */
    color: #333; /* Keep text color dark on hover */
  }
  
  .dropdown-divider {
    margin: 0.5rem 0; /* Adjust margin for divider */
    border-top: 1px solid #e9ecef; /* Light grey divider */
  }
  
  .dropdown-item-admin {
    background-color: #f0f2f5; /* Light grey background for Admin */
    color: #333; /* Dark text color */
    font-weight: 600; /* Bolder font weight */
    border-top: 1px solid #e9ecef; /* Top border for separation */
    padding-top: 0.75rem; /* Match other items' padding */
    padding-bottom: 0.75rem; /* Match other items' padding */
    display: flex; /* For icon alignment */
    align-items: center;
  }
  
  .dropdown-item-admin:hover,
  .dropdown-item-admin:focus {
    background-color: #e2e6ea; /* Slightly darker grey on hover */
    color: #333;
  }
  
  .dropdown-item-admin .fas.fa-star {
    color: #ffc107; /* Yellow star icon */
  }
  
  /* Profile Dropdown Styles */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.profile-trigger {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.profile-trigger:hover {
    opacity: 0.8;
}

.profile-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e5e7;
    transition: border-color 0.2s ease;
}

.profile-trigger:hover .profile-avatar-img {
    border-color: #d1d1d6;
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% - 10px);
    right: 0;
    width: 160px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

/* Menu Items */
.dropdown-items {
    padding: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background-color 0.15s ease;
    border: none;
    width: 100%;
}

.dropdown-item:hover {
    background-color: #fff;
    color: #000;
    text-decoration: underline;
}

.item-icon {
    width: 14px;
    color: #666666;
    font-size: 12px;
    text-align: center;
}

.dropdown-item span {
    flex: 1;
}

/* 빈 상단 메뉴 항목 스타일 */
.empty-top-item {
    height: 20px !important;
    padding: 0 !important;
    background: transparent !important;
    cursor: default !important;
    pointer-events: none !important;
}

.empty-top-item:hover {
    background: transparent !important;
}

/* Separator */
.dropdown-separator {
    height: 1px;
    background-color: #e8e8e8;
    margin: 4px 0;
    border: none;
}

/* Admin Item Special Styling */
.admin-item {
    background: #f8f9ff;
    color: #333333 !important;
    margin: 0;
    border-radius: 0;
}

.admin-item:hover {
    background: #f0f2ff;
    color: #333333 !important;
}

.admin-item .item-icon {
    color: #ffc107 !important;
    font-size: 13px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-dropdown-menu {
        width: 150px;
        right: -5px;
    }
    
    .dropdown-header {
        padding: 10px 12px;
    }
    
    .dropdown-item {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .dropdown-user-avatar {
        width: 28px;
        height: 28px;
    }
}

/* Click outside to close dropdown */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: transparent;
    display: none;
}

.dropdown-backdrop.active {
    display: block;
}

/* Bootstrap dropdown override */
.dropdown-menu.show {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    right: 0 !important;
    left: auto !important;
    width: 160px !important;
    background: #ffffff !important;
    border-top: 0px solid #e0e0e0 !important;    
    border-left: 1px solid #e0e0e0 !important;
    border-right: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 13px 12px 0px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(0) !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.dropdown-menu.show::before {
    display: none !important;
}

.dropdown-menu.show::after {
    display: none !important;
}


.main-nav {
  display: flex; /* Default to flex for desktop */
  align-items: center;
  gap: 24px;
  font-size: 15px; /* Slightly larger */
  font-weight: 500; /* Semi-bold for menu links */
  margin-left: 30px; /* Space between logo and nav */
}

.nav-link {
  text-decoration: none;
  color: #000; /* Black color */
  transition: color 0.2s ease, text-decoration 0.2s ease; /* Add text-decoration to transition */
  font-weight: 600; /* Bolder for main nav links */
}

.nav-link:hover {
  color: #000; /* Darker grey on hover */
  text-decoration: underline; /* Underline on hover */
  text-underline-offset: 4px; /* Offset underline */
}


@media (max-width: 767px) {
  .main-nav {
    display: none; /* Hide desktop nav on mobile */
  }
}