/* Footer styles */
footer {
  background-color: #242323;
  padding: 30px 20px;
  margin-top: 50px;
  text-align: center;
  font-family: "Libre Franklin", Arial, Helvetica, sans-serif;
  border-top: 1px solid #ddd;
  width: 100%;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

footer h4 {
  font-size: 18px;
  margin: 0;
  color: #ffffff;
}

footer p {
  text-align: left;
  font-family: "Libre Franklin", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #ffffff;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

.back-to-top {
  background-color: #f0a91d;
  color: #001947;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.2s;
}

.back-to-top:hover {
  opacity: 0.8;
}

.back-to-top:active {
  opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
  footer {
    padding: 20px 15px;
    position: relative;
    padding-bottom: 80px; /* Add extra padding at the bottom for the button */
  }

  .footer-top {
    flex-direction: column;
    gap: 15px;
  }

  footer h4 {
    font-size: 16px;
  }

  footer p {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .back-to-top {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* 改为自适应宽度 */
    padding: 10px 20px; /* 使用固定内边距 */
    font-size: 14px;
    font-weight: normal;
  }

  /* 确保移动设备上的悬停效果不会导致按钮移动 */
  .back-to-top:hover {
    opacity: 0.8;
    transform: translateX(-50%); /* 保持水平居中 */
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  footer {
    padding-bottom: 70px; /* Slightly less padding for smaller screens */
  }

  .back-to-top {
    bottom: 15px;
    padding: 8px 20px; /* 保持宽度自适应 */
    font-size: 14px;
  }
}
