/* =========================
   FOOTER ANIMATIONS
========================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================
   FOOTER WRAPPER
========================= */

.site-footer {
  background: linear-gradient(180deg,
    #0b1120 0%,
    #020617 100%);
  position: relative;
  overflow: hidden; /* Contain decorative elements */
  margin-top: 0;
  padding: 0;
  animation: fadeIn 0.6s ease-out;
  width: 100%; /* Explicit width constraint */
}

/* Gradient overlay for depth */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.35) 0%,
    rgba(2, 6, 23, 0.85) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* FIXED: Decorative gradient - constrained to viewport */
.site-footer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Changed from width: 140% and left: -20% to use inset */
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 77, 90, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(147, 51, 234, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* =========================
   FOOTER MAIN CONTENT
========================= */

.footer-main {
  padding: 3rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem;
  align-items: flex-start;
}

.footer-grid .footer-column:last-child {
  text-align: center;
}

.footer-grid .footer-column:last-child .footer-social {
  justify-content: center;
}

.footer-column {
  animation: fadeInUp 0.8s ease-out backwards;
  /* Prevent column overflow */
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.footer-column:nth-child(1) {
  animation-delay: 0.2s;
}

.footer-column:nth-child(2) {
  animation-delay: 0.3s;
}

.footer-column:nth-child(3) {
  animation-delay: 0.4s;
}

.footer-column:nth-child(4) {
  animation-delay: 0.5s;
}

.footer-column h4 {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 0.65rem;
}

.footer-column ul a {
  text-decoration: none;
  font-size: 0.9rem;
  color: #94a3b8;
  transition: color 0.2s ease-out, transform 0.2s ease-out;
  display: inline-block;
}

.footer-column ul a:hover {
  color: var(--nx-color-primary-soft);
  transform: translateX(4px);
}

/* =========================
   SOCIAL BUTTONS
========================= */

.footer-social {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
}

.social-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: 
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease-out,
    box-shadow 0.3s ease-out;
  /* Prevent button from causing overflow */
  flex-shrink: 0;
}

.social-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    var(--social-color-1, rgba(255, 77, 90, 0.2)) 0%, 
    var(--social-color-2, rgba(255, 159, 60, 0.15)) 100%);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.social-btn:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--social-color-1, rgba(255, 77, 90, 0.5));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.social-btn:hover::before {
  opacity: 1;
}

/* Social color schemes */
.social-btn.linkedin {
  --social-color-1: rgba(10, 102, 194, 0.4);
  --social-color-2: rgba(0, 119, 181, 0.3);
}

.social-btn.youtube {
  --social-color-1: rgba(255, 0, 0, 0.4);
  --social-color-2: rgba(200, 0, 0, 0.3);
}

.social-btn.facebook {
  --social-color-1: rgba(24, 119, 242, 0.4);
  --social-color-2: rgba(66, 103, 178, 0.3);
}

.social-btn.instagram {
  --social-color-1: rgba(225, 48, 108, 0.4);
  --social-color-2: rgba(253, 29, 29, 0.3);
}

/* SVG Icon styles */
.social-btn svg {
  color: #e2e8f0;
  position: absolute;
  z-index: 1;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.social-btn .icon-hover {
  opacity: 0;
  transform: translateY(6px);
}

.social-btn:hover .icon-default {
  opacity: 0;
  transform: translateY(-6px);
}

.social-btn:hover .icon-hover {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   FOOTER BOTTOM
========================= */

.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s ease-out 0.6s backwards;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-text {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease-out;
  /* Prevent link text from overflowing */
  white-space: nowrap;
}

.footer-bottom-links a:hover {
  color: var(--nx-color-primary-soft);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
  
  .footer-column:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .footer-main {
    padding: 2rem 0 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-column {
    text-align: center;
  }

  .footer-column ul {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
    gap: 1rem; /* Reduce gap on mobile */
  }
  
  .footer-bottom-links a {
    font-size: 0.8rem;
  }
}