{% load i18n %}
{% load static %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% trans "GoLinks" %}</title>
    <link href="{% static 'css/dist/styles.css' %}" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.7.2/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <link rel="shortcut icon" type="image/x-icon" href="{% static 'favicon.ico' %}">
    <style>
        #search-results {
            background-color: white;
            border: 1px solid #e2e8f0;
            border-top: none;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            max-height: 200px;
            overflow-y: auto;
        }
        #search-results div {
            padding: 0.5rem 1rem;
            cursor: pointer;
            color: #4a5568;
        }
        #search-results div:hover, #search-results div.active {
            background-color: #e2e8f0;
        }

        /* Scroll-responsive navigation styles.
           IMPORTANT: do NOT animate the nav with `transform`. Any non-`none`
           transform on an ancestor makes it the containing block for its
           `position: fixed` descendants, which breaks the mobile menu dropdown
           (the dropdown uses `fixed inset-0` on mobile to overlay the viewport).
           We animate `top` instead. */
        .nav-hidden {
            top: -80px;
        }

        .nav-visible {
            top: 0;
        }

        nav {
            transition: top 0.3s ease-in-out;
        }

        /* Animated nav dropdowns.
           We toggle a `.menu-open` class instead of `hidden` so that CSS
           opacity/transform transitions run on open and close. */
        #more-menu-dropdown,
        #language-options {
            opacity: 0;
            pointer-events: none;
            transform: translateY(-10px);
            transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.28, 0.11, 0.32, 1);
        }
        #more-menu-dropdown.menu-open,
        #language-options.menu-open {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }
        /* Mobile: full-screen overlay slides down from the top */
        @media (max-width: 767px) {
            #more-menu-dropdown {
                transform: translateY(-12px);
                transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.28, 0.11, 0.32, 1);
            }
        }
        @media (prefers-reduced-motion: reduce) {
            #more-menu-dropdown,
            #language-options,
            #more-menu-dropdown.menu-open,
            #language-options.menu-open {
                transition: none;
                transform: none;
            }
        }

        /* Line clamp utilities for truncating text */
        .line-clamp-2 {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
    </style>
    {{ form.media }}
    {% block extra_css %}{% endblock %}
    {% block extra_head %}{% endblock %}
    <script src="{% static 'js/common.js' %}"></script>
</head>
<body class="bg-gray-100">
    <nav id="main-nav" class="bg-custom-blue text-white p-4 fixed w-full top-0 z-50 nav-visible">
        <div class="container mx-auto flex justify-between items-center">
            <a href="{% url 'link_list' %}" class="text-xl font-bold">{% trans "GoLinks" %}</a>
            <div class="flex items-center space-x-4">
                <!-- "Menus" 下拉菜单 -->
                <div class="relative group">
                    <button id="more-menu-button" class="flex items-center text-white hover:text-gray-200">
                        <i class="fas fa-bars mr-2"></i>
                        {% trans "Menu" %}
                    </button>
                    <div id="more-menu-dropdown" class="fixed inset-0 top-[57px] w-full rounded-none overflow-y-auto md:absolute md:inset-auto md:top-auto md:right-0 md:mt-2 md:w-48 md:rounded-md md:overflow-visible bg-white shadow-xl z-20">
                        <div class="grid grid-cols-3 gap-0.5 p-1.5 md:grid-cols-1 md:gap-0 md:p-0">
                        <a href="{% url 'search' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Search" %}</span>
                        </a>
                        <a href="{% url 'page-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Pages" %}</span>
                        </a>
                        <a href="{% url 'bookmark-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-5-7 5V5z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Bookmarks" %}</span>
                        </a>
                        <a href="{% url 'post-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-5 h-5 mb-1 md:w-4 md:h-4 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9.5a2 2 0 00-2-2h-2"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Posts" %}</span>
                        </a>
                        <a href="{% url 'screenshot-gallery' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Screenshots" %}</span>
                        </a>
                        <a href="{% url 'collection-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Images" %}</span>
                        </a>
                        <a href="{% url 'tag-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Tags" %}</span>
                        </a>
                        <a href="{% url 'api-docs' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-1.5 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "APIs" %}</span>
                        </a>

                        <a href="{% url 'netscan-dashboard' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "NetScan" %}</span>
                        </a>

                        <a href="{% url 'nginxmon-dashboard' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Nginx Monitor" %}</span>
                        </a>

                        <a href="{% url 'pricemon-dashboard' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Price Monitor" %}</span>
                        </a>

                        <a href="{% url 'routermon-dashboard' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.142 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Router Monitor" %}</span>
                        </a>

                        <a href="{% url 'invest-dashboard' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Invest" %}</span>
                        </a>

                        <a href="/jbot/" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "JBOT" %}</span>
                        </a>

                        <a href="{% url 'file-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Files" %}</span>
                        </a>

                        <a href="{% url 'mini-apps-list' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                      d="M19 11H5m14-4H5a2 2 0 00-2 2v6a2 2 0 002 2h14M9 7h1m4 0h1M9 17h1m4 0h1"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Mini Apps" %}</span>
                        </a>

                        <a href="{% url 'tools' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Tools" %}</span>
                        </a>

                        <a href="{% url 'help' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Help" %}</span>
                        </a>


                        <a href="{% url 'jobs' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Jobs" %}</span>
                        </a>
                        <a href="{% url 'site-settings' %}" class="flex flex-col items-center justify-center p-2.5 rounded-lg md:flex-row md:justify-start md:px-4 md:py-2 md:rounded-none transition-colors text-gray-700 hover:bg-gray-100">
                            <svg class="w-6 h-6 mb-1 md:w-5 md:h-5 md:mr-2 md:mb-0 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"/>
                            </svg>
                            <span class="text-[11px] leading-tight text-center md:text-sm md:text-left">{% trans "Settings" %}</span>
                        </a>
                        </div>
                    </div>
                </div>
                <!-- 语言选择器 -->
                <div class="relative">
                    <button id="language-selector-button" class="flex items-center text-white hover:text-gray-200">
                        <i class="fas fa-globe mr-2"></i>
                        {% get_current_language as LANGUAGE_CODE %}
                        {% get_language_info for LANGUAGE_CODE as current_language %}
                        {{ current_language.code|upper }}
                    </button>
                    <div id="language-options" class="absolute right-0 mt-2 py-2 w-48 bg-white rounded-md shadow-xl z-20">
                        <form action="{% url 'set_language' %}" method="post" id="language-form">
                            {% csrf_token %}
                            <input name="next" type="hidden" value="{{ request.path }}">
                            {% get_available_languages as LANGUAGES %}
                            {% get_language_info_list for LANGUAGES as languages %}
                            {% for language in languages %}
                                <button type="submit" name="language" value="{{ language.code }}" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {% if language.code == LANGUAGE_CODE %}font-bold{% endif %}">
                                    {{ language.name_local }} ({{ language.code|upper }})
                                </button>
                            {% endfor %}
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <div class="container mx-auto mt-20 p-2">
        {% if messages %}
            {% for message in messages %}
                <div class="flash-message bg-{{ message.tags }}-100 bg-yellow-100 border border-{{ message.tags }}-400 text-{{ message.tags }}-700 border-yellow-500 text-yellow-700 px-4 py-3 rounded relative mb-4 transition-all duration-500 ease-in-out" role="alert">
                    <span class="block sm:inline">{{ message }}</span>
                </div>
            {% endfor %}
        {% endif %}

        {% block content %}
        <h1 class="text-2xl font-bold mb-4">Welcome to GoLinks</h1>
        <p>If you can see this message, the base template is working correctly.</p>
        {% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.15.9/dist/cdn.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js"></script>
    <script>
        // Pass Django CSRF token to all HTMX requests automatically
        document.addEventListener('htmx:configRequest', function(e) {
            var token = document.cookie.match(/csrftoken=([^;]+)/)?.[1];
            if (token) e.detail.headers['X-CSRFToken'] = token;
        });
    </script>
    <script src="{% static 'js/navbar.js' %}"></script>
    <script>
        $(document).ready(function() {
            $('.select2').select2({
                theme: 'classic',
                width: '100%'
            });

            // Auto-dismiss flash messages after 5s with fade + collapse animation
            setTimeout(function() {
                $('.flash-message').each(function() {
                    $(this).css({'opacity': '0', 'max-height': $(this).outerHeight(true) + 'px', 'overflow': 'hidden', 'margin-bottom': $(this).css('margin-bottom')});
                    $(this).animate({'opacity': 0, 'max-height': 0, 'marginBottom': 0, 'paddingTop': 0, 'paddingBottom': 0}, 500, function() {
                        $(this).remove();
                    });
                });
            }, 5000);
        });
    </script>
    {% block extra_js %}{% endblock %}
    {% if BUILD_TIME %}
    <footer class="text-center text-gray-400 text-xs py-3 mt-4 border-t border-gray-100">
        Built at: {{ BUILD_TIME }} with ver: {{ BUILD_VERSION }}
    </footer>
    {% endif %}
</body>
</html>
