/* --- BASE STYLES --- */
footer {
  margin-top: auto;
  background: var(--surface-glass, rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border, #E4E4E7);
  border-radius: 24px 24px 0 0;
  padding: 64px 32px 32px;
  box-shadow: 0 -4px 24px -8px rgba(0, 0, 0, 0.03);
  transition: all 0.4s ease;
}

[data-theme="dark"] footer {
  box-shadow: 0 -4px 24px -8px rgba(0, 0, 0, 0.2);
}

/* --- CONTAINER --- */
.footer-content {
  width: 1200px;
  max-width: 90%;
  margin: 0 auto;
}

/* --- GRID LAYOUT --- */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 48px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border, #E4E4E7);
}


/* --- FOOTER SECTION --- */
.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main, #09090B);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-section-title i {
  font-size: 16px;
  color: var(--accent-blue, #0284C7);
}

/* --- BRAND SECTION --- */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: span 1;
}


.footer-logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--text-main, #09090B);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo i {
  color: var(--accent-blue, #0284C7);
  font-size: 24px;
}

.footer-logo span {
  color: var(--text-muted, #71717A);
  font-weight: 500;
}

.footer-description {
  font-size: 14px;
  color: var(--text-muted, #71717A);
  line-height: 1.6;
  max-width: 250px;
}

/* --- LINKS --- */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-muted, #71717A);
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  position: relative;
}

.footer-link:hover {
  color: var(--text-main, #09090B);
  transform: translateX(4px);
}

.footer-link i {
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
}

.footer-link:hover i {
  opacity: 1;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue, #0284C7);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

/* --- STATS --- */
.footer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #E4E4E7);
}


.footer-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #09090B);
  letter-spacing: -0.5px;
}

.footer-stat-label {
  font-size: 12px;
  color: var(--text-muted, #71717A);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- SOCIAL --- */
.footer-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--icon-bg, #F4F4F5);
  border: 1px solid var(--border, #E4E4E7);
  color: var(--text-muted, #71717A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-social-link:hover {
  background: var(--text-main, #09090B);
  color: var(--bg, #FAFAFA);
  border-color: var(--text-main, #09090B);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- FOOTER BOTTOM --- */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted, #71717A);
}


.footer-copyright {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-copyright i {
  font-size: 14px;
  color: #EF4444;
}

.footer-credit {
  font-size: 13px;
  color: var(--text-muted, #71717A);
}

/* --- BACK TO TOP --- */
.footer-back-to-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-glass, rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border, #E4E4E7);
  color: var(--text-main, #09090B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
}

.footer-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.footer-back-to-top:hover {
  background: var(--text-main, #09090B);
  color: var(--bg, #FAFAFA);
  border-color: var(--text-main, #09090B);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- DIVIDER LINE --- */
.footer-divider {
  width: 2px;
  height: 100%;
  background: var(--border, #E4E4E7);
  opacity: 0.5;
}

/* --- ANIMATION --- */
@keyframes footerFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  animation: footerFadeIn 0.6s ease-out;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }

  .footer-brand {
    grid-column: span 4;
  }

  .footer-logo {
    align-self: center;
  }

  .footer-description {
    max-width: 100%;
    text-align: center;
    align-self: center;
  }

  .footer-stats {
    border-bottom: 1px solid var(--border, #E4E4E7);
    padding-bottom: 24px;
    margin-top: 16px;
    gap: 0px;
  }

  .footer-stat-value,
  .footer-stat-label {
    align-self: center;
  }

  .repos-label-mobile-responsive {
    font-size: 0px;
  }

  .repos-label-mobile-responsive::after {
    content: 'Repositories';
    font-size: 12px;
  }

}

@media (max-width: 768px) {
  footer {
    padding: 48px 20px 24px;
  }

  .footer-grid {
    gap: 24px;
    margin-bottom: 32px;
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }

  .footer-section-title {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .footer-link {
    font-size: 13px;
  }

  .footer-description {
    font-size: 13px;
  }

  .footer-bottom {
    font-size: 12px;
  }

  .footer-bottom {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 32px;
    padding-bottom: 24px;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-back-to-top {
    display: none;
  }

}