---
interface Props {
  title: string;
  description?: string;
}

const { title, description = "Download TikTok videos without watermark. Fast, free, and unlimited. Save TikTok videos in HD quality, extract MP3 audio, and more!" } = Astro.props;
---

<!doctype html>
<html lang="en" class="scroll-smooth">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content={description} />
    <meta name="keywords" content="TikTok downloader, download TikTok video, TikTok no watermark, save TikTok, TikTok MP3, TikTok video saver" />
    <meta name="author" content="TikSave" />
    
    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website" />
    <meta property="og:title" content={title} />
    <meta property="og:description" content={description} />
    <meta property="og:image" content="/og-image.png" />
    
    <!-- Twitter -->
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content={title} />
    <meta name="twitter:description" content={description} />
    
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <link rel="canonical" href="https://tiksave.app" />
    
    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
    
    <title>{title}</title>
    
    <script is:inline>
      // Check for saved theme preference or system preference
      const getThemePreference = () => {
        if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
          return localStorage.getItem('theme');
        }
        return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
      };
      
      const theme = getThemePreference();
      document.documentElement.classList.toggle('dark', theme === 'dark');
    </script>
  </head>
  <body class="min-h-screen bg-slate-50 dark:bg-midnight-950 text-slate-900 dark:text-white font-body antialiased transition-colors duration-300">
    <slot />
    
    <script>
      // Theme toggle functionality
      document.addEventListener('DOMContentLoaded', () => {
        const themeToggle = document.getElementById('theme-toggle');
        
        themeToggle?.addEventListener('click', () => {
          const isDark = document.documentElement.classList.toggle('dark');
          localStorage.setItem('theme', isDark ? 'dark' : 'light');
        });
      });
    </script>
  </body>
</html>

<style is:global>
  * {
    font-family: 'Outfit', system-ui, sans-serif;
  }
  
  .font-mono {
    font-family: 'JetBrains Mono', monospace;
  }
  
  /* Custom scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #475569;
  }
  
  .dark ::-webkit-scrollbar-thumb {
    background: #475569;
  }
  
  .dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
  }
  
  /* Gradient text */
  .gradient-text {
    background: linear-gradient(135deg, #fe2858 0%, #00d9d2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* Animated gradient background */
  .animated-gradient {
    background: linear-gradient(-45deg, #fe2858, #ff6389, #00d9d2, #3afff9);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
  }
  
  @keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }
  
  /* Glass effect */
  .glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Shimmer effect for loading */
  .shimmer {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.2) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
  }
  
  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }
</style>


