/* ---------------- Reset ---------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------------- Global Styles ---------------- */
body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  background-color: white;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

html {
  overflow-y: scroll;
}

/* ---------------- Header ---------------- */
.header {
  background: white;
  color: #333;
  padding: 20px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.logo img {
  height: 55px;
  width: auto;
  display: block;
  margin-left: -220px; /* preserve original placement */
  margin-top: 25px;
}

/* Navigation */
.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 80px;
}

.nav a {
  position: relative;
  color: #333;
  text-decoration: none;
  font-weight: 550;
  font-size: 18px;
  padding-bottom: 5px;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #333;
  transition: all 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Search Icon (header) */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-right: -200px;
}

.search-btn svg {
  width: 35px;
  height: 35px;
  fill: #333;
  transition: fill 0.2s ease;
}

.search-btn:hover svg {
  fill: #007BFF;
}

.search-btn:active {
  background: rgba(0, 123, 255, 0.2);
  transform: scale(0.9);
}

/* ---------------- Footer ---------------- */
.footer {
  background: #222;
  color: white;
  font-family: 'Montserrat', sans-serif;
  margin-top: auto;
}

.footer-top {
  background: #6f51e5;
  text-align: center;
  padding: 15px;
}

.footer-top p {
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-top .social-icons a {
  color: white;
  margin: 0 10px;
  font-size: 18px;
  transition: color 0.3s;
}

.footer-top .social-icons a:hover {
  color: #ddd;
}

.footer-main {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  padding: 40px 20px;
  gap: 40px;
}

.footer-col {
  flex: 1 1 250px;
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #6f51e5;
  display: inline-block;
  padding-bottom: 5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: white;
}

.footer-bottom {
  background: #111;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

/* ---------------- Search Page ---------------- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 70px 20px;
  margin-top: 170px;
  margin-bottom: 254.5px;
  position: relative;
  width: 100%;
}

/* Center logo on search page */
main .search-logo img {
  max-width: 500px;
  height: auto;
  margin-bottom: 30px;
}

/* Search form container - no search button */
main .search-form {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  position: relative; /* needed for dropdown positioning */
  margin: 0 auto;
}

/* Search input with magnifying glass inside */
main .search-form input {
  flex: 1;
  padding: 16px 20px 16px 45px; /* left padding for icon */
  border: 1px solid black;
  border-radius: 10px; /* fully rounded */
  font-size: 18px;
  outline: none;
  background: url('magnifyingglass.svg') no-repeat 15px center; /* magnifying glass inside */
  background-size: 20px 20px;
}

/* Live search results dropdown */
main .results-box {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: none;
  text-align: left;
  z-index: 999;
  max-height: 400px;
  overflow-y: auto;
}

/* Dropdown list items */
main .results-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

main .results-box li {
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f1f1f1;
  line-height: 1.4;
}

main .results-box li:last-child {
  border-bottom: none;
}

main .results-box li:hover {
  background: #f9f9f9;
}

main .results-box li .title {
  font-weight: 600;
  margin-bottom: 4px;
}

main .results-box li .snippet {
  font-size: 14px;
  color: #555;
}

/* ---------------- Responsive Adjustments ---------------- */
@media (max-width: 768px) {
  main .search-form {
    flex-direction: column;
    max-width: 90%;
  }

  main .search-form input {
    width: 100%;
    border-radius: 50px;
    margin: 5px 0;
    padding-left: 45px; /* magnifying glass stays inside */
  }

  main .results-box {
    width: 100%;
    max-width: 100%;
    left: 0;
    transform: none;
  }

  .nav {
    position: static;
    transform: none;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
  }

  .logo img {
    margin-left: -220px; /* preserve original header logo */
    margin-top: 25px;
  }
}
