<!DOCTYPE html>
<html lang="<%= locale || 'ko' %>" class="<%= theme === 'dark' ? 'dark' : '' %>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><%= title %></title>
    
    <!-- PWA Meta Tags -->
    <meta name="theme-color" content="#1a202c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-mobile-web-app-title" content="SmartSolTech">
    
    <!-- SEO Meta Tags -->
    <meta name="description" content="<%= settings && settings.seo ? settings.seo.metaDescription : 'SmartSolTech - Innovative Technology Solutions' %>">
    <meta name="keywords" content="<%= settings && settings.seo ? settings.seo.keywords : 'web development, mobile apps, UI/UX design, Korea' %>">
    <meta name="author" content="SmartSolTech">
    
    <!-- Open Graph -->
    <meta property="og:title" content="<%= title %>">
    <meta property="og:description" content="<%= settings && settings.seo ? settings.seo.metaDescription : 'SmartSolTech - Innovative Technology Solutions' %>">
    <meta property="og:type" content="website">
    <meta property="og:url" content="<%= process.env.SITE_URL || 'https://smartsoltech.kr' %>">
    <meta property="og:image" content="<%= process.env.SITE_URL || 'https://smartsoltech.kr' %>/images/og-image.png">
    
    <!-- Favicon -->
    <link rel="icon" href="/favicon.ico">
    <link rel="apple-touch-icon" href="/images/icon-192x192.png">
    
    <!-- PWA Manifest -->
    <link rel="manifest" href="/manifest.json">
    
    <!-- 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=Ubuntu:wght@300;400;500;700&display=swap" rel="stylesheet">
    
    <!-- Tailwind CSS -->
    <link rel="stylesheet" href="/css/tailwind.css">
    
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
    
    <!-- AOS Animation Library -->
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    
    <!-- Custom CSS -->
    <link href="/css/base.css" rel="stylesheet">
    <link href="/css/main.css" rel="stylesheet">
    <link href="/css/fixes.css" rel="stylesheet">
    <link href="/css/theme-toggle.css" rel="stylesheet">
    

</head>
<body class="font-sans dark:bg-gray-900 dark:text-gray-100">
    <!-- Navigation -->
    <%- include('partials/navigation') %>
    
    <!-- Main Content -->
    <main>
        <%- body %>
    </main>
    
    <!-- Footer -->
    <%- include('partials/footer') %>
    
    <!-- Scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.js"></script>
    <script src="/js/main.js"></script>
    
    <!-- PWA Service Worker -->
    <script>
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', () => {
                navigator.serviceWorker.register('/sw.js')
                    .then(registration => {
                        console.log('SW registered: ', registration);
                    })
                    .catch(registrationError => {
                        console.log('SW registration failed: ', registrationError);
                    });
            });
        }
    </script>
    
    <!-- Analytics -->
    <% if (settings && settings.seo && settings.seo.googleAnalytics) { %>
    <!-- Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=<%= settings.seo.googleAnalytics %>"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', '<%= settings.seo.googleAnalytics %>');
    </script>
    <% } %>

    <!-- Page-specific scripts -->
    <%- script %>
</body>
</html>