/* ============================= */
/*        FOOTER SECTION         */
/* ============================= */

.footer {
  position: relative;
  background-color: var(--bg-darker);
  color: var(--text-light);
  padding: 4rem 1.5rem 2rem;
  margin: 4rem 0 0 0;  /* Remove left/right margins */
  width: 100vw;  /* Full viewport width */
  margin-left: calc(-50vw + 50%);  /* Center align trick */
  transition: background-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
  box-shadow: 0 -2px 30px rgba(0, 0, 0, 0.32);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  overflow: hidden;
  box-sizing: border-box;
}

/* Fix for pages with containers that might restrict width */
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Ensure SVG icons display correctly */
.social-link svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Decorative Top Accent */
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 90%);
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  opacity: 0.08;
  pointer-events: none;
}

/* ============================= */
/*      FOOTER GRID LAYOUT       */
/* ============================= */

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  align-items: start;
}

/* ============================= */
/*        TAGLINE                */
/* ============================= */

.tagline {
  font-style: italic;
  color: var(--text-gray);
  font-size: 0.98rem;
  margin-top: 6px;
  max-width: 360px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tagline:hover {
  transform: translateY(-4px);
}

/* ============================= */
/*        HEADINGS               */
/* ============================= */

.footer-section h3 {
  color: var(--primary-color);
  font-size: 1.15rem;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--accent-color)
  );
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.32s cubic-bezier(.2,.9,.2,1);
}

.footer-section h3:hover::after {
  transform: scaleX(1);
}

/* ============================= */
/*        LINKS                  */
/* ============================= */

.footer-section ul {
  list-style: none;
  padding: 0;
  margin-top: 6px;
}

.footer-section ul li {
  margin-bottom: 14px;
  position: relative;
}

.footer-section ul li a {
  color: var(--text-gray);
  transition: color 0.22s ease,
              transform 0.22s ease,
              padding-left 0.18s ease;
  position: relative;
  padding-left: 22px;
  display: inline-block;
  text-decoration: none;
}

/* Chevron */
.footer-section ul li a::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  transition: transform 0.18s ease;
}

/* Animated Underline */
.footer-section ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    transparent
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

/* Hover */
.footer-section ul li a:hover {
  color: var(--text-light);
  padding-left: 28px;
  transform: translateY(-2px);
}

.footer-section ul li a:hover::before {
  transform: translateX(6px);
}

.footer-section ul li a:hover::after {
  transform: scaleX(1);
}

/* ============================= */
/*      FEEDBACK BUTTON          */
/* ============================= */

.feedback-link {
  display: inline-block;
  color: var(--primary-color);
  padding: 12px 20px;
  border-radius: 28px;
  border: 2px solid rgba(0, 157, 255, 0.9);
  transition: all 0.28s ease;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  margin-top: 12px;
  font-weight: 600;
  text-decoration: none;
}

.feedback-link:hover {
  color: var(--bg-darker);
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--accent-color)
  );
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,157,255,0.18);
  border-color: transparent;
}

/* ============================= */
/*        SOCIAL LINKS           */
/* ============================= */

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: rgba(0, 157, 255, 0.04);
  color: var(--primary-color);
  transition: transform 0.22s ease,
              box-shadow 0.22s ease,
              background 0.22s ease;
  border: 1px solid rgba(0,157,255,0.06);
  text-decoration: none;
}

.social-link:hover {
  background: linear-gradient(
    180deg,
    rgba(0,157,255,0.12),
    rgba(0,200,255,0.06)
  );
  color: var(--text-light);
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 14px 30px rgba(0,157,255,0.16);
}

/* ============================= */
/*        FOOTER BOTTOM          */
/* ============================= */

.footer-bottom {
  text-align: center;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 160, 160, 0.06);
  color: var(--text-gray);
  font-size: 0.95rem;
}

.developer-name {
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.22s ease;
  text-decoration: none;
}

.developer-name:hover {
  color: var(--accent-color);
}

/* ============================= */
/*        RESPONSIVE             */
/* ============================= */

@media screen and (max-width: 900px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer {
    padding: 2.5rem 1rem 1rem;
  }

  .tagline {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .footer-content {
    text-align: center;
  }

  .footer-section h3::after {
    left: 50%;
    transform: translateX(-50%) scaleX(0);
  }

  .footer-section h3:hover::after {
    transform: translateX(-50%) scaleX(1);
  }

  .social-links {
    justify-content: center;
  }
}

/* ============================= */
/*        ACCESSIBILITY          */
/* ============================= */

.footer-section ul li a:focus-visible,
.feedback-link:focus-visible,
.social-link:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(0,157,255,0.12);
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .footer::before,
  .footer-section ul li a,
  .footer-section ul li a::before,
  .footer-section ul li a::after,
  .footer-section h3::after,
  .feedback-link,
  .social-link {
    transition: none !important;
    animation: none !important;
  }

  .footer-section ul li a:hover,
  .footer-section ul li a:hover::before,
  .feedback-link:hover,
  .social-link:hover {
    transform: none !important;
  }
}