/* Header */
header {
  height: 70px;
  border-bottom: 1px solid rgb(65, 65, 65);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: rgb(29, 29, 29);
  z-index: 100;
}

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

header h1 {
  font-size: 1.8rem;
  color: rgb(242, 241, 237);
}

.header-tooltip-anchor {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.logo__mobile__container {
  height: auto;
  width: 110px;
}

.logo__mobile {
  height: auto;
  width: 110px;
  max-height: 50px;
  display: none;
  flex: 0 0 auto;
}

.logo__desktop {
  height: auto;
  width: 110px;
  max-height: 50px;
  display: block;
  flex: 0 0 auto;
}

.burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  padding: 5px;
}

.burger-menu span {
  width: 25px;
  height: 3px;
  background-color: rgb(242, 241, 237);
  border-radius: 2px;
}

.burger-menu:hover span {
  background-color: rgb(255, 255, 255);
}

.header-right {
  flex: 0 0 auto;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

/* Header Search */
.search-menu {
  position: relative;
  margin-right: 15px;
}

.glass-icon {
  cursor: pointer;
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  margin-top: 6px;
}

.glass-icon:hover {
  opacity: 1;
}

.search-dropdown {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgb(29, 29, 29);
  /* border: 1px solid rgb(65, 65, 65); */
  border-radius: 0;
  width: 100%;
  height: 100vh;
  max-width: none;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.search-dropdown.show {
  display: block;
}

.search-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgb(65, 65, 65);
  background-color: rgb(29, 29, 29);
  border-radius: 0;
  max-width: 1000px;
  margin: auto;
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-dropdown-header h3 {
  color: rgb(242, 241, 237);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.dropdown-close {
  color: rgb(180, 180, 180);
  font-size: 20px;
  font-weight: normal;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 0 4px;
}

.dropdown-close:hover {
  color: rgb(255, 255, 255);
}

.search-dropdown-body {
  padding: 0 0 20px 0;
  max-width: 1000px;
  margin: 0 auto;
  min-height: calc(100vh - 70px - 60px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgb(65, 65, 65);
}

.search-section:last-child {
  border-bottom: none;
  padding-bottom: 40px;
}

.search-section h4 {
  color: rgb(242, 241, 237);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.expand-btn {
  background: none;
  border: 1px solid rgb(65, 65, 65);
  color: rgb(242, 241, 237);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expand-btn:hover {
  background-color: rgb(60, 60, 60);
}

.county-search-container {
  position: relative;
  margin-bottom: 12px;
}

.county-search-input {
  width: 100%;
  padding: 10px 12px;
  background-color: rgb(50, 50, 50);
  border: 1px solid rgb(65, 65, 65);
  border-radius: 4px;
  color: rgb(242, 241, 237);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.county-search-input:focus {
  border-color: rgb(70, 130, 180);
}

.county-search-input::placeholder {
  color: rgb(150, 150, 150);
}

.county-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background-color: rgb(40, 40, 40);
  border: 1px solid rgb(65, 65, 65);
  border-radius: 4px;
  margin-top: 4px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.county-dropdown-list::-webkit-scrollbar {
  width: 8px;
}

.county-dropdown-list::-webkit-scrollbar-track {
  background: rgb(30, 30, 30);
  border-radius: 4px;
}

.county-dropdown-list::-webkit-scrollbar-thumb {
  background: rgb(70, 70, 70);
  border-radius: 4px;
}

.county-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: rgb(90, 90, 90);
}

.county-dropdown-item {
  padding: 10px 12px;
  color: rgb(180, 180, 180);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.county-dropdown-item:hover {
  background-color: rgb(50, 50, 50);
  color: rgb(242, 241, 237);
}

.county-dropdown-item .county-region {
  font-size: 11px;
  color: rgb(130, 130, 130);
  margin-left: 8px;
}

.county-dropdown-item.selected {
  background-color: rgb(60, 90, 120);
  color: rgb(242, 241, 237);
}

.county-dropdown-no-results {
  padding: 16px 12px;
  color: rgb(150, 150, 150);
  font-size: 13px;
  text-align: center;
}

.selected-counties-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  min-height: 20px;
}

.county-chip {
  background-color: rgb(70, 71, 67);
  color: rgb(194, 195, 193);
  padding: 6px 10px 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.county-chip:hover {
  background-color: rgb(80, 80, 80);
}

.county-chip .remove-btn {
  background: none;
  border: none;
  color: rgb(194, 195, 193);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.county-chip .remove-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgb(255, 255, 255);
}

.postcode-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.postcode-group label {
  color: rgb(242, 241, 237);
  font-size: 14px;
  min-width: 80px;
}

.postcode-input,
.name-input {
  flex: 1;
  padding: 8px 12px;
  background-color: rgb(50, 50, 50);
  border: 1px solid rgb(65, 65, 65);
  border-radius: 4px;
  color: rgb(242, 241, 237);
  font-size: 14px;
  outline: none;
}

.name-input {
  width: 100%;
  box-sizing: border-box;
}

.postcode-input:focus,
.name-input:focus {
  border-color: rgb(70, 130, 180);
}

.range-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.range-group label {
  color: rgb(242, 241, 237);
  font-size: 14px;
  min-width: 80px;
}

.range-buttons {
  display: flex;
  gap: 8px;
  flex: 1;
}

.range-btn {
  flex: 1;
  padding: 8px 16px;
  background-color: rgb(70, 71, 67);
  color: rgb(194, 195, 193);
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.range-btn:hover {
  background-color: rgb(80, 80, 80);
}

.range-btn.active {
  background-color: rgb(249, 237, 219);
  color: rgb(50, 50, 50);
  font-weight: 500;
}

.timeframe-buttons {
  display: flex;
  gap: 0;
  margin: 12px 0;
}

.timeframe-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  color: rgb(242, 241, 237);
  border: 1px solid rgb(65, 65, 65);
  background-color: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.timeframe-btn:first-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.timeframe-btn:last-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.timeframe-btn:not(:first-child) {
  border-left: none;
}

.timeframe-btn:hover {
  background-color: rgb(50, 50, 50);
}

.timeframe-btn.active {
  background-color: rgb(60, 60, 60);
}

.keyword-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}

.keyword-category:not(.expanded) .keyword-tags {
  display: none;
}

.keyword-category.expanded .keyword-tags {
  display: flex;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  color: rgb(242, 241, 237);
  font-size: 14px;
  font-weight: 500;
}

.keyword-tags {
  padding: 0 16px 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  background-color: rgb(70, 71, 67);
  color: rgb(194, 195, 193);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.keyword-tag:hover {
  background-color: rgb(80, 80, 80);
  transform: translateY(-1px);
}

.keyword-tag.selected {
  background-color: rgb(70, 130, 180);
  color: rgb(255, 255, 255);
  font-weight: 500;
  transform: translateY(-1px);
}

.search-action-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.apply-btn-bottom {
  padding: 12px 24px;
  border-radius: 2px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  min-width: 120px;
  background-color: rgb(249, 237, 219);
  color: rgb(29, 29, 29);
}

.apply-btn-bottom:hover {
  background-color: rgb(255, 255, 255);
  box-shadow: 0 4px 12px rgba(249, 237, 219, 0.1);
}

.clear-btn-bottom {
  padding: 12px 24px;
  border-radius: 2px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgb(200, 200, 200);
  min-width: 120px;
  background-color: transparent;
  color: rgb(100, 100, 100);
}

.clear-btn-bottom:hover {
  background-color: rgb(245, 245, 245);
  border-color: rgb(180, 180, 180);
  color: rgb(29, 29, 29);
}

/* Profile Menu */
.profile-menu {
  position: relative;
}

.profile-menu a {
  text-decoration: none;
}

.profile-icon {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgb(60, 60, 60);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgb(242, 241, 237);
  transition: background-color 0.3s ease;
}

.profile-avatar:hover {
  background-color: rgb(80, 80, 80);
}

.profile-avatar.profile-picture {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.guest-profile {
  cursor: pointer;
}

.guest-profile .profile-avatar {
  background-color: #f5f5f5;
  color: #666;
  border: 2px solid #ddd;
}

.guest-profile:hover .profile-avatar {
  background-color: #e0e0e0;
  border-color: #ccc;
}

.guest-profile .profile-avatar svg {
  width: 16px;
  height: 16px;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: rgb(247, 63, 13);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgb(40, 40, 40);
  border: 1px solid rgb(65, 65, 65);
  border-radius: 8px;
  min-width: 160px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  margin-top: 10px;
}

.profile-menu:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.profile-dropdown li {
  margin: 0;
}

.profile-dropdown a {
  display: block;
  padding: 12px 16px;
  color: rgb(242, 241, 237);
  text-decoration: none;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.profile-dropdown a:hover {
  background-color: rgb(60, 60, 60);
  color: rgb(255, 255, 255);
}

/* Navigation */
nav {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}

nav.active ul {
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  background-color: rgb(29, 29, 29);
  border-top: 1px solid rgb(65, 65, 65);
  border-bottom: 1px solid rgb(65, 65, 65);
  flex-direction: column;
  gap: 0;
  padding: 20px 0;
  margin: 0;
  z-index: 999;
}

nav.active ul li {
  text-align: center;
}

nav.active ul li a {
  padding: 15px 20px;
  display: block;
}

nav a {
  color: rgb(242, 241, 237);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: bold;
}

nav a:hover {
  color: rgb(255, 255, 255);
}

nav a.active {
  color: rgb(249, 237, 219);
  position: relative;
}

@media (min-width: 769px) {
  nav.active ul {
    position: static;
    background-color: transparent;
    border: none;
    flex-direction: row;
    gap: 30px;
    padding: 0;
    margin: 0;
  }

  nav.active ul li {
    border-bottom: none;
  }

  nav.active ul li a {
    padding: 0;
    display: inline;
  }
}

@media (max-width: 768px) {
  .burger-menu {
    display: flex;
  }

  header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: 70px;
  }

  header {
    height: 70px;
    padding: 0;
  }

  .logo__mobile {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-height: 40px;
    margin-top: -7px;
  }

  .logo__desktop {
    display: none;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: rgb(29, 29, 29);
    border-top: 1px solid rgb(65, 65, 65);
    z-index: 999;
  }

  nav.active {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 20px 0;
  }

  nav ul li {
    text-align: center;
    border-bottom: 1px solid rgb(45, 45, 45);
  }

  nav ul li:last-child {
    border-bottom: none;
  }

  nav ul li a {
    padding: 15px 20px;
    display: block;
  }

  nav a.active::after {
    display: none;
  }

  .header-right {
    flex: 0 0 auto;
    gap: 15px;
  }

  .search-menu {
    margin-right: 5px;
  }

  .glass-icon {
    cursor: pointer;
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    margin-top: 12px;
  }

  .search-dropdown {
    height: calc(100vh - 70px);
    overflow: hidden;
  }

  .search-dropdown-body {
    height: calc(100vh - 70px - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
  }

  .search-section:last-child {
    padding-bottom: 0px;
  }

  .search-dropdown-body {
    padding-bottom: 0px;
  }

  .search-action-buttons {
    flex-direction: row;
    gap: 12px;
  }

  .profile-avatar {
    width: 35px;
    height: 35px;
  }

  .apply-btn-bottom,
  .clear-btn-bottom {
    width: 50%;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
}
