/* Footer Styles */
.footer {
  background-color: var(--color-gray-900);
  color: var(--color-gray-300);
  padding: var(--space-3xl) 0 var(--space-xl) 0;
  margin-top: auto;
}

[data-theme="dark"] .footer {
  background-color: var(--color-black);
}

.footer-content {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .footer-content {
    padding: 0 var(--space-lg);
  }
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .footer-main {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-3xl);
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-brand {
    align-items: flex-start;
    text-align: left;
  }
}

.footer-logo {
  margin-bottom: var(--space-lg);
}

.footer-logo img {
  height: 3rem;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-description {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-gray-400);
  margin-bottom: var(--space-lg);
  max-width: 400px;
}

.footer-social {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

@media (min-width: 768px) {
  .footer-social {
    justify-content: flex-start;
  }
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-gray-800);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.social-link:hover {
  background-color: var(--color-primary);
  transform: translateY(-2px);
}

.social-link img {
  width: 1.25rem;
  height: 1.25rem;
  filter: brightness(0) invert(1);
}

.footer-section {
  text-align: center;
}

@media (min-width: 768px) {
  .footer-section {
    text-align: left;
  }
}

.footer-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-lg);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-link {
  color: var(--color-gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-size: var(--font-size-base);
}

.footer-link:hover,
.footer-link:focus {
  color: var(--color-white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--color-gray-700);
  padding-top: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copyright {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  margin: 0;
}

.footer-copyright .heart {
  color: var(--color-primary);
  margin: 0 var(--space-xs);
}

.footer-credits {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  margin: 0;
}

.footer-year {
  font-weight: var(--font-weight-medium);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--color-gray-600), var(--color-gray-700));
  color: var(--color-white);
  border: none;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  text-decoration: none;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-gray-700), var(--color-gray-800));
  outline-offset: 2px;
}

[data-theme="dark"] .back-to-top:focus {
  outline-color: #DC2626;
}
[data-theme="light"] .back-to-top:focus {
  outline-color: #007BFF;
}

.back-to-top img,
.back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
  filter: brightness(0) invert(1);
  transform: rotate(-90deg);
}

/* Footer responsiveness for very small screens */
@media (max-width: 320px) {
  .footer {
    padding: var(--space-2xl) 0 var(--space-lg) 0;
  }
  
  .footer-content {
    padding: 0 var(--space-sm);
  }
  
  .footer-main {
    gap: var(--space-xl);
  }
  
  .footer-logo img {
    height: 2.5rem;
  }
  
  .back-to-top {
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .back-to-top img,
  .back-to-top svg {
    width: 1rem;
    height: 1rem;
  }
}

/* Print styles */
@media print {
  .footer {
    background-color: transparent;
    color: var(--color-black);
    border-top: 1px solid var(--color-gray-300);
  }
  
  .footer-social,
  .back-to-top {
    display: none;
  }
  
  .footer-link {
    color: var(--color-black);
  }
}
