/*assets/css/style.css*/

/* ==========================================================================
   1. VARIABLES & BASE STYLES
   ========================================================================== */

/* 1.1 Color Variables (Root & Light Mode) */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #1c1c1c;
  --bg-secondary: #2a2a2a;
  --bg-tertiary: #222;
  --bg-gradient-start: #2a2a2a;
  --bg-gradient-end: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #ccc;
  --text-heading: #fff;
  --text-disabled: #555;
  --border-primary: #444;
  --border-secondary: #383838;
  --accent-primary: #5271ff;
  --accent-primary-hover: #2e48c0;
  --accent-primary-transparent: rgba(228, 77, 38, 0.3);
  --accent-border: rgba(228, 77, 38, 0.5);
  --accent-glow: rgba(228, 77, 38, 0.5);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-strong-color: rgba(0, 0, 0, 0.4);
  --shadow-text-color: rgba(0, 0, 0, 0.7);
  --card-border-light-trans: rgba(255, 255, 255, 0.1);
  --card-bg-trans: rgba(42, 42, 42, 0.7);
  --spinner-base: rgba(228, 77, 38, 0.2);
  --spinner-top: var(--accent-primary);
  --card-sheen-gradient: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0)
  );
  --bg-overlay-dark: rgba(0, 0, 0, 0.8);
  --element-bg-hover: #3a3a3a;

  /* Semantic Colors */
  --color-success: #4caf50;
  --color-warning: #ff9800;
  --color-danger: #f44336;
  --color-info: #2196f3;
  --color-open-source: #8b4513;
  --color-contact: #9c27b0;
  --color-success-bg: rgba(76, 175, 80, 0.15);
  --color-danger-bg: rgba(244, 67, 54, 0.15);

  /* Transitions */
  --transition-speed: 0.3s;
}

body.light-mode {
  --bg-primary: #f4f4f4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e0e0e0;
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #f0f0f0;
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-heading: #111111;
  --text-disabled: #aaaaaa;
  --border-primary: #cccccc;
  --border-secondary: #dddddd;
  --accent-primary-transparent: rgba(228, 77, 38, 0.15);
  --accent-border: rgba(228, 77, 38, 0.4);
  --accent-glow: rgba(228, 77, 38, 0.3);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --shadow-strong-color: rgba(0, 0, 0, 0.15);
  --shadow-text-color: rgba(0, 0, 0, 0.2);
  --card-border-light-trans: rgba(0, 0, 0, 0.1);
  --card-bg-trans: rgba(255, 255, 255, 0.8);
  --spinner-base: rgba(228, 77, 38, 0.15);
  --card-sheen-gradient: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0)
  );
  --bg-overlay-dark: rgba(244, 244, 244, 0.85);
  --element-bg-hover: #e8e8e8;
  --color-success-bg: rgba(76, 175, 80, 0.1);
  --color-danger-bg: rgba(244, 67, 54, 0.1);
  --color-danger: #d32f2f;
  --color-open-source: #795548;
}

/* 1.2 Base Element Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}
a:hover {
  color: var(--accent-primary-hover);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ==========================================================================
   2. LAYOUT COMPONENTS
   ========================================================================== */

/* 2.1 Site Header */
.site-header {
  background-color: var(--bg-secondary);
  padding: 0.5rem 2rem; /* Adjusted padding */
  box-shadow: 0 2px 5px var(--shadow-color);
  position: sticky; /* Will stick to the top of the .main-wrapper */
  top: 0;
  z-index: 1000; /* Lower than sidebar */
  border-bottom: 1px solid var(--border-primary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.header-container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  justify-content: space-between; /* Keeps hamburger left, icons right */
  align-items: center;
}

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

/* On desktop, align the header actions to the far right */
@media (min-width: 993px) {
  .header-container {
    justify-content: flex-end;
  }
}

.site-logo {
  display: flex;
  align-items: center;
  padding: 2px 0; /* From original .site-logo */
  text-decoration: none;
  /* Styles from old .logo a, if this is the main logo link */
  color: var(--text-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.site-logo img {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

/* 2.2 Main Navigation (Desktop & Mobile Toggle/Menu) */
.main-nav {
  display: flex;
  align-items: center;
}
.main-nav ul#nav-menu {
  /* More specific selector for the main UL */
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  margin: 0;
  border: 1px solid var(--border-primary);
  padding: 2px 26px;
  border-radius: 50px; /* Pill shape */
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 5px var(--shadow-color);
}
.main-nav li {
  /* General LI, margin reset from older style */
  margin: 0;
}
.main-nav ul#nav-menu li a {
  /* Specific to links in the main menu */
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0.8rem; /* From newer header style */
  border-radius: 4px; /* From newer header style */
  display: flex;
  align-items: center;
  gap: 0.5rem; /* From newer header style */
  font-size: 0.9rem; /* From newer header style */
  transition: color var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
}
.main-nav ul#nav-menu li a:after {
  /* Underline effect */
  content: "";
  position: absolute;
  bottom: 0; /* Relative to padding of <a> if padding-bottom was on <a> */
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-primary);
  transition: width var(--transition-speed) ease;
}
.main-nav ul#nav-menu li a:hover {
  color: var(--text-heading);
}
.main-nav ul#nav-menu li a:hover:after,
.main-nav ul#nav-menu li a.active:after {
  width: 100%;
}
.main-nav ul#nav-menu li a i {
  font-size: 0.9rem;
}

/* Hamburger Toggle */
#mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 10; /* Relative to mobile menu's z-index */
  margin-left: auto; /* If .main-nav needs to push it right */
}
#mobile-menu-toggle span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: transform 0.25s ease-in-out, top 0.25s ease-in-out,
    opacity 0.25s ease-in-out, background-color var(--transition-speed) ease;
}
#mobile-menu-toggle span:nth-child(1) {
  top: 0;
}
#mobile-menu-toggle span:nth-child(2) {
  top: 10px;
}
#mobile-menu-toggle span:nth-child(3) {
  top: 20px;
}

#mobile-menu-toggle.open span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}
#mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}
#mobile-menu-toggle.open span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* 2.3 Site Footer */
.site-footer {
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-primary);
  padding: 40px 0 20px;
  margin-top: 60px;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer-branding {
  display: flex;
  flex-direction: column;
}
.footer-logo {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-heading);
}
.footer-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}
.social-links {
  display: flex;
  gap: 15px;
  margin-top: 5px;
}
.social-links a {
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
  font-size: 1.2rem;
}
.social-links a:hover {
  color: var(--accent-primary);
}
.footer-heading {
  font-size: 1.1rem;
  color: var(--text-heading);
  margin-bottom: 15px;
  font-weight: 600;
}
.quick-links-list {
  list-style: none;
}
.quick-links-list li {
  margin-bottom: 10px;
}
.quick-links-list a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease,
    transform var(--transition-speed) ease;
  display: inline-block;
}
.quick-links-list a:hover {
  color: var(--accent-primary);
  transform: translateX(3px);
}
.contact-info {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.contact-info p {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-info i {
  color: var(--accent-primary);
  width: 16px;
  text-align: center;
}
.contact-info a {
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}
.contact-info a:hover {
  color: var(--accent-primary);
}
.feedback-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  margin-top: 5px;
  transition: color var(--transition-speed) ease;
}
.feedback-link:hover {
  color: var(--accent-primary);
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: border-color var(--transition-speed) ease;
}
.footer-disclaimer {
  margin-top: 8px;
  font-size: 0.8rem;
}

/* 2.4 Main Content Area */
.main-content {
  padding-top: 30px;
  padding-bottom: 30px;
}

/* 2.5 Filter Sidebar */
.filter-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-secondary);
  z-index: 1001;
  overflow-y: auto;
  transition: left var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
}
.filter-sidebar.open {
  left: 0;
  box-shadow: 2px 0 10px var(--shadow-color);
}
.sidebar-header {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  background-color: var(--bg-tertiary);
  z-index: 2;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
#filter-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-speed) ease;
}
#filter-close-btn:hover {
  color: var(--text-primary);
}
.category-list-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.category-list {
  list-style: none;
}
.category-item,
.subcategory-item {
  position: relative;
}
.category-summary {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
  transition: background-color var(--transition-speed) ease;
}
.category-summary:hover {
  background-color: var(--element-bg-hover);
}
.category-summary::-webkit-details-marker {
  display: none;
}
.category-checkbox {
  margin-right: 10px;
  accent-color: var(--accent-primary);
}
.category-label {
  flex-grow: 1;
  font-size: 0.95rem;
}
.toggle-icon {
  margin-left: auto;
  color: var(--text-secondary);
}
details > summary .fa-chevron-down {
  display: inline-block;
}
details > summary .fa-chevron-up {
  display: none;
}
details[open] > summary .fa-chevron-down {
  display: none;
}
details[open] > summary .fa-chevron-up {
  display: inline-block;
}
.subcategory-list {
  padding-left: 20px;
  list-style: none;
  background-color: rgba(0, 0, 0, 0.05);
}
body.light-mode .subcategory-list {
  /* Specific light mode for subcategory list */
  background-color: rgba(0, 0, 0, 0.02);
}
.subcategory-item .category-summary {
  padding: 8px 15px;
  font-size: 0.9rem;
}
.category-summary.no-subs {
  /* Combined from .category-summary and .category-summary.no-subs */
  padding: 10px 15px;
  display: flex; /* Already on .category-summary */
  align-items: center; /* Already on .category-summary */
}
.filter-actions {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-primary);
  background-color: var(--bg-tertiary);
  position: sticky;
  bottom: 0;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}

/* ==========================================================================
   2.A NEW LAYOUT - ADD THIS CODE
   ========================================================================== */

/* Define sidebar width variables for easy management */
:root {
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 88px; /* Width when it's just icons */
}

/* This wrapper contains the header and main content, to the right of the sidebar */
.main-wrapper {
  position: relative;
  margin-left: var(--sidebar-width); /* Creates space for the sidebar */
  transition: margin-left var(--transition-speed) ease;
}

/* The vertical sidebar itself */
aside#sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh; /* Full viewport height */
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  z-index: 1010; /* Highest z-index to stay on top */
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed) ease;
}

/* The main content area where your page's content resides */
main.main-content {
  /* This was a class before, now it's a tag. Let's make sure it has padding */
  padding: 1.5rem 2rem;
  width: 100%;
}

/* Overlay for mobile view */
#page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1005; /* Below sidebar, above content */
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease;
}

/* The mobile hamburger button in the header */
#mobile-menu-toggle {
  display: none; /* Hidden on desktop, will be shown on mobile */
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   MOBILE HAMBURGER & RESPONSIVE STYLES
   ========================================================================== */

#page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1005; /* Below sidebar, above content */
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease,
    visibility var(--transition-speed) ease;
}

@media (max-width: 992px) {
  /* 1. Hide the sidebar off-screen by default on mobile */
  aside#sidebar-nav {
    left: calc(-1 * var(--sidebar-width));
    transition: left var(--transition-speed) ease;
    position: fixed;
  }

  #mobile-menu-toggle {
    display: block;
    position: absolute;
    top: 0;
    height: 100%;
    width: 60px;

    /* These rules just center the three-bar icon inside the new button area. */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 2. Make the main content area take up the full width */
  .main-wrapper {
    margin-left: 0;
  }

  /* 4. Hide the desktop-only collapse button and its footer */
  .sidebar-footer {
    display: none;
  }

  /* 5. Adjust padding for smaller screens */
  .site-header,
  main.main-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* STYLES FOR WHEN THE MENU IS OPEN */

  /* When the menu is open, prevent the page from scrolling and fix height issues */
  body.mobile-sidebar-open,
  body.mobile-sidebar-open html {
    overflow: hidden !important;
    height: 100% !important;
  }

  /* When the body has this class, slide the sidebar in */
  body.mobile-sidebar-open aside#sidebar-nav {
    left: 0;
    box-shadow: 5px 0 15px var(--shadow-strong-color);
  }

  /* And show the dark overlay */
  body.mobile-sidebar-open #page-overlay {
    opacity: 1;
    visibility: visible;
  }
}

/* ==========================================================================
   2.C SIDEBAR STYLING - ADD THIS CODE
   ========================================================================== */

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  height: 65px; /* Match header height for alignment */
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0; /* Prevents header from shrinking */
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  overflow: hidden; /* Important for collapse animation */
}

.sidebar-logo img {
  height: 40px;
  width: auto;
  flex-shrink: 0; /* Prevents logo from shrinking */
}

.sidebar-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap; /* Prevents text from wrapping */
}

#sidebar-toggle {
  background: var(--element-bg-hover);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

#sidebar-toggle:hover {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.sidebar-menu {
  flex-grow: 1; /* Allows menu to fill remaining space */
  overflow-y: auto; /* Adds scrollbar if content overflows */
  overflow-x: hidden; /* Prevents horizontal scrollbar */
  padding-top: 1rem;
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-segment {
  padding: 0.5rem 0;
}

.menu-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.5rem;
  margin-top: 0.5rem;
}

.menu-separator {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: 0.5rem 1.5rem;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  border-left: 3px solid transparent;
  transition: all var(--transition-speed) ease;
}

.sidebar-menu li a i {
  font-size: 1.1rem;
  width: 20px; /* Ensures icons are aligned */
  text-align: center;
  color: var(--text-secondary);
  transition: color var(--transition-speed) ease;
}

.sidebar-menu li a:hover {
  background-color: var(--element-bg-hover);
  color: var(--text-primary);
  border-left-color: var(--accent-glow);
}

.sidebar-menu li a.active {
  background-color: var(--element-bg-hover);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-menu li a.active i {
  color: var(--accent-primary);
}

/* Cleanup old main-nav styles */
.main-nav,
.main-nav ul#nav-menu,
#mobile-menu-toggle span {
  display: none !important;
}

/* ==========================================================================
   2.D SIDEBAR COLLAPSED STATE - ADD THIS CODE
   ========================================================================== */

/* When the sidebar is collapsed... */
body.sidebar-collapsed aside#sidebar-nav {
  width: var(--sidebar-width-collapsed); /* Use the collapsed width variable */
}

/* ...move the main content to the left to fill the space. */
body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-width-collapsed);
}

/* ...hide the logo text. */
body.sidebar-collapsed .sidebar-logo .logo-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

/* ...hide the navigation link text. */
body.sidebar-collapsed .sidebar-menu li a span {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

/* ...and hide the menu headings and separators. */
body.sidebar-collapsed .menu-heading,
body.sidebar-collapsed .menu-separator {
  display: none;
}

/* ...center the icon in the available space. */
body.sidebar-collapsed .sidebar-menu li a {
  justify-content: center;
  padding: 0.8rem 0;
}

/* ...flip the toggle arrow. */
body.sidebar-collapsed #sidebar-toggle i {
  transform: rotate(180deg);
}

/* ==========================================================================
   SIDEBAR FOOTER STYLING (FOR COLLAPSE BUTTON)
   ========================================================================== */

.sidebar-footer {
  margin-top: auto; /* This is the key: pushes the footer to the bottom */
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-primary);
  flex-shrink: 0; /* Prevents it from shrinking */
  display: flex;
  justify-content: flex-end; /* Aligns button to the right */
}

/* Adjust button style slightly for the new location */
#sidebar-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-primary);
}

/* When collapsed, center the button */
body.sidebar-collapsed .sidebar-footer {
  justify-content: center;
}

/* On mobile, we hide the desktop toggle and its footer */
@media (max-width: 992px) {
  .sidebar-footer {
    display: none;
  }
}
/* ==========================================================================
   3. UI ELEMENTS & WIDGETS
   ========================================================================== */

/* 3.1 Buttons */
.header-actions .login-btn {
  /* From older header structure */
  background-color: var(--accent-primary);
  color: white;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color var(--transition-speed) ease;
}
.header-actions .login-btn:hover {
  background-color: var(--accent-primary-hover);
  color: white;
}

.mobile-action-buttons .action-btn {
  display: inline-block;
  padding: 14px 24px;
  margin: 0 10px 10px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease; /* Consider var(--transition-speed) */
  box-shadow: 0 4px 6px var(--shadow-color);
  min-width: 180px;
}
.mobile-action-buttons .money-btn {
  background: linear-gradient(to right, #4d7cfe, #2857c7);
  color: white;
  border: none;
}
.mobile-action-buttons .jobs-btn {
  background: linear-gradient(to right, #8957ff, #5c31b5);
  color: white;
  border: none;
}
.mobile-action-buttons .action-btn i {
  margin-right: 8px;
}

.filter-button {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.filter-button:hover {
  background-color: var(--element-bg-hover);
  border-color: var(--border-secondary);
  color: var(--text-heading);
}

.clear-filter-button,
.apply-filter-button {
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.clear-filter-button {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}
.clear-filter-button:hover {
  background-color: var(--element-bg-hover);
  color: var(--text-primary);
  border-color: var(--border-secondary);
}
.apply-filter-button {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  flex-grow: 1;
  margin-left: 10px;
}
.apply-filter-button:hover {
  background-color: var(--accent-primary-hover);
}

.visit-button {
  /* From AI Tool Card */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent-primary);
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color var(--transition-speed) ease;
  text-decoration: none;
}
.visit-button:hover {
  background-color: var(--accent-primary-hover);
  color: white;
}

.info-box .visit-button {
  /* From Tool Detail, more specific */
  /* display: flex; align-items: center; justify-content: center; gap: 8px; -- Inherited */
  width: 100%;
  padding: 12px; /* Overrides general .visit-button */
  /* background-color: var(--accent-primary); color: white; -- Inherited */
  text-align: center; /* From original */
  /* text-decoration: none; border-radius: 6px; font-weight: 600; -- Inherited & minor diffs */
  border-radius: 6px; /* Overrides general */
  font-weight: 600; /* Overrides general */
  /* transition: background-color var(--transition-speed) ease; -- Inherited */
  margin-top: 15px; /* Specific to info-box */
}
.info-box .visit-button:hover {
  /* Inherits hover from general .visit-button */
  /* background-color: var(--accent-primary-hover); color: white; */
}

.upload-form button[type="submit"] {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  margin-top: 30px;
  transition: all var(--transition-speed) ease; /* 'all' is broad, consider specific properties */
}
.upload-form button[type="submit"]:hover {
  background-color: var(--accent-primary-hover);
  opacity: 0.95;
  box-shadow: 0 4px 10px var(--shadow-strong-color);
}

.ai-btn {
  /* From AI Fetch Container */
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
  transition: background-color var(--transition-speed) ease;
}
.ai-btn:hover {
  background-color: var(--accent-primary-hover);
}

.clear-search-btn {
  /* From Empty Results */
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}
.clear-search-btn:hover {
  background: var(--accent-primary-hover);
}

/* 3.2 Forms */
.upload-form {
  /* General form container style */
  max-width: 750px;
  margin: 30px auto;
  padding: 30px 40px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  box-shadow: 0 4px 15px var(--shadow-color);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.upload-form h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-heading);
  font-weight: 600;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 15px;
  transition: border-color var(--transition-speed) ease;
}
.upload-form .form-group {
  margin-bottom: 20px;
}
.upload-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95em;
}
.upload-form input[type="text"],
.upload-form input[type="url"],
.upload-form input[type="number"],
.upload-form input[type="date"],
.upload-form textarea,
.upload-form select,
.url-input {
  /* Added .url-input from AI Fetch */
  width: 100%;
  padding: 12px 15px; /* .url-input had 10px 12px, standardizing */
  border: 1px solid var(--border-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 5px; /* .url-input had 3px, standardizing */
  box-sizing: border-box;
  font-size: 1em;
  transition: border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}
body.light-mode .upload-form input[type="text"],
body.light-mode .upload-form input[type="url"],
body.light-mode .upload-form input[type="number"],
body.light-mode .upload-form input[type="date"],
body.light-mode .upload-form textarea,
body.light-mode .upload-form select,
body.light-mode .url-input {
  background-color: var(--bg-secondary);
}
.upload-form input::placeholder,
.upload-form textarea::placeholder {
  color: var(--text-disabled);
}
.upload-form input:focus,
.upload-form textarea:focus,
.upload-form select:focus,
.url-input:focus {
  /* Added .url-input from AI Fetch */
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-transparent); /* .url-input had 2px, standardizing */
}
.upload-form textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}
.upload-form input[type="file"] {
  padding: 8px 10px;
  background-color: var(--element-bg-hover);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 5px;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.upload-form input[type="file"]::file-selector-button {
  padding: 8px 15px;
  margin-right: 10px;
  background-color: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}
.upload-form input[type="file"]::file-selector-button:hover {
  background-color: var(--element-bg-hover);
}
.upload-form .form-group small {
  display: block;
  margin-top: 8px;
  font-size: 0.85em;
  color: var(--text-disabled);
}
.upload-form .checkbox-group {
  background-color: var(--bg-primary);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--border-primary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
body.light-mode .upload-form .checkbox-group {
  background-color: var(--bg-secondary);
}
.upload-form .checkbox-group label {
  display: inline-flex;
  align-items: center;
  margin-right: 25px;
  font-weight: normal;
  color: var(--text-secondary);
  cursor: pointer;
}
.upload-form input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  vertical-align: middle;
}
.form-group.horizontal-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.form-group.horizontal-group > div {
  flex: 1;
  min-width: 200px;
}

/* Styles for the new AI image preview */
.image-upload-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 5px;
}
.image-preview-container {
  position: relative;
  border: 1px solid #555;
  padding: 5px;
  background-color: #333;
  border-radius: 4px;
  width: 200px;
  flex-shrink: 0;
}
.image-preview-container img {
  max-width: 50%;
  height: auto;
  display: block;
  border-radius: 3px;
}
.image-preview-container .remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #e44d26;
  color: white;
  border: 2px solid #222;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.image-preview-container small {
  display: block;
  text-align: center;
  margin-top: 5px;
  font-size: 12px;
  color: #ccc;
}
#manual_image_uploader {
  flex-grow: 1;
}

/* 3.3 Cards (AI Tool Card - General Structure) */
.ai-tool-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease, opacity 0.5s ease;
  opacity: 0;
  transform: translateY(15px);
}
.ai-tool-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.ai-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px var(--shadow-color);
  border-color: var(--border-secondary);
}
.ai-tool-card .thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-primary);
  transition: border-color var(--transition-speed) ease;
}
.tool-info {
  /* General .tool-info, used in main grid and related cards */
  padding: 15px;
  /* From related cards .tool-info */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  color: var(--text-secondary);
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.tool-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}
.tool-title a {
  /* Link within the title */
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 600;
  /* text-decoration: none; -- From related cards, general 'a' already has this */
}
.tool-title a:hover {
  color: var(--accent-primary);
}
.external-link-icon {
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: color 0.2s; /* Use var(--transition-speed) */
}
/* .tool-title a:hover .external-link-icon - This specific hover was present */
/* No, it was `.tool-title .external-link-icon` and then general link hover. */
/* Let's assume the icon changes color when the main link title is hovered */
.tool-title a:hover + .external-link-icon, /* If icon is sibling */
.tool-title a:hover > .external-link-icon, /* If icon is child of link */
.tool-title:hover .external-link-icon {
  /* If icon is just sibling and want hover on whole title area */
  color: var(--accent-primary);
}
/* Original .tool-description, now .tool-subtitle is more common in your code */
.tool-description,
.tool-subtitle {
  /* Combining .tool-description and .tool-subtitle */
  color: var(--text-secondary);
  margin-bottom: 15px; /* .tool-subtitle had 0 0 20px 0 or 0 0 10px 0, standardizing */
  font-size: 0.95rem; /* .tool-subtitle was 1.1rem or 0.95rem, standardizing to smaller */
  line-height: 1.5;
  overflow-wrap: break-word; /* From .tool-subtitle */
  word-wrap: break-word; /* From .tool-subtitle */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2em;
  max-height: 2.4em;
}
.tool-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  /* From related cards */
  align-items: center;
  margin-top: auto; /* Push to bottom in flex container (related cards) */
  padding-top: 10px; /* From related cards */
  border-top: 1px solid var(--border-secondary); /* From related cards */
  color: var(--text-secondary); /* From related cards */
}

.pricing-tag,
.upvotes {
  /* General meta items */
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  gap: 4px; /* From related cards */
}

.category {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  padding: 3px 6px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.category i,
.pricing-tag i,
.upvotes i {
  margin-right: 5px; /* Overridden by gap on parent, can be removed if gap is universal */
  color: var(--text-secondary);
}
.upvotes i {
  color: var(--color-info);
}
.pricing-tag {
  /* General pricing tag styling */
  display: inline-block; /* from info-box */
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: white; /* Default text color for tags */
  white-space: nowrap; /* From info-box */
}
/* Semantic Pricing Colors */
.pricing-tag.pricing-free,
.pricing-free {
  background-color: var(--color-success);
} /* Combined .pricing-free (main) and .pricing-tag.pricing-free (detail) */
.pricing-tag.pricing-freemium,
.pricing-freemium {
  background-color: var(--color-info);
}
.pricing-tag.pricing-paid,
.pricing-paid {
  background-color: var(--color-warning);
}
.pricing-tag.pricing-open-source,
.pricing-open-source {
  background-color: var(--color-open-source);
  color: #eee;
} /* color: #eee from detail */
.pricing-tag.pricing-contact,
.pricing-contact {
  background-color: var(--color-contact);
}

.tool-tags {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 5px;
}
.tool-tags .fas {
  color: var(--text-secondary);
  /* margin-right: 5px; -- Replaced by gap */
}
.tags-container {
  /* Was part of .tool-tags effectively */
  display: inline-flex; /* from .tool-tags */
  flex-wrap: wrap; /* from .tool-tags */
  gap: 5px; /* from .tool-tags */
}
.tag {
  display: inline-block;
  background-color: var(--element-bg-hover);
  color: var(--text-secondary);
  border-radius: 15px;
  padding: 3px 10px;
  font-size: 0.8em;
  border: 1px solid var(--border-secondary);
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.tag:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

/* 3.4 Search Bar */
.search-container {
  margin: 30px auto;
  position: relative;
  max-width: 800px;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all var(--transition-speed) ease;
}
.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 6px 16px var(--shadow-strong-color),
    0 0 0 3px var(--accent-primary-transparent);
}
#search-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 16px;
  border: none;
  background-color: transparent;
  color: var(--text-primary);
  border-top-left-radius: 50px;
  border-bottom-left-radius: 50px;
  outline: none;
  transition: color var(--transition-speed) ease;
}
#search-input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}
.search-btn {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 0 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-top-right-radius: 50px;
  border-bottom-right-radius: 50px;
  transition: background-color var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-btn:hover {
  background-color: var(--accent-primary-hover);
}
.search-icon {
  margin-right: 6px;
  color: inherit;
}

/* 3.5 Pagination */
.pagination-container {
  margin-top: 40px;
  margin-bottom: 30px;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-link,
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.pagination-link:hover,
.pagination-btn:hover {
  background-color: var(--element-bg-hover);
  border-color: var(--border-secondary);
  color: var(--text-heading);
}
.pagination-link.current {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}
.pagination-link.current:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: white;
}
.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bg-secondary);
  color: var(--text-disabled);
  border-color: var(--border-primary);
}
.pagination-btn.disabled:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-primary);
}
.pagination-btn i {
  margin: 0 5px;
}
.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: var(--text-secondary);
}
.pagination-info {
  text-align: center;
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.pagination-info span {
  color: var(--text-primary);
  font-weight: 500;
}

/* 3.6 Loading Indicators & Messages */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  width: 100%;
  color: var(--text-secondary);
  font-size: 16px;
  grid-column: 1 / -1;
}
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border: 3px solid var(--spinner-base);
  border-radius: 50%;
  border-top-color: var(--spinner-top);
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  color: var(--text-secondary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.empty-icon {
  font-size: 48px;
  color: var(--text-disabled);
  margin-bottom: 15px;
}
.empty-results h3 {
  margin-bottom: 10px;
  color: var(--text-heading);
}
.empty-results p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.error-message {
  /* General error message for grids */
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-danger);
  padding: 20px;
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  border-radius: 8px;
  margin: 20px 0;
}
.message {
  /* More generic message styling, e.g., for forms */
  padding: 15px 20px;
  margin-bottom: 25px; /* From upload form */
  border-radius: 5px;
  font-weight: 500;
  border: 1px solid transparent;
  line-height: 1.5;
}
.container .message {
  /* Specific for message inside .container (e.g. tool not found) */
  /* padding: 15px 20px; margin: 20px auto; -- Slightly different from above, prioritizing general */
  margin: 20px auto;
  max-width: 600px;
  text-align: center;
}
.message.message-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success);
}
.message.message-error,
.container .message.message-error {
  /* Combined */
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.ai-status {
  /* From AI Fetch Container */
  margin-top: 10px;
  min-height: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}
.ai-status.loading {
  color: var(--color-warning);
} /* Renamed from .loading */
.ai-status.success {
  color: var(--color-success);
}
.ai-status.error {
  color: var(--color-danger);
}

/* 3.7 Theme Toggle Button */
.theme-toggle-button {
  padding: 8px 14px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 50px;
  cursor: pointer;
  z-index: 1000; /* Can be lower if header is 1000 */
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.theme-toggle-button:hover {
  background-color: var(--element-bg-hover);
  color: var(--text-heading);
  border-color: var(--border-secondary);
}
.theme-toggle-button .fa-sun {
  display: none;
}
.theme-toggle-button .fa-moon {
  display: inline-block;
}
body.light-mode .theme-toggle-button .fa-sun {
  display: inline-block;
}
body.light-mode .theme-toggle-button .fa-moon {
  display: none;
}

/* 3.8 Sort Dropdown */
.filter-controls {
  /* Parent container for filter button and sort dropdown */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-dropdown label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}
.sort-dropdown label i {
  color: var(--accent-primary);
  font-size: 0.9em;
  margin-right: 4px;
}
.sort-dropdown select {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23cccccc%27%3E%3Cpath fill-rule=%27evenodd%27 d=%27M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px 16px;
  padding-right: 30px;
}
body.light-mode .sort-dropdown select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23555555%27%3E%3Cpath fill-rule=%27evenodd%27 d=%27M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z%27/%3E%3C/svg%3E");
}
.sort-dropdown select:hover {
  border-color: var(--border-secondary);
  background-color: var(--element-bg-hover);
}
.sort-dropdown select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-transparent);
}

/* 3.9 Tabs (Navigation & Content for Tool Detail) */
.tool-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: border-color var(--transition-speed) ease;
}
.tool-tabs-nav::-webkit-scrollbar {
  display: none;
}
.tab-link {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-speed) ease; /* 'all' is broad */
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-secondary);
}
.tab-link.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}
.tool-tab-content {
  display: none;
  line-height: 1.7;
  color: var(--text-primary);
  padding: 10px 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.tool-tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tool-tab-content h3 {
  font-size: 1.3rem;
  color: var(--text-heading);
  margin-top: 20px;
  margin-bottom: 15px;
}
.tool-tab-content h3:first-child {
  margin-top: 0;
}
.tool-tab-content p {
  margin-bottom: 15px;
  color: var(--text-primary);
}
.tool-tab-content a {
  color: var(--accent-primary);
  text-decoration: none;
}
.tool-tab-content a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}
.tool-tab-content img,
.tool-tab-content iframe {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  display: block;
  margin: 10px 0;
}
.tool-tab-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  display: block;
  padding: 10px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text-secondary);
}
.tool-tab-content code {
  word-wrap: break-word;
}
.tool-tab-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  overflow-x: auto;
  display: block;
}
.tool-tab-content th,
.tool-tab-content td {
  padding: 8px 12px;
  border: 1px solid var(--border-secondary);
  text-align: left;
  color: var(--text-primary);
}
.tool-tab-content th {
  background-color: var(--element-bg-hover);
  color: var(--text-heading);
}

/* 3.10 Breadcrumbs */
.breadcrumbs-container {
  background-color: var(--bg-secondary);
  padding: 8px 0;
  margin: 15px 0 25px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.breadcrumbs ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0 15px;
  margin: 0;
  font-size: 0.9rem;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin: 0 8px;
  color: var(--text-disabled);
}
.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}
.breadcrumbs a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}
.breadcrumbs li:last-child {
  font-weight: 500;
  color: var(--text-primary);
}

/* 3.11 Social Share Buttons */
.social-share {
  /* Container for share buttons on tool detail */
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 20px;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.social-share h3 {
  font-size: 1.1rem;
  margin: 0 0 15px 0;
  text-align: center;
  color: var(--text-heading);
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.share-buttons a {
  flex-grow: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  color: white !important; /* Ensure text is white on colored buttons */
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: opacity var(--transition-speed) ease;
}
.share-buttons a:hover {
  opacity: 0.9;
}
.share-buttons .twitter-share {
  background-color: #1da1f2;
}
.share-buttons .facebook-share {
  background-color: #4267b2;
}
.share-buttons .linkedin-share {
  background-color: #0077b5;
}

/* ==========================================================================
   4. PAGE-SPECIFIC SECTIONS & COMPONENTS
   ========================================================================== */

/* 4.1 Intro Text & Quick Navigation Pills */
.intro-text {
  margin-bottom: 30px; /* Spacing before quick pills or search */
  text-align: center;
}
/* Styling for the dynamic text in the main heading */
#dynamic-h1-text {
  color: #ff8c00; /* This is the orange accent color from your tagline */
  transition: opacity 0.3s ease-in-out; /* For a smooth fade effect */
  opacity: 1;
}

#dynamic-h1-text.fade-out {
  opacity: 0;
}
.intro-text h1 {
  /* Main page headline */
  font-size: 2.4rem;
  margin-bottom: 15px;
  color: var(--text-heading);
}
.intro-text p {
  /* Main page intro paragraph */
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 25px auto; /* Added bottom margin before pills */
  color: var(--text-secondary);
}
.site-tagline {
  display: block;
  font-size: 1em;
  color: var(--accent-primary); /* Consistent with other accents */
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.quick-nav-pills {
  /* margin-top: 25px; -- Handled by intro-text p margin-bottom */
  margin-bottom: 30px; /* Space after pills before search */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.quick-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 25px;
  background-color: var(--element-bg-hover); /* Using a theme variable */
  color: var(--text-primary); /* Using a theme variable */
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease, transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  box-shadow: 0 2px 4px var(--shadow-color);
}
.quick-pill i {
  margin-right: 8px;
  font-size: 1.1em;
}
.quick-pill:hover {
  background-color: var(--accent-primary-hover);
  color: white; /* Specific for accent hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-strong-color);
}
.quick-pill.active-pill {
  background-color: var(--accent-primary);
  color: white; /* Specific for accent active */
  box-shadow: 0 2px 5px var(--accent-glow);
}

/* 4.2 Platform Features (Was Value Proposition) */
.platform-features {
  margin-bottom: 50px;
  background-color: var(--bg-secondary);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
  text-align: center;
}
.platform-features h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: var(--text-heading);
}
.features-grid {
  /* General grid for features */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
}
.platform-features .feature {
  /* Styling for non-linked feature items if they still exist */
  text-align: center;
  padding: 20px;
  border-radius: 6px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  transition: transform var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.platform-features .feature:hover {
  transform: translateY(-5px);
  background-color: var(--element-bg-hover);
}
.platform-features .feature i {
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: 15px;
}
.platform-features .feature h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  color: var(--text-heading);
}
.platform-features .feature p {
  color: var(--text-secondary);
}
/* Styles for new clickable feature cards */
.platform-features .feature-link-wrapper {
  /* Assumes this is nested inside a .feature or replaces it */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 20px;
  border-radius: 8px; /* Consistent with .platform-features container */
  transition: transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease,
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
  height: 100%;
  box-sizing: border-box;
  background-color: var(--bg-secondary); /* Explicit background */
  border: 1px solid var(--border-secondary); /* Explicit border */
}
.platform-features .feature-link-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px var(--shadow-color);
  background-color: var(--element-bg-hover);
  border-color: var(--border-primary); /* Slightly darker border on hover */
}
.platform-features .feature-link-wrapper i {
  font-size: 2em; /* Was 2rem in .feature i */
  margin-bottom: 15px;
  color: var(--accent-primary); /* Consistent icon color */
}
.platform-features .feature-link-wrapper h3 {
  margin-bottom: 10px;
  font-size: 1.3rem;
  color: var(--text-heading);
}
.platform-features .feature-link-wrapper p {
  font-size: 0.9em;
  flex-grow: 1;
  color: var(--text-secondary);
}
.platform-features .cta-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
  font-weight: bold;
  color: var(--accent-primary);
}
.platform-features .cta-link i.fas {
  /* For fa-arrow-right, fa-arrow-down */
  font-size: 0.85em;
  line-height: 1;
}

/* 4.3 AI Tool Grid & Card Details */
.ai-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
  transition: opacity 0.3s ease; /* Use var(--transition-speed) */
}
/* .ai-tool-card styles already defined in UI Elements */

/* 4.4 FAQ Section */
.faq-section {
  margin-top: 50px;
  margin-bottom: 30px;
}
.faq-section h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.8rem;
  color: var(--text-heading);
}
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}
details {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  margin-bottom: 15px;
  border-radius: 6px;
  overflow: hidden;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
details summary {
  padding: 15px;
  cursor: pointer;
  position: relative;
  font-weight: 500;
  list-style: none;
  color: var(--text-heading);
  transition: background-color var(--transition-speed) ease;
}
details summary:hover {
  background-color: var(--element-bg-hover);
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform var(--transition-speed) ease;
  color: var(--text-secondary);
}
details[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}
details p {
  padding: 15px;
  border-top: 1px solid var(--border-primary);
  color: var(--text-secondary);
  transition: border-color var(--transition-speed) ease;
}

/* 4.5 Tool Detail Page */
.tool-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 20px;
}
.tool-detail-sidebar {
  display: flex;
  flex: 1;
  min-width: 300px;
  flex-direction: column;
  gap: 20px;
  top: 80px; /* If header is sticky and fixed height */
  align-self: start;
}
.detail-thumbnail {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--border-primary);
  box-shadow: 0 4px 10px var(--shadow-color);
}
.info-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 20px;
  color: var(--text-primary);
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.info-box ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}
.info-box li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.info-box li i {
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
  color: var(--text-secondary);
}
.info-box li strong {
  color: var(--text-primary);
  font-weight: 500;
}
.info-box li:last-child {
  border-bottom: none;
}
.info-box p {
  /* Note below button */
  font-size: 0.8em;
  text-align: center;
  margin-top: 10px;
  color: var(--text-disabled);
}
.tool-detail-main {
  overflow-wrap: break-word;
  word-wrap: break-word;
  flex: 2;
  min-width: 350px;
}
.tool-detail-main h1 {
  font-size: 2.2rem;
  margin: 0 0 10px 0;
  color: var(--text-heading);
  line-height: 1.3;
}
/* .tool-subtitle already defined under Card details, ensure consistency */

.features-list {
  list-style: none;

  /* Login Page Styles */
  .login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
  }

  .login-box {
    background: var(--bg-secondary);
    padding: 40px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 25px var(--shadow-color);
    text-align: center;
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--accent-primary);
  }

  .login-box img {
    margin-bottom: 25px;
    max-width: 150px;
  }

  .login-box h1 {
    margin-bottom: 15px;
    font-size: 24px;
    color: var(--text-heading);
  }

  .login-box p {
    margin-bottom: 30px;
    font-size: 16px;
    color: var(--text-secondary);
  }

  .google-sign-in {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .google-sign-in:hover {
    background-color: #357ae8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .google-sign-in i {
    margin-right: 12px;
    font-size: 20px;
  }

  padding: 0;
  margin: 0;
}
.features-list li {
  padding: 10px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-secondary);
}
.features-list li:last-child {
  border-bottom: none;
}
.features-list i {
  color: var(--color-success);
  margin-top: 4px;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-secondary);
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  min-height: 250px;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.video-placeholder i {
  font-size: 3rem;
  color: var(--text-disabled);
  margin-bottom: 15px;
}
.alternatives-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.alternatives-list li {
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-secondary);
  color: var(--text-primary);
  transition: border-color var(--transition-speed) ease;
}
.alternatives-list li:last-child {
  border-bottom: none;
}
.alternatives-list i {
  color: var(--color-info);
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}
.alternative-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed) ease;
  word-break: break-all;
}
.alternative-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* 4.6 Related Tools Section */
.related-tools-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-primary);
  transition: border-color var(--transition-speed) ease;
}
.related-tools-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-heading);
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}
.related-tool-item .ai-tool-card {
  /* .ai-tool-card styles are base, these are overrides/additions */
  background-color: var(
    --bg-secondary
  ); /* Redundant if base .ai-tool-card uses this */
  box-shadow: 0 2px 5px var(--shadow-color); /* Different from base .ai-tool-card:hover */
  color: var(
    --text-primary
  ); /* Redundant if base .ai-tool-card children handle this */
  display: flex; /* Specific for related cards */
  flex-direction: column; /* Specific for related cards */
  width: 100%; /* Specific for related cards */
  height: 100%; /* Specific for related cards */
  text-decoration: none; /* Specific for related cards */
  opacity: 1; /* Override base .ai-tool-card opacity */
  transform: none; /* Override base .ai-tool-card transform */
  /* transition already on base .ai-tool-card */
}
.related-tool-item .ai-tool-card:hover {
  /* Specific hover for related cards */
  transform: translateY(-5px); /* Same as base .ai-tool-card:hover */
  box-shadow: 0 6px 12px var(--shadow-strong-color); /* Stronger shadow */
  /* border-color already handled by base .ai-tool-card:hover */
}
.related-tool-item .ai-tool-card .thumbnail {
  height: 160px; /* Shorter than main grid thumbnail */
  flex-shrink: 0; /* Ensure it doesn't shrink in flex layout */
}
/* .related-tool-item .ai-tool-card .tool-info already defined with flex properties */
.related-tool-item .ai-tool-card .tool-info h3 {
  /* Specific h3 for related card */
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.related-tool-item .ai-tool-card .tool-info h3 a {
  color: inherit;
  text-decoration: none;
}
.related-tool-item .ai-tool-card .tool-info .tool-subtitle {
  /* font-size, color, margin, line-height inherited from general .tool-subtitle */
  -webkit-line-clamp: 2; /* Text truncation */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-tool-item .ai-tool-card .tool-meta .pricing-tag {
  /* Specific pricing tag for related card */
  font-size: 0.8rem; /* Smaller than main grid */
  padding: 2px 6px; /* Smaller padding */
}
/* Semantic pricing colors for related cards already covered by general .pricing-tag.pricing-* */

/* 4.7 Upload Form Specifics (AI Fetch Container) */
.ai-fetch-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 5px;
  transition: background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}
.ai-fetch-container h2 {
  margin-top: 0;
  color: var(--accent-primary);
  font-size: 1.3em;
  margin-bottom: 15px;
}
.input-group {
  /* Used within AI Fetch */
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* .url-input styles merged with general form inputs */
/* .ai-btn styles merged with general button styles */
/* .ai-status styles merged with general message styles */

/* ==========================================================================
   5. RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 992px) {
  /* Medium screens, e.g., tablets */
  .tool-detail-container {
    /* grid-template-columns: 1fr; -- flex-wrap handles stacking */
    gap: 30px;
  }
  .tool-detail-sidebar {
    order: 0;
  }
  .tool-detail-main {
    order: 1;
  }
  .theme-toggle-button {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Smaller tablets and large phones */
  /* Layout */
  .platform-features {
    display: none !important;
  }
  .mobile-action-buttons {
    display: block;
  }
  .features-grid {
    grid-template-columns: 1fr;
  } /* From original .value-proposition responsive */
  .ai-tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }

  /* Header & Navigation */
  .header-container {
    position: relative;
    padding: 0 15px;
  }
  .theme-toggle-button {
    display: none;
  }
  #mobile-menu-toggle {
    display: block;
    position: relative;
    padding: 10px;
    top: 0;
    right: 0;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    z-index: 1000; /* Ensure it appears above other elements */
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: background-color var(--transition-speed) ease,
      color var(--transition-speed) ease;
    font-size: 1rem;
    display: flex;
  }
  .main-nav {
    order: 3;
    margin-left: auto;
  }
  .main-nav ul#nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: var(--bg-secondary);
    flex-direction: column;
    padding: 10px 0;
    gap: 0;
    box-shadow: 0 4px 8px var(--shadow-color);
    z-index: 100;
    border-top: 1px solid var(--border-secondary);
  }
  .main-nav ul#nav-menu.open {
    display: flex;
  }
  .main-nav ul#nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--border-secondary);
  }
  .main-nav ul#nav-menu li:last-child {
    border-bottom: none;
  }
  .main-nav ul#nav-menu li a {
    display: block;
    padding: 12px 20px;
    width: 100%;
  }

  /* Filter & Sort */
  .filter-sidebar {
    width: 280px;
    left: -280px;
  }
  .sort-dropdown {
    width: 100%;
    justify-content: space-between;
  }
  .sort-dropdown select {
    flex-grow: 1;
    max-width: none;
  }

  /* Typography & Content */
  .intro-text h1 {
    font-size: 2rem;
  }
  .quick-pill {
    font-size: 0.85em;
    padding: 6px 12px;
  }

  /* Search */
  .search-container {
    padding: 0 15px;
  }
  #search-input {
    padding: 12px 15px;
    font-size: 14px;
  }
  .search-btn {
    padding: 0 20px;
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  /* Small phones */
  /* Layout */
  .main-nav ul#nav-menu {
    /* Further adjustments if needed, or hide entire .main-nav if toggle also goes */
    /* display: none; -- If hiding the whole nav block, not just items */
  }
  .theme-toggle-button {
    display: none;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
  .site-footer {
    padding: 30px 0 15px;
  }

  /* Filter & Sort */
  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  /* Grids */
  .ai-tool-grid {
    grid-template-columns: 1fr;
  }

  /* Typography & Content */
  .intro-text h1 {
    font-size: 1.8rem;
  }
  .quick-pill {
    font-size: 0.8em;
    padding: 6px 12px;
  } /* Further shrink pills */
  .quick-nav-pills {
    gap: 8px;
  } /* Reduce gap for pills */

  /* Pagination */
  .pagination {
    gap: 5px;
  }
  .pagination-link,
  .pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   HEADER RIGHT ACTIONS STYLING - REPLACE OLD RULES
   ========================================================================== */

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

.header-icon-link {
  color: var(--text-primary);
  font-size: 1.4rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed) ease;
}

.header-icon-link:hover {
  color: var(--accent-primary);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Updated theme toggle style for icon-only look */
.theme-toggle-button {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  box-shadow: none;
  border: none;
  background-color: transparent;
}

/* ==========================================================================
   UPDATES to Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
  /* On mobile, hide the desktop-only login icon */
  .header-login-link {
    display: none !important;
  }

  /* On mobile, show the mobile-only login list item inside the nav menu */
  .mobile-only-nav-item {
    display: list-item !important;
  }

  /* Ensure the new right-actions group doesn't add extra space */
  .header-right-actions {
    gap: 0;
  }
}

/* ==========================================================================
   NEW STYLES: Quick Filter Pills
   ========================================================================== */

/* Base style for all pill containers */
.quick-filter-pills-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Hide mobile pills by default on desktop */
.quick-filter-pills-container.mobile-pills {
  display: none;
}

/* Media query for mobile screens */
@media (max-width: 768px) {
  /* Hide desktop pills on mobile */
  .quick-filter-pills-container.desktop-pills {
    display: none;
  }

  /* Show mobile pills on mobile */
  .quick-filter-pills-container.mobile-pills {
    display: flex;
  }
}

/* Hide scrollbar on Chrome, Safari, and Opera */
.quick-filter-pills-container::-webkit-scrollbar {
  display: none;
}

.quick-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Space between icon and text */
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  padding: 8px 16px;
  border-radius: 50px; /* This creates the pill shape */
  font-weight: 500;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap; /* Prevent text from wrapping inside the button */
  transition: all var(--transition-speed) ease;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.quick-filter-pill i {
  font-size: 0.9em;
  color: var(--text-primary); /* Make the icon slightly more prominent */
  transition: color var(--transition-speed) ease;
}

.quick-filter-pill:hover {
  background-color: var(--accent-primary);
  color: #fff; /* White text on hover */
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-strong-color);
}

.quick-filter-pill:hover i {
  color: #fff; /* White icon on hover */
}

/* ==========================================================================
   6. PROFILE PAGE STYLES
   ========================================================================== */

.profile-page .profile-header {
  text-align: center;
  margin-bottom: 40px;
}
.profile-page .profile-header h1 {
  font-size: 2.4rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}
.profile-page .profile-header .tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  align-items: flex-start;
}

/* Profile Card (Left Side) */
.profile-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  box-shadow: 0 4px 15px var(--shadow-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-card-header {
  padding: 25px;
  text-align: center;
  border-bottom: 1px solid var(--border-primary);
}

.profile-picture {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--accent-primary);
  margin: 0 auto 20px;
  object-fit: cover;
  box-shadow: 0 0 15px var(--accent-primary-transparent);
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 5px;
}

.profile-email {
  font-size: 0.95rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.profile-card-body {
  padding: 15px 0;
}

.profile-actions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-actions .action-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
}

.profile-actions .action-link i {
  color: var(--text-secondary);
  width: 20px;
  text-align: center;
  transition: color var(--transition-speed) ease;
}

.profile-actions .action-link:hover {
  background-color: var(--element-bg-hover);
  color: var(--accent-primary);
}

.profile-actions .action-link:hover i {
  color: var(--accent-primary);
}

.profile-actions .action-link.disabled-link {
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.7;
}

.profile-actions .action-link.disabled-link:hover {
  background-color: transparent;
  color: var(--text-disabled);
}
.profile-actions .action-link.disabled-link:hover i {
  color: var(--text-disabled);
}

.profile-card-footer {
  padding: 25px;
  border-top: 1px solid var(--border-primary);
  background-color: var(--bg-tertiary);
}

.sign-out-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--color-danger);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.sign-out-btn:hover {
  background-color: #d32f2f;
  box-shadow: 0 4px 10px rgba(244, 67, 54, 0.3);
}

/* Saved Tools Card (Right Side) */
.saved-tools-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  box-shadow: 0 4px 15px var(--shadow-color);
}

.saved-tools-card .card-header {
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-primary);
}

.saved-tools-card .card-header h3 {
  font-size: 1.3rem;
  color: var(--text-heading);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.saved-tools-card .card-header h3 i {
  color: var(--accent-primary);
}

.tool-count {
  background-color: var(--accent-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.saved-tools-list {
  padding: 10px;
  max-height: 450px; /* Adjust as needed */
  overflow-y: auto;
}

.no-tools-message {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
}

.saved-tool-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  transition: background-color var(--transition-speed) ease;
  color: var(--text-primary);
}

.saved-tool-item:hover {
  background-color: var(--element-bg-hover);
}

.saved-tool-item .tool-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.saved-tool-item .tool-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.saved-tool-item .tool-name {
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.saved-tool-item .tool-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.saved-tool-item .fa-chevron-right {
  color: var(--text-disabled);
  transition: transform var(--transition-speed) ease;
}

.saved-tool-item:hover .fa-chevron-right {
  transform: translateX(5px);
  color: var(--accent-primary);
}

.saved-tools-card .card-footer {
  padding: 20px 25px;
  border-top: 1px solid var(--border-primary);
  text-align: center;
}

.explore-more-btn {
  background-color: var(--accent-primary);
  color: white;
  padding: 10px 25px;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color var(--transition-speed) ease;
}

.explore-more-btn:hover {
  background-color: var(--accent-primary-hover);
  color: white;
}
.explore-more-btn i {
  margin-left: 5px;
  transition: transform 0.2s ease-out;
}
.explore-more-btn:hover i {
  transform: translateX(4px);
}

/* Responsive adjustments for Profile Page */
@media (max-width: 992px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .profile-page .profile-header h1 {
    font-size: 2rem;
  }
  .profile-card-header,
  .profile-card-footer,
  .saved-tools-card .card-header,
  .saved-tools-card .card-footer {
    padding: 20px;
  }
  .profile-picture {
    width: 100px;
    height: 100px;
  }
}

/* ==========================================================================
   FIX: Center Auth Icons in Header Navigation
   ========================================================================== */

/*
 * Target both login and profile icon containers.
 */
.auth-button-container {
  /* 1. Use flexbox to perfectly center the icon inside */
  display: flex;
  align-items: center;
  justify-content: center;

  /* 2. Apply the SAME padding as the other nav links (which is on their <a> tags). */
  /* This ensures the list item itself has the correct height and is aligned. */
  padding: 0.5rem 0.8rem;
}

/*
 * Target the icon itself for a slight size adjustment to balance it visually.
 */
.auth-button-container i {
  font-size: 1.1rem; /* A little larger since it stands alone without text. */
}

/*
 * The profile icon has a link inside it. We need to reset its padding
 * to prevent a "double padding" issue. The parent <li> now handles it.
 */
#profile-icon a {
  padding: 0;
}

/* ==========================================================================
   ADMIN-SPECIFIC STYLES
   ========================================================================== */

.admin-actions-box {
  background-color: rgba(255, 193, 7, 0.1); /* A subtle warning/admin color */
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px; /* Space between this box and the thumbnail */
}

body.light-mode .admin-actions-box {
  background-color: #fffbeb;
  border-color: #ffc107;
}

.admin-actions-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-actions-title i {
  color: #ffc107; /* Corresponds to the warning color */
}

.admin-edit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--transition-speed) ease;
}

.admin-edit-button:hover {
  background-color: var(--accent-primary-hover);
  color: white;
}

.admin-actions-note {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 15px;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* ==========================================================================
   n8n Automations
   ========================================================================== */
/* CSS is correct and unchanged */
.ai-tool-grid {
  min-height: 400px;
}

.n8n-automation-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 2px 5px var(--shadow-color);
  overflow: hidden;
}

.n8n-automation-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 16px var(--shadow-strong-color);
}

.n8n-card-header {
  padding: 20px 20px 15px 20px;
  border-bottom: 1px solid var(--border-secondary);
}

.n8n-card-header h3 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-heading);
  display: flex;
  align-items: center;
}

.n8n-card-header h3 .fa-cogs {
  color: var(--accent-primary);
  margin-right: 12px;
  font-size: 1.1rem;
}

.n8n-card-content {
  padding: 15px 20px;
  flex-grow: 1;
}

.n8n-card-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.n8n-card-actions {
  padding: 20px;
  background-color: var(--bg-tertiary);
  text-align: right;
}

.download-btn {
  display: inline-block;
  background-color: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: all var(--transition-speed) ease;
  box-shadow: none;
}

.download-btn:hover {
  background-color: var(--accent-primary-transparent);
  color: var(--text-heading);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 0 15px 3px var(--accent-glow);
}

.download-btn i {
  margin-right: 8px;
}

