/* 📱 Mobile Overrides and Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --font-size-base: 18px;
    --font-size-lg: 22px;
    --font-size-xl: 40px;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    font-size: var(--font-size-base);
    line-height: 1.5;
    background-color: #fff !important;
    color: #000 !important;
  }

  main {
    padding-top: 4rem !important;
  }

  /* 🔧 Header + Nav */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
  }

  .menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #000;
    border-radius: 2px;
  }

  .menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }

  .menu.active {
    display: flex;
  }

  .menu li {
    width: 100%;
    text-align: left;
  }

  .menu a {
    display: block;
    padding: 12px 20px;
    color: #000 !important;
    text-decoration: none;
    border-bottom: 1px solid #eee;
  }

  .menu a:hover {
    background-color: #f0f0f0;
  }

  .logo {
    flex: 1;
    text-align: center;
  }

  /* 🔢 Form Elements */
  .btn,
  .zip-button,
  #geolocateBtn,
  .zip-input,
  #addressForm input,
  #addressForm button {
    padding: 16px;
    font-size: 1.1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .zip-form,
  .address-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  /* 📦 Candidate Cards */
  .candidate-item {
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
    opacity: 1 !important;         /* force visible */
    transform: none !important;    /* remove animation offset */
    max-width: 100%;
    word-wrap: break-word;
  }

  #candidateResults {
    padding-left: 1em;
    margin-top: 1.5em;
  }

  /* 🦸 Hero Section */
  .hero {
    height: auto;
    flex-direction: column;
    padding: 40px 15px;
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .zip-top-spacer {
    margin-top: 20px;
  }
}

/* 🌙 Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #007bff;
    --secondary-color: #171717;
    --text-color: #fff;
    --header-bg: rgba(23, 23, 23, 0.9);
  }

  body {
    background-color: var(--secondary-color);
    color: var(--text-color);
  }

  .header {
    background: linear-gradient(to right, #2c2c2c, #1a1a1a);
  }

  .menu a,
  .logo a {
    color: #fff !important;
  }

  .candidate-item {
    background-color: #2c2c2c;
    color: #fff;
    border: 1px solid #555;
  }
}
