<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex, nofollow" />

    <title>{% block title %}Component Preview{% endblock %}</title>

    <!-- Use the same CSS as the main layout for consistency -->
    <link rel="preload" href="{{ vite('css/app.less') }}" as="style">
    <link rel="stylesheet" href="{{ vite('css/app.less') }}" />

    <!-- Fonts (same as main layout) -->
    <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=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Barlow+Semi+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">

    <style>
        body {
            font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            line-height: 1.5;
            margin: 0;
            padding: 0;
            background: #f8f9fa;
        }

        .component-preview-container {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .component-preview-header {
            background: white;
            border-bottom: 1px solid #e9ecef;
            padding: 1rem 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .component-preview-content {
            flex: 1;
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
            box-sizing: border-box;
        }

        .component-preview-back-link {
            color: #007bff;
            text-decoration: none;
            font-size: 0.875rem;
            padding: 0.5rem 2rem;
            display: inline-block;
            border-bottom: 1px solid transparent;
            transition: border-color 0.2s;
        }

        .component-preview-back-link:hover {
            border-bottom-color: #007bff;
        }

        .component-info-panel {
            background: white;
            border-radius: 8px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .component-info-panel h1 {
            margin: 0 0 0.5rem 0;
            color: #333;
            font-size: 2rem;
        }

        .component-info-panel .component-description {
            color: #666;
            margin: 0 0 2rem 0;
            font-size: 1.1rem;
        }

        .component-info-panel h2 {
            margin: 2rem 0 1rem 0;
            color: #495057;
            font-size: 1.25rem;
            border-bottom: 1px solid #e9ecef;
            padding-bottom: 0.5rem;
        }

        .component-info-panel pre {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 4px;
            padding: 1rem;
            overflow-x: auto;
            font-size: 0.875rem;
            margin: 1rem 0;
        }

        .component-info-panel code {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            padding: 0.125rem 0.25rem;
            border-radius: 3px;
            font-size: 0.875rem;
        }

        .component-variables {
            display: flex;
            gap: 2rem;
            margin: 1rem 0;
        }

        .component-variables > div {
            flex: 1;
        }

        .component-variables h4 {
            margin: 0 0 0.5rem 0;
            color: #495057;
        }

        .variable-list {
            font-size: 0.875rem;
            color: #6c757d;
        }

        .component-output-panel {
            background: white;
            border-radius: 8px;
            padding: 2rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .component-output-panel h3 {
            margin: 0 0 1rem 0;
            color: #495057;
            font-size: 1.25rem;
            border-bottom: 1px solid #e9ecef;
            padding-bottom: 0.5rem;
        }

        .component-output {
            /* Reset styles to let component use its own styling */
            margin: 0;
            padding: 0;
        }

        .error-panel {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            border-radius: 8px;
            padding: 2rem;
            color: #721c24;
            margin-bottom: 2rem;
        }

        .error-panel h2 {
            margin: 0 0 1rem 0;
            color: #721c24;
        }

        .error-panel pre {
            background: #f5c6cb;
            border: 1px solid #f1aeb5;
            border-radius: 4px;
            padding: 1rem;
            white-space: pre-wrap;
            font-size: 0.875rem;
            margin: 1rem 0 0 0;
        }

        @media (max-width: 768px) {
            .component-preview-content {
                padding: 1rem;
            }

            .component-info-panel,
            .component-output-panel {
                padding: 1rem;
            }

            .component-variables {
                flex-direction: column;
                gap: 1rem;
            }
        }
    </style>

    {% block head %}{% endblock %}
</head>

<body>
    <div id="vue_environment" class="component-preview-container">
        <div class="component-preview-header">
            <a href="/component" class="component-preview-back-link">
                ← Back to Component Registry
            </a>
        </div>

        <div class="component-preview-content">
            {% block content %}{% endblock %}
        </div>
    </div>

    <!-- UPDATED: Use the same JS as the main layout for component functionality -->
    {% for href in vite_css('js/app.js') %}
      <link rel="stylesheet" href="{{ href }}" />
    {% endfor %}

    <script src="{{ vite('js/app.js') }}" type="module"></script>

    {% block scripts %}{% endblock %}
</body>
</html>