:root {
  --primary-blue: #2B659F;
  --accent-gold: #E5C158;
  --text-dark: #333333;
  --bg-light: #F4F7F6;
  --white: #FFFFFF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif; 
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header styling matching main site */
header {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 1.5rem 2rem;
  border-bottom: 5px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  position: relative;
  z-index: 100;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-logo a {
  text-decoration: unset;
  color: unset;
}

.brand-icon-img img, .mapicon {
  max-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--primary-blue);
  font-size: 1.2rem;
}

.header-shortcuts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  border: 1.5px solid var(--accent-gold);
  border-radius: 20px;
  color: var(--white);
  height: 34px; /* Explicit height */
  padding: 0 14px; /* Left/right padding only */
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.1s;
  white-space: nowrap;
  box-sizing: border-box; /* Crucial for explicit height */
  line-height: 1; /* Normalize text height */
}

button.header-btn {
  font-family: inherit;
  line-height: inherit;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.header-btn:hover {
  background-color: var(--accent-gold);
  color: var(--primary-blue);
  transform: translateY(-1px);
}

/* Help split button styles */
.help-split-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--accent-gold);
  border-radius: 20px;
  height: 34px;
  box-sizing: border-box;
  background-color: transparent;
  transition: transform 0.1s;
}

.help-split-btn:hover {
  transform: translateY(-1px);
}

.help-split-left-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  border: none;
  border-radius: 18px 0 0 18px;
  color: var(--white);
  height: 100%;
  padding: 0 10px 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  box-sizing: border-box;
  line-height: 1;
}

.help-split-left-btn:hover {
  background-color: var(--accent-gold);
  color: var(--primary-blue);
}

.help-split-btn::after {
  content: "";
  display: block;
  width: 0px;
  height: 60%;
  background-color: rgba(229, 193, 88, 0.4);
}

.help-split-right-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: 0 18px 18px 0;
  color: var(--white);
  height: 100%;
  padding: 0 10px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  box-sizing: border-box;
}

.help-split-right-btn:hover {
  background-color: var(--accent-gold);
  color: var(--primary-blue);
}

/* Dropdown menu */
.help-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: var(--primary-blue);
  border: 1.5px solid var(--accent-gold);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  min-width: 180px;
  padding: 0;
  overflow: hidden;
}

.help-dropdown-menu.show {
  display: block;
}

/* Dropdown items */
.help-dropdown-item {
  width: 100%;
  background-color: transparent;
  border: none;
  color: var(--white);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.help-dropdown-item:not(:last-child) {
  border-bottom: 1.5px solid rgba(229, 193, 88, 0.3);
}

.help-dropdown-item:hover {
  background-color: var(--accent-gold);
  color: var(--primary-blue);
}
a.help-link{
color: var(--primary-blue);
}

/* Footer styling matching header */
footer {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 1.5rem 2rem;
  border-top: 5px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: auto;
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.9;
  color: var(--white);
  margin: 0;
  flex-grow: 1;
  text-align: center;
}

.footer-shortcuts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Main Layout & Common Content Container */
main {
  flex-grow: 1;
  padding: 12px 6px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.intro-section {
  text-align: center;
  margin-bottom: 3rem;
}

.intro-section h2 {
  font-size: 2.2rem;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
}

.intro-section p {
  font-size: 1.1rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
}

/* Credits subpage specific styles */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.credit-card {
  background: var(--white);
  border-radius: 8px;
  padding: 1.75rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--primary-blue);
  transition: transform 0.2s, box-shadow 0.2s;
}

.credit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.credit-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.credit-card .card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0;
}

.credit-card .card-badge {
  font-size: 0.75rem;
  font-weight: bold;
  background: rgba(43, 101, 159, 0.1);
  color: var(--primary-blue);
  padding: 3px 8px;
  border-radius: 4px;
}

.credit-card .card-description {
  font-size: 0.92rem;
  color: #555;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.credit-card .card-footer {
  display: flex;
  gap: 10px;
  border-top: 1px solid #f0f0f0;
  padding-top: 1rem;
  margin-top: auto;
}

.credit-card .card-link {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary-blue);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.credit-card .card-link:hover {
  color: var(--accent-gold);
}

/* Privacy & TOS subpage specific styles to avoid card/text collisions */
.privacy-container {
  max-width: 900px !important;
}

.privacy-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--primary-blue);
  margin-bottom: 2.5rem;
}

.privacy-card h2 {
  color: var(--primary-blue);
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.privacy-card h3 {
  color: var(--primary-blue);
  font-size: 1.3rem;
  margin: 1.5rem 0 0.75rem 0;
}

.privacy-card p {
  margin-bottom: 1rem;
  color: #4a4a4a;
}

.privacy-card ul {
  margin: 1rem 0 1.5rem 1.5rem;
  color: #4a4a4a;
}

.privacy-card li {
  margin-bottom: 0.5rem;
}

.privacy-card .note-box {
  background-color: rgba(43, 101, 159, 0.05);
  border-left: 4px solid var(--primary-blue);
  padding: 1.25rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.privacy-card .note-box p:last-child {
  margin-bottom: 0;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .credits-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .container:not(.privacy-container) {
    max-width: 1800px;
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  header {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.4rem 0.6rem;
    gap: 8px;
  }

  .brand-logo {
    width: 100%;
    justify-content: flex-start;
    padding-right: 75px;
  }

  .brand-logo h1 {
    font-size: 1.15rem;
  }

  .brand-icon-img img, .mapicon {
    max-width: 28px;
    height: 28px;
  }

  .help-split-btn {
    position: absolute;
    right: 8px;
    top: 6px;
    margin: 0;
    height: 28px;
  }

  .help-split-left-btn {
    font-size: 0.82rem;
    padding: 0 6px 0 10px;
  }

  .help-split-right-btn {
    padding: 0 6px;
  }

  .header-shortcuts {
    justify-content: center;
    width: 100%;
    gap: 8px;
  }

  .header-shortcuts .header-btn {
    font-size: 0.82rem;
    height: 28px;
    padding: 0 8px;
  }

  footer {
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.6rem;
    gap: 10px;
  }

  footer .brand-logo {
    padding-right: 0;
    justify-content: center;
  }

  footer .footer-copyright {
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
    margin: 2px 0;
  }

  .footer-shortcuts {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }

  .footer-shortcuts .header-btn {
    font-size: 0.82rem;
    height: 28px;
    padding: 0 8px;
  }
}

/* Custom WV Sort Webcomponent styles */
wv-sort {
  display: block;
  flex: 1;
  min-width: 250px;
}

.wv-sort-option:hover {
  background-color: var(--wv-hover-bg, #f7f1eb) !important;
}

/* Help Pop-over (Overlay Model) - Global Styles */
.help-popover-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.help-popover-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Help Pop-over Card */
.help-popover-card {
  background: var(--white);
  border-radius: 16px;
  max-width: 580px;
  width: 90%;
  max-height: 85vh;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  position: relative;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-popover-overlay.active .help-popover-card {
  transform: scale(1);
}

.help-popover-header {
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}

.help-popover-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-height: 48vh;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.help-popover-body::-webkit-scrollbar {
  width: 6px;
}

.help-popover-body::-webkit-scrollbar-track {
  background: transparent;
}

.help-popover-body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.help-popover-footer {
  padding: 1.2rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-popover-footer-links {
  display: flex;
  gap: 12px;
  width: 100%;
}

.help-footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.help-footer-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--primary-blue);
}

.help-popover-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.help-popover-close:hover {
  color: var(--text-dark);
}

.help-popover-card h3 {
  color: var(--primary-blue);
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
}

.help-popover-card p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  text-align: left;
}

.help-popover-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.help-popover-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: left;
}

/* Base style for individual help-sections (allowing scroll-margin for smooth header alignment) */
.help-section-item {
  scroll-margin-top: 24px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Premium smooth highlight pulse effect when active help section is selected */
@keyframes highlight-pulse-animation {
  0% {
    background-color: rgba(229, 193, 88, 0.25);
    box-shadow: 0 0 12px rgba(229, 193, 88, 0.4);
    border-radius: 8px;
  }
  70% {
    background-color: rgba(229, 193, 88, 0.1);
    box-shadow: 0 0 6px rgba(229, 193, 88, 0.15);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.highlight-pulse {
  animation: highlight-pulse-animation 2s ease-out;
  padding: 6px;
  margin: -6px;
}

.help-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-popover-icon {
  background: #f0f4f8;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.help-popover-list li strong {
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0;
}

.help-item-desc {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  padding-left: 0;
  text-align: left;
}

.help-popover-action-btn {
  width: 100%;
  margin: 0;
  padding: 12px;
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-blue);
  color: var(--white);
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.help-popover-action-btn:hover {
  background-color: #1d4ed8;
}

/* Responsive Overrides for Help Pop-over */
@media (max-width: 768px) {
  .help-popover-card {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    padding: 0;
    transform: none !important;
  }
  .help-popover-header {
    padding: 1rem;
  }
  .help-popover-body {
    padding: 1rem;
    max-height: calc(100vh - 180px);
  }
  .help-popover-footer {
    padding: 1rem;
  }
}

