/* Part 1: Topbar */
.topbar {
  background: linear-gradient(90deg, #121212 0%, #1c1c1c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 13px;
  padding: 10px 0;
  position: relative;
  z-index: 10003;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-links {
  font-size: 0; /* Hide text node dividers | */
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-links span,
.topbar-links a {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Specific styling for guest links */
.topbar-links a[href*="login"] {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.topbar-links a[href*="login"]:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.topbar-links a[href*="register"] {
  background: var(--yp);
  color: #121212 !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(212, 160, 23, 0.25);
}

.topbar-links a[href*="register"]:hover {
  background: #ffffff;
  color: #121212 !important;
  box-shadow: 0 6px 15px rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.topbar-links a[href*="faq"],
.topbar-links a[href*="help"] {
  color: rgba(255, 255, 255, 0.65);
}

.topbar-links a[href*="faq"]:hover,
.topbar-links a[href*="help"]:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Dynamic styling for logged in user */
.topbar-links span {
  background: rgba(74, 222, 128, 0.15); /* Soft emerald/mint tint matching the brand text */
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #e2e8f0;
  padding: 6px 16px;
  border-radius: 30px;
  font-weight: 500;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}
.topbar-links span b {
  color: #fff;
  font-weight: 700;
  margin-left: 2px;
}

.topbar-links a[href*="dashboard"],
.topbar-links a[href*="admin"] {
  background: linear-gradient(135deg, var(--green), #2d8a4e);
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 10px rgba(27, 107, 58, 0.2);
}

.topbar-links a[href*="dashboard"]:hover,
.topbar-links a[href*="admin"]:hover {
  background: #124d29;
  color: #fff !important;
  box-shadow: 0 6px 15px rgba(27, 107, 58, 0.4);
  transform: translateY(-1px);
}

.topbar-links a[onclick*="logout"] {
  background: #0A3319;
  color: #fff !important;
  font-weight: 600;
  border: none;
}

.topbar-links a[onclick*="logout"]:hover {
  background: #061f0f;
  color: #ff6b6b !important;
  transform: translateY(-1px);
}

/* Pseudo icon prefixes */
.topbar-links a[href*="login"]::before {
  content: "🔑";
  margin-right: 6px;
  font-size: 12px;
}

.topbar-links a[href*="register"]::before {
  content: "📝";
  margin-right: 6px;
  font-size: 12px;
}

.topbar-links a[href*="faq"]::before,
.topbar-links a[href*="help"]::before {
  content: "ℹ️";
  margin-right: 6px;
  font-size: 12px;
}

.topbar-links a[href*="dashboard"]::before,
.topbar-links a[href*="admin"]::before {
  content: "📊";
  margin-right: 6px;
  font-size: 12px;
}

.topbar-links a[onclick*="logout"]::before {
  content: "🚪";
  margin-right: 6px;
  font-size: 12px;
}

/* Part 2: Header */
.header {
  background-color: #ffffff;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 10002;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  border-bottom: 1px solid #f0f0f0;
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap; /* Keep name and logo on one line */
  flex-shrink: 0;
}

.logo-box {
  width: 64px;
  height: 64px;
  background: url('../images/logo.png') no-repeat center;
  background-size: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); /* Make logo pop */
}

.logo-text h1 {
  font-family: 'Tiro Bangla', serif;
  font-size: 26px;
  color: var(--green);
  line-height: 1;
}

.logo-text span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.header-search {
  flex: 1;
  max-width: 420px; /* Reduced to allow more room for nav */
  margin: 0 15px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 80px; /* Two columns instead of three */
  background: #f8fbf8;
  border-radius: 50px;
  overflow: hidden;
  height: 44px;
  border: 1px solid #e0e8e0;
  transition: all 0.3s ease;
}

.search-grid:focus-within {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.1);
}

.search-grid input {
  border: none;
  padding: 0 15px;
  font-size: 15px;
  color: var(--dark);
}

.div-select-wrap {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  padding: 0 10px;
  background: #fff;
}

.pin-icon {
  color: var(--red);
  font-size: 14px;
  margin-right: 5px;
}

.search-grid select {
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  color: var(--mid);
  font-size: 15px;
  outline: none;
}

.search-grid button {
  background-color: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.search-grid button:hover {
  background-color: var(--dark);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 15px; /* Reduced gap slightly to fit links */
  flex-shrink: 0;
}

.header-nav a {
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Dual line separator between header nav links */
.header-nav > a::before {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  border-right: 3px double rgba(0,0,0,0.15);
  pointer-events: none;
}

.header-nav a:not(.btn-add):hover {
  background-color: rgba(200, 16, 46, 0.08); /* Light version of --red */
  color: var(--red);
  transform: translateY(-1px);
}

.header-nav a:not(.btn-add)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.header-nav a:not(.btn-add):hover::after {
  width: 60%;
}

.header-nav a.btn-add {
  background: linear-gradient(135deg, var(--green), #2d8a4e);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 6px; /* Changed from 50px for a more professional tab-like look */
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(27, 107, 58, 0.15);
  transition: all 0.3s;
  justify-content: center;
}

.header-nav a.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(27, 107, 58, 0.3);
}

/* Part 3: Category Tab Strip */
.cat-strip {
  background-color: #fff;
  border-bottom: 1px solid var(--border);
}

.cat-strip .container {
  max-width: 1480px; /* Matches the topbar and header container width */
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap; /* Keep everything on a single line */
  justify-content: flex-start; /* Left-aligned for seamless scroll experience */
  padding: 10px 16px; /* Matching standard container horizontal padding */
  overflow-x: auto; /* Allow horizontal scrolling when tabs exceed viewport */
  -ms-overflow-style: none; 
  scrollbar-width: none; 
}

.cat-strip .container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mid);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 10px 15px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  flex-shrink: 0;
}

.cat-tab:hover {
  background-color: var(--yp-light);
  color: var(--dark);
  border-bottom: 3px solid var(--yp2);
  border-radius: 4px 4px 0 0;
}

.cat-tab.active {
  color: #B8860B; /* var(--yp2) */
  border-bottom: 3px solid #B8860B;
}

.c-count {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.cat-tab.active .c-icon, .cat-tab.active .c-count {
  background: var(--yp-light);
  color: var(--yp2);
}

/* Marquee Advertisement Styles */
.marquee-container {
  background: var(--yp-light);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  position: sticky;
  top: 72px; /* Sticks right below the header */
  z-index: 10001;
  display: flex;
}

.marquee-track {
  display: flex;
  width: max-content;
  min-width: 200%;
  align-items: center;
  gap: 50px;
  padding-right: 50px;
  animation: marquee 30s linear infinite;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
}

.ad-item {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.ad-tag {
  background: var(--red);
  color: #fff;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Hero Search Grid - Dedicated Premium Style */
.hero-search-grid {
  display: grid;
  grid-template-columns: 1fr 180px 110px;
  background: #ffffff;
  border-radius: 50px;
  overflow: visible; /* Prevent suggestions clipping */
  height: 60px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
  margin: 0 auto 35px; /* Separate search bar from stats */
  max-width: 850px;
  padding: 6px; /* Pill-within-pill aesthetic */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search-grid:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(27, 107, 58, 0.15);
  border-color: var(--green);
}

.hero-search-grid input {
  border: none;
  padding: 0 30px;
  font-size: 16px;
  color: var(--dark);
  background: transparent;
  outline: none;
}

.hero-search-grid select {
  border: none;
  border-left: 1px solid #eee;
  padding: 0 15px;
  font-size: 15px;
  color: var(--mid);
  background: transparent;
  cursor: pointer;
  outline: none;
}

.hero-search-grid button {
  background: linear-gradient(135deg, var(--green), #2d8a4e);
  color: #fff;
  border-radius: 50px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(27, 107, 58, 0.2);
}

.hero-search-grid button:hover {
  background: var(--dark);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- MOBILE MENU & RESPONSIVE --- */

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10003;
}

.mobile-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--dark);
  border-radius: 3px;
  transition: all 0.3s;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: #fff;
  z-index: 10005;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-close {
  font-size: 30px;
  background: none;
  border: none;
  color: var(--muted);
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.drawer-links a {
  display: block;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid #f9f9f9;
}

.mobile-btn {
  background: var(--green);
  color: #fff !important;
  text-align: center;
  border-radius: 8px;
  margin-top: 10px !important;
  padding: 12px !important;
}

/* New Drawer Sections */
.auth-drawer {
    margin-bottom: 10px;
}
.auth-drawer a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.drawer-cat-title {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px 0 10px;
}

.drawer-cats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.drawer-cats a {
    background: #f8f8f8;
    padding: 10px !important;
    border-radius: 6px;
    font-size: 13px !important;
    border: none !important;
    text-align: center;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10004;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 992px) {
  .header-nav { display: none !important; }
  .mobile-toggle { display: flex; }
  .logo-text h1 { font-size: 20px; }
  .logo-box { width: 48px; height: 48px; }
  .header { height: 64px; }
}

/* Autocomplete suggestions dropdown styles */
.search-input-wrap {
  position: relative;
  display: flex;
  flex-grow: 1;
  width: 100%;
}

.search-input-wrap input {
  width: 100%;
}

.search-suggestions-box {
  position: absolute;
  top: calc(100% + 12px);
  left: 10px;
  right: 10px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
  z-index: 999999;
  display: none;
  animation: slideSuggestions 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-suggestions-box.active {
  display: block;
}

@keyframes slideSuggestions {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
  text-decoration: none;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background: #f8fafc;
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.suggestion-name {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  text-align: left;
}

.suggestion-meta {
  font-size: 11px;
  color: #64748b;
  text-align: left;
}

.suggestion-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.suggestion-tag.business {
  background: rgba(27, 107, 58, 0.1);
  color: #1B6B3A;
}

.suggestion-tag.category {
  background: rgba(244, 160, 36, 0.1);
  color: #d97706;
}
