---
export interface Props {
  showSocialLinks?: boolean;
  customLinks?: Array<{ label: string; href: string; icon?: string }>;
}

const { 
  showSocialLinks = true,
  customLinks = []
} = Astro.props;

const socialLinks = [
  { label: "Email", href: "mailto:jiaotiansheng@outlook.com", icon: "fas fa-envelope" }
];
---

<footer class="footer-container">
  <div class="footer-content">
    <div class="footer-main">
      <div class="footer-brand">
        <h3 class="brand-title">Jiao77</h3>
        <p class="brand-description">简约美观的现代化网站体验</p>
      </div>
      
      {customLinks.length > 0 && (
        <div class="footer-links">
          <h4 class="links-title">快速链接</h4>
          <ul class="links-list">
            {customLinks.map(link => (
              <li>
                <a href={link.href} class="footer-link">
                  {link.icon && <i class={link.icon}></i>}
                  {link.label}
                </a>
              </li>
            ))}
          </ul>
        </div>
      )}
      
      {showSocialLinks && (
        <div class="footer-social">
          <h4 class="social-title">联系方式</h4>
          <div class="social-links">
            {socialLinks.map(social => (
              <a href={social.href} class="social-link" title={social.label}>
                <i class={social.icon}></i>
              </a>
            ))}
          </div>
        </div>
      )}
    </div>
    
    <div class="footer-bottom">
      <div class="footer-divider"></div>
      <div class="footer-info">
        <p class="copyright">© 2024 Jiao77. All rights reserved.</p>
        <p class="built-with">Built with <i class="fas fa-heart text-red-400"></i> and Astro</p>
      </div>
    </div>
  </div>
</footer>

<style>
  .footer-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
  }
  
  .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
  }
  
  .footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .footer-brand .brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #011a2d;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #011a2d, #2c4a6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .footer-brand .brand-description {
    color: #2c4a6b;
    margin: 0;
    line-height: 1.6;
  }
  
  .links-title,
  .social-title {
    font-size: 1rem;
    font-weight: 600;
    color: #011a2d;
    margin: 0 0 1rem 0;
  }
  
  .links-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .links-list li {
    margin-bottom: 0.5rem;
  }
  
  .footer-link {
    color: #2c4a6b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
  }
  
  .footer-link:hover {
    color: #011a2d;
    transform: translateX(5px);
  }
  
  .social-links {
    display: flex;
    gap: 1rem;
  }
  
  .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: #2c4a6b;
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #011a2d;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  .footer-divider {
    height: 1px;
    background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(255, 255, 255, 0.2) 50%, 
      transparent 100%
    );
    margin-bottom: 1.5rem;
  }
  
  .footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #2c4a6b;
  }
  
  .copyright,
  .built-with {
    margin: 0;
  }
  
  .built-with i {
    color: #e74c3c;
    animation: pulse 2s infinite;
  }
  
  @media (max-width: 768px) {
    .footer-main {
      grid-template-columns: 1fr;
      text-align: center;
    }
    
    .footer-info {
      flex-direction: column;
      gap: 0.5rem;
      text-align: center;
    }
    
    .social-links {
      justify-content: center;
    }
  }
  
  @keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
  }
</style>