Update python-for-architects.html

D David Veksler · 1 year ago 6afad95882ec3468339ba91c3d64e303d68b4687
Parent: ac6eb6827

1 file changed +162 −119

Diff

diff --git a/python-for-architects.html b/python-for-architects.html
index 7ec7f5e..ee107f4 100644
--- a/python-for-architects.html
+++ b/python-for-architects.html
@@ -15,8 +15,8 @@
       name="description"
       content="Interactive Python cheatsheet for architects and senior developers. Covers Python versions, architectural patterns, key frameworks (Django, Flask, FastAPI), design patterns, data handling, concurrency, and deployment for building robust Python systems."
     />
-     <!-- Keywords -->
-    <meta name="keywords" content="Python, Cheatsheet, Architecture, Design Patterns, Django, Flask, FastAPI, SQLAlchemy, Asyncio, Concurrency, Microservices, Python 3, Software Development, Programming Guide, Python Best Practices">
+    <!-- Keywords -->
+    <meta name="keywords" content="Python, Cheatsheet, Architecture, Design Patterns, Django, Flask, FastAPI, SQLAlchemy, Asyncio, Concurrency, Microservices, Python 3, Software Development, Programming Guide, Python Best Practices, Tooltip">
 
 
     <!-- Canonical URL (Update this to your actual URL when deployed) -->
@@ -74,7 +74,7 @@
         "@type": "WebPage",
         "@id": "https://cheatsheets.davidveksler.com/python-for-architects.html"
       },
-      "keywords": "Python, Cheatsheet, Architecture, Design Patterns, Django, Flask, FastAPI, SQLAlchemy, Asyncio, Concurrency, Microservices, Python 3, Software Development, Programming Guide, Python Best Practices"
+      "keywords": "Python, Cheatsheet, Architecture, Design Patterns, Django, Flask, FastAPI, SQLAlchemy, Asyncio, Concurrency, Microservices, Python 3, Software Development, Programming Guide, Python Best Practices, Tooltip"
     }
     </script>
 
@@ -401,6 +401,8 @@
         background-color: var(--bs-primary-light);
         padding: 0.1em 0.4em;
         border-radius: 4px;
+        cursor: help; /* Indicate it's interactive */
+        border-bottom: 1px dotted var(--bs-primary-dark); /* Subtle underline */
       }
       a {
         color: var(--bs-primary);
@@ -418,6 +420,30 @@
         color: var(--bs-primary-dark);
       }
 
+      /* Bootstrap Tooltip Customization (Optional) */
+      .tooltip-inner {
+        background-color: var(--bs-primary-dark);
+        color: white;
+        font-size: 0.85rem;
+        max-width: 300px; /* Adjust as needed */
+        padding: 0.5rem 0.8rem;
+        border-radius: 4px;
+        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
+      }
+      .tooltip.bs-tooltip-top .tooltip-arrow::before {
+        border-top-color: var(--bs-primary-dark);
+      }
+      .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
+          border-bottom-color: var(--bs-primary-dark);
+      }
+      .tooltip.bs-tooltip-start .tooltip-arrow::before {
+          border-left-color: var(--bs-primary-dark);
+      }
+      .tooltip.bs-tooltip-end .tooltip-arrow::before {
+          border-right-color: var(--bs-primary-dark);
+      }
+
+
       /* --- Python Category Color Styling --- */
       .section-fundamentals,
       .card-fundamentals {
@@ -491,8 +517,8 @@
                 <h5><i class="bi bi-question-diamond-fill"></i> Why Python?</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Strengths in <span class="term">rapid development</span>, readability, vast libraries, and
-                    versatility across <span class="term">web, data science, AI/ML, and automation</span>.
+                    Strengths in <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Building software quickly and efficiently, often through iterative cycles.">rapid development</span>, readability, vast libraries, and
+                    versatility across <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Key areas where Python is widely used due to its libraries and ease of use.">web, data science, AI/ML, and automation</span>.
                     <a href="https://www.python.org/doc/essays/blurb/" target="_blank" rel="noopener noreferrer"
                       >Python's Philosophy</a
                     >
@@ -549,8 +575,8 @@
                 <h5><i class="bi bi-bricks"></i> Key Language Features</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Core features like <span class="term">OOP</span>, modules, dynamic typing, and
-                    <span class="term">powerful data structures</span> crucial for system design.
+                    Core features like <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Object-Oriented Programming: A paradigm based on 'objects' containing data and code.">OOP</span>, modules, dynamic typing, and
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Built-in types like lists, dictionaries, sets, and tuples for efficient data organization.">powerful data structures</span> crucial for system design.
                     <a href="https://docs.python.org/3/tutorial/classes.html" target="_blank" rel="noopener noreferrer"
                       >Python Classes</a
                     >
@@ -577,14 +603,14 @@
                     a duck...").
                   </li>
                   <li><strong>Exception Handling:</strong> Building resilient systems with `try-except-finally`.</li>
-                  <li><strong>Generators & Iterators <span class="version-tag">Python 2.2+</span>:</strong> Memory-efficient processing of large data sequences.</li>
-                  <li><strong>Decorators <span class="version-tag">Python 2.4+</span>:</strong> Modifying function/method behavior (e.g., logging, auth checks).</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Mechanisms for creating sequences of values lazily, saving memory.">Generators & Iterators</span> <span class="version-tag">Python 2.2+</span>:</strong> Memory-efficient processing of large data sequences.</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A way to modify or enhance functions/methods in a clean, reusable manner.">Decorators</span> <span class="version-tag">Python 2.4+</span>:</strong> Modifying function/method behavior (e.g., logging, auth checks).</li>
                   <li>
-                    <strong>Context Managers (`with` statement) <span class="version-tag">Python 2.5+</span>:</strong> Automatic resource management (files, locks,
+                    <strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Objects that manage resources (like files or network connections) automatically, ensuring cleanup via the 'with' statement.">Context Managers (`with` statement)</span> <span class="version-tag">Python 2.5+</span>:</strong> Automatic resource management (files, locks,
                     connections).
                   </li>
                   <li>
-                    <strong>Type Hinting (PEP 484) <span class="version-tag">Python 3.5+</span>:</strong> Optional static type checking for improved code quality and
+                    <strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Adding optional static type information to Python code for better clarity and error checking (PEP 484).">Type Hinting (PEP 484)</span> <span class="version-tag">Python 3.5+</span>:</strong> Optional static type checking for improved code quality and
                     maintainability using tools like Mypy.
                     <a href="https://peps.python.org/pep-0484/" target="_blank" rel="noopener noreferrer">PEP 484</a>
                   </li>
@@ -598,9 +624,9 @@
                 <h5><i class="bi bi-collection-fill"></i> Essential Standard Library</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Key modules like <span class="term">`os`</span>, <span class="term">`json`</span>,
-                    <span class="term">`datetime`</span>, <span class="term">`collections`</span>, and
-                    <span class="term">`asyncio`</span> for common tasks.
+                    Key modules like <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for interacting with the operating system.">`os`</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for working with JSON data.">`json`</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for working with dates and times.">`datetime`</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module providing specialized container datatypes.">`collections`</span>, and
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library framework for asynchronous I/O using coroutines.">`asyncio`</span> for common tasks.
                     <a href="https://docs.python.org/3/library/" target="_blank" rel="noopener noreferrer"
                       >Standard Library Docs</a
                     >
@@ -627,14 +653,14 @@
                     <strong>`collections`:</strong> Advanced data structures (e.g., `deque`, `Counter`, `defaultdict`).
                   </li>
                   <li>
-                    <strong>`multiprocessing` <span class="version-tag">Python 2.6+</span>, `threading`, `asyncio` <span class="version-tag">Python 3.4+/3.5+</span>, `concurrent.futures` <span class="version-tag">Python 3.2+</span>:</strong> Concurrency and
+                    <strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Module for creating processes to achieve true CPU parallelism, bypassing the GIL.">`multiprocessing`</span> <span class="version-tag">Python 2.6+</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Module for creating and managing threads, suitable for I/O-bound concurrency.">`threading`</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Framework for writing asynchronous code using async/await syntax.">`asyncio`</span> <span class="version-tag">Python 3.4+/3.5+</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="High-level interface for running tasks asynchronously using thread or process pools.">`concurrent.futures`</span> <span class="version-tag">Python 3.2+</span>:</strong> Concurrency and
                     parallelism. (See Concurrency section)
                   </li>
-                  <li><strong>`socket`:</strong> Low-level networking.</li>
-                  <li><strong>`logging` <span class="version-tag">Python 2.3+</span>:</strong> Flexible event logging system.</li>
-                  <li><strong>`argparse` <span class="version-tag">Python 2.7/3.2+</span>:</strong> Command-line argument parsing.</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Module providing low-level network communication capabilities (sockets).">`socket`</span>:</strong> Low-level networking.</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Flexible standard library module for event logging.">`logging`</span> <span class="version-tag">Python 2.3+</span>:</strong> Flexible event logging system.</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Module for parsing command-line options and arguments.">`argparse`</span> <span class="version-tag">Python 2.7/3.2+</span>:</strong> Command-line argument parsing.</li>
                   <li>
-                    <strong>`pathlib` <span class="version-tag">Python 3.4+</span>:</strong> Object-oriented filesystem paths.
+                    <strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Object-oriented interface for working with filesystem paths.">`pathlib`</span> <span class="version-tag">Python 3.4+</span>:</strong> Object-oriented filesystem paths.
                     <a href="https://docs.python.org/3/library/pathlib.html" target="_blank" rel="noopener noreferrer"
                       >Pathlib</a
                     >
@@ -657,7 +683,7 @@
                 <div class="card-content-wrapper">
                   <p class="summary">
                     Single, large codebase with tightly coupled components. Often built with frameworks like
-                    <span class="term">Django</span>.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A high-level, 'batteries-included' Python web framework emphasizing rapid development.">Django</span>.
                     <a
                       href="https://microservices.io/patterns/monolithic.html"
                       target="_blank"
@@ -716,8 +742,8 @@
                 <h5><i class="bi bi-grid-1x2-fill"></i> Microservices Architecture</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Collection of small, independent services. Python with <span class="term">Flask/FastAPI</span> for
-                    services, <span class="term">gRPC/REST</span> for communication.
+                    Collection of small, independent services. Python with <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Flask: lightweight microframework. FastAPI: modern API framework.">Flask/FastAPI</span> for
+                    services, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="gRPC: RPC framework. REST: API architectural style.">gRPC/REST</span> for communication.
                     <a href="https://microservices.io/" target="_blank" rel="noopener noreferrer">Microservices.io</a>
                   </p>
                   <button
@@ -770,9 +796,9 @@
                 <h5><i class="bi bi-broadcast-pin"></i> Event-Driven Architecture (EDA)</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Components communicate via asynchronous <span class="term">events</span>. Python with
-                    <span class="term">Kafka</span>, <span class="term">RabbitMQ</span>, or
-                    <span class="term">Celery</span>.
+                    Components communicate via asynchronous <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Significant occurrences or state changes used to trigger actions.">events</span>. Python with
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A distributed streaming platform often used as a message broker.">Kafka</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A popular open-source message broker.">RabbitMQ</span>, or
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A distributed task queue system for Python.">Celery</span>.
                     <a
                       href="https://martinfowler.com/articles/201701-event-driven.html"
                       target="_blank"
@@ -831,9 +857,9 @@
                 <h5><i class="bi bi-cloud-fog2-fill"></i> Serverless Architecture (FaaS)</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Run code without managing servers using <span class="term">AWS Lambda</span>,
-                    <span class="term">Google Cloud Functions</span>, <span class="term">Azure Functions</span>.
-                    Frameworks like <span class="term">Serverless Framework</span>, <span class="term">Zappa</span>.
+                    Run code without managing servers using <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Amazon Web Services' serverless compute service (FaaS).">AWS Lambda</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Google Cloud's serverless compute service (FaaS).">Google Cloud Functions</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Microsoft Azure's serverless compute service (FaaS).">Azure Functions</span>.
+                    Frameworks like <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Toolkit for building and deploying serverless apps across cloud providers.">Serverless Framework</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Tool for deploying Python WSGI apps on AWS Lambda.">Zappa</span>.
                     <a href="https://aws.amazon.com/serverless/" target="_blank" rel="noopener noreferrer"
                       >AWS Serverless</a
                     >
@@ -887,9 +913,9 @@
                 <h5><i class="bi bi-layers-fill"></i> Layered Architecture (N-Tier)</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Separates concerns into <span class="term">Presentation</span>,
-                    <span class="term">Application/Business Logic</span>, and
-                    <span class="term">Data Access</span> layers. Common in web apps.
+                    Separates concerns into <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Layer responsible for user interface and interaction.">Presentation</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Layer containing core application rules and processes.">Application/Business Logic</span>, and
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Layer responsible for interacting with data storage.">Data Access</span> layers. Common in web apps.
                     <a
                       href="https://learn.microsoft.com/en-us/dotnet/architecture/modern-web-apps-azure/common-web-application-architectures#n-layer-architecture-pattern"
                       target="_blank"
@@ -953,9 +979,9 @@
                 <h5><i class="bi bi-layout-three-columns"></i> Model-View-Template (MVT)</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    A variation of MVC used by <span class="term">Django</span>. <span class="term">Model</span> (data),
-                    <span class="term">View</span> (logic selecting data),
-                    <span class="term">Template</span> (presentation).
+                    A variation of MVC used by <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A high-level Python web framework.">Django</span>. <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Represents application data structure and logic (Django MVT).">Model</span> (data),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Handles request logic and selects the template (Django MVT).">View</span> (logic selecting data),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Defines the structure and presentation of the output (Django MVT).">Template</span> (presentation).
                     <a
                       href="https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Introduction#django_architecture"
                       target="_blank"
@@ -1016,7 +1042,7 @@
                 <h5><i class="bi bi-bounding-box-circles"></i> Django</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    High-level, "batteries-included" web framework for <span class="term">rapid development</span> of
+                    High-level, "<span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Comes with many built-in tools (ORM, admin, auth) out-of-the-box.">batteries-included</span>" web framework for <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Building software quickly and efficiently.">rapid development</span> of
                     secure and maintainable websites.
                     <a href="https://www.djangoproject.com/" target="_blank" rel="noopener noreferrer"
                       >Django Project</a
@@ -1037,7 +1063,7 @@
               <div class="collapse collapse-content" id="collapseDjango">
                 <h6>Core Features</h6>
                 <ul>
-                  <li><strong>ORM (Object-Relational Mapper):</strong> Powerful database abstraction.</li>
+                  <li><strong><span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Object-Relational Mapper: Maps Python objects to database tables.">ORM</span> (Object-Relational Mapper):</strong> Powerful database abstraction.</li>
                   <li><strong>Admin Interface:</strong> Auto-generated admin site for managing data.</li>
                   <li><strong>Templating Engine:</strong> For dynamic HTML generation.</li>
                   <li><strong>URL Routing:</strong> Clean and flexible URL design.</li>
@@ -1060,7 +1086,7 @@
                 <h5><i class="bi bi-lightning-charge"></i> Flask</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Micro-framework, <span class="term">lightweight and extensible</span>. Ideal for smaller
+                    Micro-framework, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Minimal core, relies on extensions for added functionality.">lightweight and extensible</span>. Ideal for smaller
                     applications, APIs, or as a component in larger systems.
                     <a href="https://flask.palletsprojects.com/" target="_blank" rel="noopener noreferrer"
                       >Flask Project</a
@@ -1108,7 +1134,7 @@
                 <h5><i class="bi bi-speedometer2"></i> FastAPI <span class="version-tag">Python 3.7+</span></h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Modern, high-performance web framework for building <span class="term">APIs</span> with Python type hints. Based on <span class="term">Starlette</span> and <span class="term">Pydantic</span>.
+                    Modern, high-performance web framework for building <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Application Programming Interfaces: Interfaces for software interaction.">APIs</span> with Python type hints. Based on <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A lightweight ASGI framework/toolkit for building async web services.">Starlette</span> and <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Library for data validation and settings management using type annotations.">Pydantic</span>.
                     <a href="https://fastapi.tiangolo.com/" target="_blank" rel="noopener noreferrer"
                       >FastAPI Project</a
                     >
@@ -1163,8 +1189,8 @@
                 <h5><i class="bi bi-calculator-fill"></i> Pandas & NumPy</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    <span class="term">NumPy</span> for numerical computing (arrays, matrices).
-                    <span class="term">Pandas</span> for data manipulation and analysis (DataFrames). Foundational for
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Fundamental package for numerical computing, providing N-dimensional arrays.">NumPy</span> for numerical computing (arrays, matrices).
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Library for data manipulation and analysis using DataFrames and Series.">Pandas</span> for data manipulation and analysis (DataFrames). Foundational for
                     data science. <a href="https://numpy.org/" target="_blank" rel="noopener noreferrer">NumPy</a> /
                     <a href="https://pandas.pydata.org/" target="_blank" rel="noopener noreferrer">Pandas</a>
                   </p>
@@ -1221,7 +1247,7 @@
                 <h5><i class="bi bi-robot"></i> Scikit-learn</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Comprehensive library for <span class="term">machine learning</span>. Provides tools for
+                    Comprehensive library for <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Field of AI focused on building systems that learn from data.">machine learning</span>. Provides tools for
                     classification, regression, clustering, dimensionality reduction, model selection, and
                     preprocessing.
                     <a href="https://scikit-learn.org/" target="_blank" rel="noopener noreferrer"
@@ -1273,7 +1299,7 @@
                 <h5><i class="bi bi-cpu-fill"></i> TensorFlow & PyTorch</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Leading <span class="term">deep learning</span> frameworks for building and training neural
+                    Leading <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Subfield of machine learning using multi-layered neural networks.">deep learning</span> frameworks for building and training neural
                     networks.
                     <a href="https://www.tensorflow.org/" target="_blank" rel="noopener noreferrer">TensorFlow</a> /
                     <a href="https://pytorch.org/" target="_blank" rel="noopener noreferrer">PyTorch</a>
@@ -1327,8 +1353,8 @@
                 <h5><i class="bi bi-plus-square-dotted"></i> Creational Patterns</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Concerned with object creation mechanisms. Examples: <span class="term">Singleton</span>,
-                    <span class="term">Factory Method</span>, <span class="term">Builder</span>.
+                    Concerned with object creation mechanisms. Examples: <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Ensures a class has only one instance and provides global access to it.">Singleton</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Defines an interface for creating an object, letting subclasses decide which class to instantiate.">Factory Method</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Separates object construction from its representation.">Builder</span>.
                     <a
                       href="https://refactoring.guru/design-patterns/creational-patterns"
                       target="_blank"
@@ -1380,8 +1406,8 @@
                 <div class="card-content-wrapper">
                   <p class="summary">
                     Concerned with how classes and objects are composed to form larger structures. Examples:
-                    <span class="term">Adapter</span>, <span class="term">Decorator</span>,
-                    <span class="term">Facade</span>.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Allows objects with incompatible interfaces to collaborate.">Adapter</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Attaches additional responsibilities to an object dynamically (related to Python's @ syntax).">Decorator</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Provides a simplified interface to a complex subsystem.">Facade</span>.
                     <a
                       href="https://refactoring.guru/design-patterns/structural-patterns"
                       target="_blank"
@@ -1431,8 +1457,8 @@
                 <div class="card-content-wrapper">
                   <p class="summary">
                     Concerned with algorithms and the assignment of responsibilities between objects. Examples:
-                    <span class="term">Observer</span>, <span class="term">Strategy</span>,
-                    <span class="term">Command</span>.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Defines a one-to-many dependency where observers are notified of state changes.">Observer</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Defines a family of interchangeable algorithms.">Strategy</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Encapsulates a request as an object.">Command</span>.
                     <a
                       href="https://refactoring.guru/design-patterns/behavioral-patterns"
                       target="_blank"
@@ -1493,7 +1519,7 @@
                 <h5><i class="bi bi-stack-overflow"></i> ORMs (SQLAlchemy, Django ORM)</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    <span class="term">SQLAlchemy</span>: Powerful, flexible ORM. <span class="term">Django ORM</span>:
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="A powerful SQL toolkit and ORM for Python.">SQLAlchemy</span>: Powerful, flexible ORM. <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="The Object Relational Mapper integrated with the Django framework.">Django ORM</span>:
                     Integrated into Django. For working with relational databases.
                     <a href="https://www.sqlalchemy.org/" target="_blank" rel="noopener noreferrer">SQLAlchemy</a>
                   </p>
@@ -1534,8 +1560,8 @@
                 <h5><i class="bi bi-file-earmark-zip-fill"></i> NoSQL Databases</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Interfacing with <span class="term">MongoDB</span> (PyMongo),
-                    <span class="term">Redis</span> (redis-py), <span class="term">Cassandra</span> (cassandra-driver),
+                    Interfacing with <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Popular NoSQL document database.">MongoDB</span> (PyMongo),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="In-memory data store often used as cache or message broker.">Redis</span> (redis-py), <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Distributed NoSQL wide-column store for high availability.">Cassandra</span> (cassandra-driver),
                     etc., for diverse data storage needs.
                     <a href="https://pymongo.readthedocs.io/" target="_blank" rel="noopener noreferrer">PyMongo</a>,
                     <a href="https://redis-py.readthedocs.io/" target="_blank" rel="noopener noreferrer">redis-py</a>
@@ -1584,9 +1610,9 @@
                 <h5><i class="bi bi-braces"></i> Data Serialization</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Handling formats like <span class="term">JSON</span> (`json` module <span class="version-tag">Py 2.6+</span>),
-                    <span class="term">Protocol Buffers</span> (`protobuf`),
-                    <span class="term">Avro</span> (`fastavro`), XML for data interchange.
+                    Handling formats like <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="JavaScript Object Notation: Lightweight text-based data interchange format.">JSON</span> (`json` module <span class="version-tag">Py 2.6+</span>),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Google's efficient binary format for serializing structured data.">Protocol Buffers</span> (`protobuf`),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Binary format with schema evolution support, common in Hadoop/Kafka.">Avro</span> (`fastavro`), XML for data interchange.
                     <a href="https://docs.python.org/3/library/json.html" target="_blank" rel="noopener noreferrer"
                       >JSON module</a
                     >
@@ -1658,7 +1684,7 @@
                 <div class="card-content-wrapper">
                   <p class="summary">
                     A mutex that protects access to Python objects, preventing multiple native threads from executing
-                    Python bytecodes at once in <span class="term">CPython</span>.
+                    Python bytecodes at once in <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="The standard, most widely-used implementation of Python.">CPython</span>.
                     <a
                       href="https://wiki.python.org/moin/GlobalInterpreterLock"
                       target="_blank"
@@ -1711,8 +1737,8 @@
                 <h5><i class="bi bi-intersect"></i> Threading & Multiprocessing</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    <span class="term">`threading`</span> for I/O-bound tasks.
-                    <span class="term">`multiprocessing` <span class="version-tag">Python 2.6+</span></span> for CPU-bound tasks to achieve true parallelism.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for creating threads (good for I/O-bound tasks).">`threading`</span> for I/O-bound tasks.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for creating processes (bypasses GIL for CPU-bound tasks).">`multiprocessing` <span class="version-tag">Python 2.6+</span></span> for CPU-bound tasks to achieve true parallelism.
                     <a href="https://docs.python.org/3/library/threading.html" target="_blank" rel="noopener noreferrer"
                       >Threading</a
                     >,
@@ -1787,7 +1813,7 @@
                 <h5><i class="bi bi-hurricane"></i> Asyncio (async/await) <span class="version-tag">Python 3.5+</span></h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Asynchronous programming with <span class="term">`async/await`</span> syntax for concurrent
+                    Asynchronous programming with <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Keywords defining and pausing/resuming asynchronous functions (coroutines).">`async/await`</span> syntax for concurrent
                     I/O-bound tasks using a single thread and an event loop.
                     <a href="https://docs.python.org/3/library/asyncio.html" target="_blank" rel="noopener noreferrer"
                       >Asyncio Docs</a
@@ -1852,9 +1878,9 @@
                 <h5><i class="bi bi-check2-circle"></i> Testing Frameworks</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    <span class="term">PyTest</span> for rich features and less boilerplate.
-                    <span class="term">Unittest</span> (standard library) for xUnit style.
-                    <span class="term">unittest.mock</span> for mocking.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Popular, feature-rich testing framework known for fixtures and simple asserts.">PyTest</span> for rich features and less boilerplate.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Python's standard library testing framework (xUnit style).">Unittest</span> (standard library) for xUnit style.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Library for creating mock objects to isolate components during testing.">unittest.mock</span> for mocking.
                     <a href="https://docs.pytest.org/" target="_blank" rel="noopener noreferrer">PyTest</a>
                   </p>
                   <button
@@ -1904,8 +1930,8 @@
                 <h5><i class="bi bi-palette-fill"></i> Linters & Formatters</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    <span class="term">Flake8</span>, <span class="term">Pylint</span> for linting.
-                    <span class="term">Black</span>, <span class="term">isort</span> for auto-formatting to enforce code
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Checks code for style (PEP 8), errors (PyFlakes), and complexity (McCabe).">Flake8</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Extensive static code analysis for errors, style, and code smells.">Pylint</span> for linting.
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Opinionated code formatter for enforcing consistent style automatically.">Black</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Utility to sort Python imports alphabetically and by section.">isort</span> for auto-formatting to enforce code
                     style (e.g., PEP 8).
                     <a href="https://black.readthedocs.io/" target="_blank" rel="noopener noreferrer">Black</a>
                   </p>
@@ -1961,8 +1987,8 @@
                 <h5><i class="bi bi-rocket-launch-fill"></i> Deployment & DevOps</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    WSGI/ASGI servers (<span class="term">Gunicorn</span>, <span class="term">Uvicorn</span>),
-                    <span class="term">Docker</span>, Kubernetes, CI/CD (GitHub Actions, Jenkins), virtual environments (<span class="term">venv</span> <span class="version-tag">Py 3.3+</span>).
+                    WSGI/ASGI servers (<span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="WSGI HTTP Server for UNIX, common for deploying sync Python web apps.">Gunicorn</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Fast ASGI server, common for deploying async Python web apps.">Uvicorn</span>),
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Platform for packaging and running applications in containers.">Docker</span>, Kubernetes, CI/CD (GitHub Actions, Jenkins), virtual environments (<span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library module for creating isolated Python environments.">venv</span> <span class="version-tag">Py 3.3+</span>).
                     <a href="https://gunicorn.org/" target="_blank" rel="noopener noreferrer">Gunicorn</a>,
                     <a href="https://www.uvicorn.org/" target="_blank" rel="noopener noreferrer">Uvicorn</a>
                   </p>
@@ -2032,8 +2058,8 @@
                 <h5><i class="bi bi-shield-shaded"></i> OWASP Top 10 in Python</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Addressing common web vulnerabilities: <span class="term">Injection</span>,
-                    <span class="term">XSS</span>, <span class="term">Insecure Deserialization</span>. Use ORMs,
+                    Addressing common web vulnerabilities: <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Vulnerability allowing attackers to inject malicious code (e.g., SQL).">Injection</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Cross-Site Scripting: Injecting malicious scripts into web pages.">XSS</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Vulnerability from processing untrusted serialized data.">Insecure Deserialization</span>. Use ORMs,
                     template auto-escaping.
                     <a href="https://owasp.org/Top10/" target="_blank" rel="noopener noreferrer">OWASP Top 10</a>
                   </p>
@@ -2096,8 +2122,8 @@
                 <h5><i class="bi bi-key-fill"></i> Auth & Secrets Management</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Authentication/Authorization (OAuth, JWT with <span class="term">PyJWT</span>).
-                    <span class="term">Secrets management</span> using environment variables, Vault, or cloud KMS.
+                    Authentication/Authorization (OAuth, JWT with <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Python library for encoding and decoding JSON Web Tokens (JWT).">PyJWT</span>).
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Securely storing and controlling access to sensitive info (API keys, passwords).">Secrets management</span> using environment variables, Vault, or cloud KMS.
                     <a href="https://pyjwt.readthedocs.io/" target="_blank" rel="noopener noreferrer">PyJWT</a>
                   </p>
                   <button
@@ -2161,7 +2187,7 @@
                 <h5><i class="bi bi-shield-check"></i> Dependency & Code Security</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Tools like <span class="term">`pip-audit`</span> or <span class="term">`safety`</span> for checking
+                    Tools like <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Scans Python dependencies for known vulnerabilities using PyPI advisory DB.">`pip-audit`</span> or <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Checks installed dependencies for known security vulnerabilities.">`safety`</span> for checking
                     known vulnerabilities in dependencies. Secure coding practices.
                     <a href="https://pypi.org/project/pip-audit/" target="_blank" rel="noopener noreferrer"
                       >pip-audit</a
@@ -2236,8 +2262,8 @@
                 <h5><i class="bi bi-speedometer"></i> Profiling & Optimization</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Identify performance bottlenecks using <span class="term">`cProfile`</span>,
-                    <span class="term">`line_profiler`</span>, <span class="term">`memory_profiler`</span>. Optimize
+                    Identify performance bottlenecks using <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Built-in profiler for function execution time statistics.">`cProfile`</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Third-party tool for line-by-line execution time profiling.">`line_profiler`</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Third-party tool for line-by-line memory usage analysis.">`memory_profiler`</span>. Optimize
                     critical sections.
                     <a href="https://docs.python.org/3/library/profile.html" target="_blank" rel="noopener noreferrer"
                       >Profiling Docs</a
@@ -2302,9 +2328,8 @@
                 <h5><i class="bi bi-archive-fill"></i> Caching Strategies</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Improve performance and reduce load by caching data. In-memory (<span class="term"
-                      >`functools.lru_cache` <span class="version-tag">Py 3.2+</span></span
-                    >), distributed (<span class="term">Redis</span>, <span class="term">Memcached</span>), HTTP
+                    Improve performance and reduce load by caching data. In-memory (<span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Standard library decorator for caching function results (Least Recently Used).">`functools.lru_cache` <span class="version-tag">Py 3.2+</span></span
+                    >), distributed (<span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="In-memory data store, often used as a distributed cache.">Redis</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Distributed memory object caching system.">Memcached</span>), HTTP
                     caching.
                     <a
                       href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching"
@@ -2362,8 +2387,8 @@
                 <h5><i class="bi bi-lightbulb-fill"></i> Pythonic Idioms & Best Practices</h5>
                 <div class="card-content-wrapper">
                   <p class="summary">
-                    Writing clean, readable, and efficient Python code. Follow <span class="term">PEP 8</span>,
-                    <span class="term">PEP 20 (Zen of Python)</span>. Favor composition, use context managers.
+                    Writing clean, readable, and efficient Python code. Follow <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="The official style guide for Python code.">PEP 8</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Guiding principles for Python's design.">PEP 20 (Zen of Python)</span>. Favor composition, use context managers.
                     <a href="https://peps.python.org/pep-0020/" target="_blank" rel="noopener noreferrer"
                       >Zen of Python</a
                     >
@@ -2438,10 +2463,10 @@
                 <h5 class="text-center"><i class="bi bi-building-gear"></i> Architectural Decision Points</h5>
                 <div class="card-content-wrapper">
                   <p class="summary text-center">
-                    Python architects must balance <span class="term">scalability</span>,
-                    <span class="term">resilience</span>, <span class="term">security</span>,
-                    <span class="term">maintainability</span>, <span class="term">performance</span>,
-                    <span class="term">deployment</span>, and <span class="term">cost</span>. Choosing appropriate
+                    Python architects must balance <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Ability of a system to handle increasing load.">scalability</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Ability of a system to recover from failures.">resilience</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Protecting systems and data from threats.">security</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Ease of modifying and enhancing software.">maintainability</span>, <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Efficiency of resource usage (time, CPU, memory).">performance</span>,
+                    <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Process of making software available for use.">deployment</span>, and <span class="term" data-bs-toggle="tooltip" data-bs-placement="top" title="Monetary expense of development, deployment, and operation.">cost</span>. Choosing appropriate
                     patterns, frameworks, and libraries is vital.
                     <a href="https://martinfowler.com/architecture/" target="_blank" rel="noopener noreferrer"
                       >Martin Fowler on Architecture</a
@@ -2561,17 +2586,24 @@
           <i class="bi bi-mortarboard-fill"></i> Real Python
         </a>
       </div>
+      <p id="copyright" class="mt-2" style="font-size: 0.8em;">&copy; <span id="currentYear"></span> David Veksler</p>
     </footer>
 
     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
     <script>
       document.addEventListener("DOMContentLoaded", () => {
+        // --- Initialize Bootstrap Tooltips ---
+        const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
+        const tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
+            return new bootstrap.Tooltip(tooltipTriggerEl);
+        });
+
+        // --- Filter and Search Logic ---
         const mainContainer = document.getElementById('main-container');
         const searchBox = document.getElementById('search-box');
         const categoryFiltersContainer = document.getElementById('category-filters');
         const noResultsDiv = document.getElementById('no-results');
         const allSchemaContainers = Array.from(document.querySelectorAll('.schema-container'));
-        // const allInfoCards = Array.from(document.querySelectorAll('.info-card')); // Not directly used in this simplified version
 
         let activeFilter = 'all';
 
@@ -2599,10 +2631,18 @@
                                         .replace(' & Parallelism','')
                                         .replace(' & Performance','')
                                         .replace(' (General)','')
+                                        .replace('Python ','') // More generic replacements
+                                        .replace('Architectural ','')
+                                        .replace('Handling','')
+                                        .replace('Considerations','')
+                                        .trim()
                                      : 'Unnamed Section');
                 const button = document.createElement('button');
                 button.type = 'button';
                 button.classList.add('btn', 'btn-outline-secondary', 'filter-btn');
+                // Add specific color outline based on section category if desired
+                // Example: button.style.borderColor = `var(--py-color-${section.classList[1].replace('section-','')})`;
+                //          button.style.color = `var(--py-color-${section.classList[1].replace('section-','')})`;
                 button.textContent = sectionName;
                 button.dataset.filter = sectionId;
                 btnGroup.appendChild(button);
@@ -2617,13 +2657,15 @@
                     event.target.classList.add('active');
                     activeFilter = event.target.dataset.filter;
                     applyFiltersAndSearch();
+                    // Optionally scroll to the top of the container or first visible section
+                     window.scrollTo({ top: mainContainer.offsetTop - 80, behavior: 'smooth' }); // Adjust offset as needed
                 }
             });
         }
 
         function applyFiltersAndSearch() {
             const searchTerm = searchBox.value.toLowerCase().trim();
-            let itemsFound = 0;
+            let itemsFoundCount = 0; // Changed variable name for clarity
 
             allSchemaContainers.forEach(section => {
                 const sectionId = section.dataset.sectionId;
@@ -2637,61 +2679,58 @@
                     const cardDetailsCollapse = card.querySelector('.collapse-content');
                     const cardDetailsText = cardDetailsCollapse ? cardDetailsCollapse.textContent.toLowerCase() : '';
                     const versionTag = card.querySelector('.version-tag') ? card.querySelector('.version-tag').textContent.toLowerCase() : '';
+                    const termElements = Array.from(card.querySelectorAll('.term'));
+                    const termText = termElements.map(term => term.textContent.toLowerCase()).join(' ');
+                    const termTitles = termElements.map(term => term.getAttribute('title') ? term.getAttribute('title').toLowerCase() : '').join(' ');
+
 
-                    const cardTextContent = `${cardTitle} ${cardSummary} ${cardDetailsText} ${versionTag}`;
+                    // Include title, summary, details, version tags, term text, and term tooltips in search
+                    const cardTextContent = `${cardTitle} ${cardSummary} ${cardDetailsText} ${versionTag} ${termText} ${termTitles}`;
 
                     const matchesSearch = searchTerm === '' || cardTextContent.includes(searchTerm);
                     const matchesFilter = activeFilter === 'all' || sectionId === activeFilter;
 
-                    if (matchesSearch && matchesFilter) {
-                        card.closest('.col-lg-4.col-md-6').style.display = '';
-                        card.style.display = 'flex';
+                    const cardWrapper = card.closest('.col-lg-4.col-md-6'); // Get the column wrapper
+
+                     if (matchesSearch && matchesFilter) {
+                        if (cardWrapper) cardWrapper.style.display = ''; // Show column
+                        card.style.display = 'flex'; // Ensure card itself is flex (its default)
                         sectionHasVisibleCards = true;
-                        itemsFound++;
+                        itemsFoundCount++; // Increment count for each visible card
                     } else {
-                        card.closest('.col-lg-4.col-md-6').style.display = 'none';
-                        card.style.display = 'none';
+                        if (cardWrapper) cardWrapper.style.display = 'none'; // Hide column
+                        card.style.display = 'none'; // Hide card (redundant if column is hidden, but safe)
                     }
                 });
 
-                if ((activeFilter === 'all' || sectionId === activeFilter) && sectionHasVisibleCards) {
+                 // Determine section visibility
+                const sectionShouldBeVisibleBasedOnFilter = (activeFilter === 'all' || sectionId === activeFilter);
+                const sectionShouldBeVisible = sectionShouldBeVisibleBasedOnFilter && sectionHasVisibleCards;
+
+                if (sectionShouldBeVisible) {
                     section.style.display = '';
-                } else if (activeFilter !== 'all' && sectionId !== activeFilter) {
-                    section.style.display = 'none';
-                } else if (!sectionHasVisibleCards && searchTerm !== '') {
-                    section.style.display = 'none';
-                } else if (!sectionHasVisibleCards && activeFilter !== 'all') {
+                } else {
+                     // Hide section if it doesn't match the filter OR if it has no visible cards matching the search
                      section.style.display = 'none';
                 }
-                 else if (!sectionHasVisibleCards && activeFilter === 'all' && searchTerm !== '') {
-                    section.style.display = 'none'; // Hide if "All" categories but search yields no cards in section
-                }
-                 else if (activeFilter === 'all' && !sectionHasVisibleCards && searchTerm === '') {
-                     //This case should not hide the section if no search term, but can happen if section is empty
+
+                // Special case: If "All Categories" is selected and there's a search term,
+                // ensure sections without matching cards are hidden.
+                 if (activeFilter === 'all' && searchTerm !== '' && !sectionHasVisibleCards) {
+                    section.style.display = 'none';
                  }
-                  else {
-                     // Default fallback if a section has no visible cards after filtering/searching
-                     section.style.display = 'none';
+                 // Special case: Ensure all sections are visible if 'All Categories' and no search term
+                 else if (activeFilter === 'all' && searchTerm === '') {
+                     section.style.display = '';
                  }
 
 
-                // If "All Categories" is selected and there's a search term, only show sections with matching cards
-                if (activeFilter === 'all' && searchTerm !== '') {
-                    if (sectionHasVisibleCards) {
-                        section.style.display = '';
-                    } else {
-                        section.style.display = 'none';
-                    }
-                } else if (activeFilter === 'all' && searchTerm === '') {
-                     section.style.display = ''; // Show all sections if "All Categories" and no search
-                }
-
-
             });
 
-            noResultsDiv.style.display = itemsFound === 0 ? 'block' : 'none';
+             noResultsDiv.style.display = itemsFoundCount === 0 ? 'block' : 'none';
         }
 
+        // --- Collapse Toggle Icon Logic ---
         const collapseElements = document.querySelectorAll(".collapse");
         collapseElements.forEach((collapseEl) => {
           const button = document.querySelector(`.details-toggle[data-bs-target="#${collapseEl.id}"]`);
@@ -2709,8 +2748,10 @@
               }
             };
 
+            // Set initial state
             updateIconAndButton(collapseEl.classList.contains("show"));
 
+            // Add event listeners
             collapseEl.addEventListener("show.bs.collapse", () => {
               updateIconAndButton(true);
             });
@@ -2720,10 +2761,12 @@
           }
         });
 
+        // --- Update Copyright Year ---
         document.getElementById("currentYear").textContent = new Date().getFullYear();
-        // Initialize and apply filters
+
+        // --- Initialize Filters and Apply Initial State ---
         initializeFiltersAndSearch();
-        applyFiltersAndSearch(); // Apply initial filter ("All")
+        applyFiltersAndSearch(); // Apply initial filter ("All") and search (empty)
       });
     </script>
   </body>