  /* ===== CSS VARIABLES ===== */
        :root {
            --bg-primary: #ffffff;
            --bg-secondary: #f8f9fa;
            --bg-card: #ffffff;
            --text-primary: #1a1a1a;
            --text-secondary: #6b7280;
            --accent: #3b82f6;
            --accent-hover: #2563eb;
            --border: #e5e7eb;
            --shadow: rgba(0, 0, 0, 0.1);
            --shadow-hover: rgba(0, 0, 0, 0.15);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --offline-badge: #10b981;
            --online-badge: #3b82f6;
        }

        [data-theme="dark"] {
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-card: #1e293b;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --border: #334155;
            --shadow: rgba(0, 0, 0, 0.3);
            --shadow-hover: rgba(0, 0, 0, 0.5);
        }

        /* ===== RESET & BASE ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            transition: var(--transition);
            overflow-x: hidden;
        }

        /* ===== HEADER ===== */
        header {
            position: sticky;
            top: 0;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(10px);
            box-shadow: 0 2px 10px var(--shadow);
        }

        .logo {
            font-size: 1.75rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent), #8b5cf6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .connection-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-secondary);
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--online-badge);
        }

        .status-dot.offline {
            background: #ef4444;
        }

        /* ===== THEME TOGGLE ===== */
        .theme-toggle {
            width: 50px;
            height: 28px;
            background: var(--bg-secondary);
            border-radius: 50px;
            border: 2px solid var(--border);
            position: relative;
            cursor: pointer;
            transition: var(--transition);
        }

        .theme-toggle:hover {
            border-color: var(--accent);
        }

        .theme-toggle-ball {
            width: 20px;
            height: 20px;
            background: var(--accent);
            border-radius: 50%;
            position: absolute;
            top: 2px;
            left: 2px;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
        }

        [data-theme="dark"] .theme-toggle-ball {
            transform: translateX(22px);
        }

        /* ===== SEARCH ICON & BAR ===== */
        .search-container {
            position: relative;
        }

        .search-icon {
            width: 40px;
            height: 40px;
            background: var(--bg-secondary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            border: 2px solid var(--border);
        }

        .search-icon:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .search-bar {
            position: fixed;
            width: 400px;
            max-width: 90vw;
            background: var(--bg-card);
            border-radius: 12px;
            padding: 1rem;
            box-shadow: 0 10px 40px var(--shadow-hover);
            border: 2px solid var(--border);
            display: none;
            z-index: 2000;
            cursor: move;
        }

        .search-bar.active {
            display: block;
            animation: searchSlideIn 0.3s ease;
        }

        @keyframes searchSlideIn {
            from {
                opacity: 0;
                transform: scale(0.95);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .search-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
            cursor: move;
        }

        .search-title {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .search-close {
            cursor: pointer;
            font-size: 1.25rem;
            color: var(--text-secondary);
            transition: var(--transition);
        }

        .search-close:hover {
            color: var(--text-primary);
        }

        .search-input {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 1rem;
            transition: var(--transition);
            cursor: text;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        /* ===== CATEGORIES ===== */
        .categories {
            padding: 2rem;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            scrollbar-color: var(--accent) var(--bg-secondary);
        }

        .categories::-webkit-scrollbar {
            height: 6px;
        }

        .categories::-webkit-scrollbar-track {
            background: var(--bg-secondary);
            border-radius: 10px;
        }

        .categories::-webkit-scrollbar-thumb {
            background: var(--accent);
            border-radius: 10px;
        }

        .category-list {
            display: flex;
            gap: 0.75rem;
            min-width: max-content;
        }

        .category-btn {
            padding: 0.75rem 1.5rem;
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: 50px;
            color: var(--text-primary);
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
        }

        .category-btn:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
        }

        .category-btn.active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        /* ===== TOOLS GRID ===== */
        .tools-container {
            padding: 0 2rem 4rem 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }

        .tools-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        /* ===== TOOL CARD ===== */
        .tool-card {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 1.5rem;
            border: 2px solid var(--border);
            transition: var(--transition);
            cursor: pointer;
            opacity: 0;
            animation: fadeInUp 0.5s ease forwards;
            text-decoration: none;
            color: inherit;
            display: block;
            position: relative;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .tool-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px var(--shadow-hover);
            border-color: var(--accent);
        }

        .tool-card.offline-only {
            border-left: 4px solid var(--offline-badge);
        }

        .offline-badge {
            position: absolute;
            top: 12px;
            right: 12px;
            background: var(--offline-badge);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .tool-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            display: block;
        }

        .tool-name {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .tool-description {
            color: var(--text-secondary);
            font-size: 0.95rem;
            line-height: 1.5;
        }

        .tool-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .tool-tag {
            padding: 0.25rem 0.75rem;
            background: var(--bg-secondary);
            border-radius: 50px;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        /* ===== LOADING STATE ===== */
        .loading {
            text-align: center;
            padding: 2rem;
            color: var(--text-secondary);
        }

        .no-results {
            text-align: center;
            padding: 3rem;
            color: var(--text-secondary);
            font-size: 1.1rem;
        }

        .offline-message {
            text-align: center;
            padding: 1rem;
            background: var(--bg-secondary);
            border-radius: 8px;
            margin: 1rem 2rem;
            color: var(--text-secondary);
            border-left: 4px solid var(--offline-badge);
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 768px) {
            header {
                padding: 1rem;
            }

            .logo {
                font-size: 1.5rem;
            }

            .categories {
                padding: 1rem;
            }

            .tools-container {
                padding: 0 1rem 2rem 1rem;
            }

            .tools-grid {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
                gap: 1rem;
            }

            .search-bar {
                width: 90vw;
            }

            .offline-message {
                margin: 1rem;
            }
        }