/* ==========================================================================
   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: #e44d26;
  --accent-primary-hover: #f55a35;
  --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;

  /* Newly Added/Derived Variables for Dark Mode */
  --color-info-hover: #5dade2;
  --text-muted: #999999;
  --bg-element-raised: #333333;
  --color-brand-wordpress: #21759b; /* Specific brand color */
  --color-download: #e67e22; /* Specific orange for feature icon */
  --button-bg: #3a3a3a;
  --button-bg-hover: #4a4a4a;
  --bg-sidebar: #252525;
  --icon-color-muted: #888888;
  --element-subtle-hover-bg: rgba(255, 255, 255, 0.05);
  --button-secondary-text: #aaaaaa;
  --border-hover: #777777;
  --color-success-hover: #5cb85c; /* Lighter green for success hover states */
  --breadcrumb-separator: #6c757d;
  --bg-element-raised-hover: #444444;
  --border-stronger: #666666;
  --text-very-disabled: #666666;
  --pagination-ellipsis-color: #777777;
  --select-arrow-icon-dark: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cccccc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  --select-arrow-icon: var(--select-arrow-icon-dark);
  --color-success-border: rgba(76, 175, 80, 0.4);
  --color-danger-border: rgba(244, 67, 54, 0.3);
  --color-info-bg: rgba(33, 150, 243, 0.15);
  --color-info-border: rgba(33, 150, 243, 0.3);
  --accent-primary-hover-darker: #f44a20; /* For search button gradient */
  --color-info-shadow: rgba(33, 150, 243, 0.2);
  --color-download-bg: rgba(230, 126, 34, 0.15);
  --color-download-border: rgba(230, 126, 34, 0.4);
  --color-neutral-bg: rgba(127, 140, 141, 0.15);
  --color-neutral-text: #7f8c8d;
  --color-neutral-border: rgba(127, 140, 141, 0.3);
}

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;

  /* Newly Added/Derived Variables for Light Mode */
  --color-info-hover: #1e88e5; /* Darker blue for hover on light bg */
  --text-muted: #777777;
  --bg-element-raised: #eeeeee;
  --color-brand-wordpress: #21759b;
  --color-download: #d35400;
  --button-bg: #e0e0e0;
  --button-bg-hover: #d0d0d0;
  --bg-sidebar: #f8f9fa; /* Slightly off-white */
  --icon-color-muted: #777777;
  --element-subtle-hover-bg: rgba(0, 0, 0, 0.03);
  --button-secondary-text: #666666;
  --border-hover: #bbbbbb;
  --color-success-hover: #388e3c; /* Darker green for success hover states */
  --breadcrumb-separator: #868e96;
  --bg-element-raised-hover: #dadada;
  --border-stronger: #bbbbbb;
  --text-very-disabled: #999999;
  --pagination-ellipsis-color: #999999;
  --select-arrow-icon-light: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23555555%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  --select-arrow-icon: var(--select-arrow-icon-light);
  --color-success-border: rgba(76, 175, 80, 0.3);
  --color-danger-border: rgba(
    211,
    47,
    47,
    0.3
  ); /* Using light mode --color-danger */
  --color-info-bg: rgba(33, 150, 243, 0.1);
  --color-info-border: rgba(33, 150, 243, 0.25);
  /* --accent-primary-hover-darker: #f44a20; Inherits from dark or define if needed */
  --color-info-shadow: rgba(33, 150, 243, 0.15);
  --color-download-bg: rgba(
    211,
    84,
    0,
    0.15
  ); /* Using light --color-download */
  --color-download-border: rgba(211, 84, 0, 0.4);
  --color-neutral-bg: rgba(149, 165, 166, 0.15);
  --color-neutral-text: #6c757d;
  --color-neutral-border: rgba(149, 165, 166, 0.3);
}

/* ================================== */
/*          Global Styles             */
/* ================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

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

.main-content {
  padding-top: 20px;
  padding-bottom: 40px;
}

a {
  color: var(--color-info);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-info-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-heading);
  margin-top: 0;
  margin-bottom: 0.75em;
  line-height: 1.3;
  font-weight: 600;
}
h1 {
  font-size: 2.4em;
}
h2 {
  font-size: 1.8em;
}
h3 {
  font-size: 1.4em;
}
h4 {
  font-size: 1.2em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: 25px 0;
}

/* ================================== */
/*            Header Styles           */
/* ================================== */
/* Header styling */
.site-header {
  background-color: var(--bg-sidebar);
  padding: 6px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px var(--shadow-color);
  border-bottom: 1px solid var(--border-secondary);
}

.header-container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  display: block;
  padding: 2px 0;
}

.site-logo img {
  height: 50px;
  width: auto;
  display: block;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 15px;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding: 0;
  margin: 0;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-speed) ease; /* Only transition color here */
  padding: 6px 8px; /* This padding influences where bottom: -2px will visually appear */
  border-radius: 4px;
  position: relative; /* Needed for the ::after pseudo-element */
  display: inline-block; /* Ensures proper layout for ::after */
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text-heading); /* Change text color on hover/active */
}

/* Underline animation for nav links */
.main-nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px; /* Positioned slightly below the link text, adjust if padding changes significantly */
  left: 0; /* Starts from the left edge of the link */
  background-color: var(--accent-primary);
  transition: width var(--transition-speed) ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%; /* Expands to the full width of the link */
}

/* Mobile menu button */
#mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
  z-index: 2;
  margin-left: 10px;
}

#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: 0.25s ease-in-out;
}

#mobile-menu-toggle span:nth-child(1) {
  top: 0px;
}

#mobile-menu-toggle span:nth-child(2) {
  top: 10px;
}

#mobile-menu-toggle span:nth-child(3) {
  top: 20px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }

  #mobile-menu-toggle {
    display: block;
  }

  .main-nav {
    order: 3;
    margin-left: auto;
  }

  .main-nav ul {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--bg-sidebar);
    flex-direction: column;
    padding: 10px 0;
    gap: 0;
    box-shadow: 0 5px 5px var(--shadow-strong-color);
    z-index: 1;
    border-top: 1px solid var(--border-secondary);
  }

  .main-nav ul.open {
    display: flex;
  }

  .main-nav li {
    width: 100%;
    border-bottom: 1px solid var(--border-secondary);
  }

  .main-nav li:last-child {
    border-bottom: none;
  }

  .main-nav a {
    display: block;
    padding: 12px 20px;
    width: 100%;
  }
}

/* Mobile menu open animation */
#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);
}

/* 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;
  gap: 6px;
  margin-right: 15px; /* Consistent with header item spacing, was 20px */
  /* margin-left: 20px; -- Not needed if it's the first item in its group or flex handles spacing */
}
.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;
}

/* ================================== */
/*         Intro / Info Sections      */
/* ================================== */
.intro-text {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.intro-text h1 {
  margin-bottom: 15px;
  font-size: 2.2em;
}

.intro-text p {
  font-size: 1.1em;
  color: var(--text-secondary); /* #bbb is close to text-secondary */
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.intro-text p em {
  font-style: normal;
  color: var(--text-muted); /* #999 */
}

/* Value Proposition Section */
.value-proposition {
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  padding: 40px 30px;
  margin: 30px 0 40px 0;
  box-shadow: 0 3px 10px var(--shadow-color);
}

.value-proposition h2 {
  text-align: center;
  color: var(--text-heading);
  font-size: 28px;
  margin-bottom: 30px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature {
  text-align: center;
  padding: 25px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: var(--bg-element-raised); /* #333333 */
  box-shadow: 0 4px 6px var(--shadow-color);
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px var(--shadow-strong-color);
}

.feature i {
  font-size: 36px;
  color: var(--color-info); /* Default icon color */
  margin-bottom: 15px;
  display: block;
}
.feature i.fab.fa-wordpress {
  color: var(--color-brand-wordpress);
}
.feature i.fas.fa-check-circle {
  color: var(--color-success);
}
.feature i.fas.fa-cloud-download-alt {
  color: var(--color-download); /* Using specific orange */
}

.feature h3 {
  font-size: 20px;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.feature p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

/* ================================== */
/*       Filter Controls/Sidebar      */
/* ================================== */
.filter-controls {
  margin-bottom: 25px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.filter-button {
  background-color: var(--button-bg);
  color: var(--text-heading);
  border: 1px solid var(--border-primary);
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1em;
  transition: background-color 0.2s ease;
}
.filter-button i {
  margin-right: 8px;
}
.filter-button:hover {
  background-color: var(--button-bg-hover);
}

.filter-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  box-shadow: 4px 0 15px var(--shadow-strong-color);
  transition: left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  color: var(--text-secondary);
}

.filter-sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-primary); /* #404040 is close to border-primary */
  flex-shrink: 0;
  background-color: var(--bg-secondary);
}

.sidebar-header h3 {
  margin: 0;
  color: var(--text-primary); /* #eee */
  font-size: 1.1em;
  font-weight: 600;
}
.sidebar-header h3 i {
  margin-right: 10px;
  color: var(--icon-color-muted); /* #888 */
}

#filter-close-btn {
  background: none;
  border: none;
  color: var(--icon-color-muted);
  font-size: 1.8em;
  line-height: 1;
  padding: 0 5px;
  cursor: pointer;
  transition: color 0.2s ease;
}
#filter-close-btn:hover {
  color: var(--text-heading);
}

.category-list-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 20px;
}

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

li.category-item {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-secondary);
}
li.category-item:last-child {
  border-bottom: none;
}

details.category-details {
  /* No extra margin */
}

summary.category-summary {
  display: flex;
  align-items: center;
  padding: 15px 5px 15px 0;
  cursor: pointer;
  position: relative;
  list-style: none;
  background-color: transparent;
  transition: background-color 0.15s ease;
}
summary.category-summary:hover {
  background-color: var(--element-subtle-hover-bg);
}
summary.category-summary::-webkit-details-marker {
  display: none;
}

input.category-checkbox {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
  vertical-align: middle;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  border: 1px solid var(--border-primary); /* #555, using border-primary #444 or text-disabled #555 */
  border-radius: 3px;
  background-color: var(--bg-element-raised); /* #333 */
  cursor: pointer;
}
input.category-checkbox:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}
input.category-checkbox:checked::before {
  content: "✓";
  position: absolute;
  color: var(--text-heading); /* white */
  font-size: 12px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

label.category-label {
  flex-grow: 1;
  color: var(--text-primary); /* #eee */
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
}

.toggle-icon {
  margin-left: auto;
  padding-left: 10px;
  color: var(--icon-color-muted);
  transition: transform 0.3s ease;
}
details[open] > summary .toggle-icon {
  transform: rotate(180deg);
}
.toggle-icon .fa-chevron-up {
  display: none;
}

ul.subcategory-list {
  list-style: none;
  padding: 5px 0 10px 35px;
  margin: 0;
}

ul.subcategory-list li.category-item {
  border-bottom: none;
}
ul.subcategory-list summary.category-summary {
  padding-top: 8px;
  padding-bottom: 8px;
}
ul.subcategory-list label.category-label {
  font-weight: 400;
  color: var(--text-secondary); /* #bbb */
  font-size: 0.95em;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  border-top: 1px solid var(--border-primary); /* #404040 */
  background-color: var(--bg-secondary);
  flex-shrink: 0;
}

.clear-filter-button,
.apply-filter-button {
  padding: 10px 25px;
  border-radius: 5px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.clear-filter-button {
  background-color: transparent;
  border: 1px solid var(--border-primary); /* #555 */
  color: var(--button-secondary-text); /* #aaa */
  text-decoration: none;
}
.clear-filter-button:hover {
  background-color: var(--bg-element-raised); /* #333 */
  border-color: var(--border-hover); /* #777 */
  color: var(--text-heading); /* #fff */
}

.apply-filter-button {
  background: linear-gradient(
    to right,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: none;
  color: var(--text-heading);
}
.apply-filter-button:hover {
  opacity: 0.9;
  box-shadow: 0 2px 5px var(--shadow-color);
}

/* ================================== */
/*         Item Grid & Cards          */
/* ================================== */
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-top: 20px;
}

.item-card {
  background-color: var(--bg-secondary); /* #2a2a2a */
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  border: 1px solid var(--border-secondary);
  position: relative;
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px var(--shadow-color); /* rgba(0,0,0,0.3) */
}

.item-card img.thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-secondary);
}

.item-card .item-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
  line-height: 1.4;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.1em;
}

.item-card .developer,
.item-card .category {
  /* This .category is text, not the tag */
  font-size: 0.5em;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-card .developer {
  margin-bottom: 10px;
}

/* Meta within item card - now handled by unified styles further down */
/* .item-card .meta (old, general color) was color: #bbb -> var(--text-secondary) */

.item-card .version i {
  /* This styling might be superseded by .version-tag */
  margin-right: 5px;
  color: var(--icon-color-muted); /* #888 */
}

/* Styles for the item type tag as an overlay */
.item-card .item-type-badge-overlay {
  position: absolute;
  background-color: var(--bg-primary);
  color: var(--text-heading);
  top: 10px; /* Adjust as needed */
  right: 10px; /* Adjust as needed */
  z-index: 2; /* Ensure it's above the image */
  padding: 5px 10px;
  font-size: 0.8em; /* Or 0.75em for a smaller badge */
  border-radius: 4px;
  line-height: 1.3;
  font-weight: 500;
  display: inline-flex; /* if not already set */
  align-items: center; /* if not already set */
  box-shadow: 0 1px 3px var(--shadow-strong-color);
}

/* ================================== */
/*         Item Detail Page           */
/* ================================== */
.item-detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 20px;
}

.item-detail-sidebar {
  flex: 1;
  min-width: 300px;
}

.item-detail-main {
  flex: 2;
  min-width: 350px;
}

.item-detail-sidebar img.detail-thumbnail {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid var(--border-primary);
}

.item-detail-sidebar .info-box {
  background-color: var(--bg-secondary);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
}

.item-type-badge.detail-badge {
  position: static;
  display: inline-block;
  margin-bottom: 15px;
  padding: 5px 10px;
  font-size: 0.9em;
  /* Badge specific colors will come from .item-type-tag.item-type-theme etc. */
}

.item-detail-sidebar .info-box ul {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
}

.item-detail-sidebar .info-box li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  font-size: 0.95em;
}
.item-detail-sidebar .info-box li i {
  margin-right: 12px;
  color: var(--icon-color-muted);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.item-detail-sidebar .info-box li a {
  color: var(--color-info);
  word-break: break-all;
}
.item-detail-sidebar .info-box li a:hover {
  color: var(--color-info-hover);
}

.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--color-success); /* Mapped from #27ae60 */
  color: #fff;
  width: 100%;
  text-align: center;
  padding: 15px;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.download-button:hover {
  background-color: var(--color-success-hover); /* Mapped from #2ecc71 */
  transform: translateY(-2px);
  color: #fff;
}
.download-button i {
  margin-right: 0;
}

.item-detail-main h1 {
  margin-top: 0;
  font-size: 2.2em;
  color: var(--text-heading);
  margin-bottom: 15px;
}

.gpl-notice {
  background-color: var(--bg-element-raised);
  border-left: 4px solid var(--accent-primary);
  padding: 12px 18px;
  margin-bottom: 25px;
  font-size: 0.9em;
  color: var(--text-secondary);
  border-radius: 0 4px 4px 0;
}
.gpl-notice a {
  color: var(--color-info);
}
.gpl-notice a:hover {
  color: var(--color-info-hover);
}

.course-tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border-primary);
  margin-bottom: 25px;
}

.tab-link {
  padding: 12px 20px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  color: var(--text-muted); /* #aaa */
  font-size: 1.1em;
  margin-right: 5px;
  border-bottom: 3px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  font-weight: 500;
}

.tab-link:hover {
  color: var(--text-primary); /* #eee */
}

.tab-link.active {
  color: var(--accent-primary);
  font-weight: 600;
  border-bottom-color: var(--accent-primary);
}

.course-tabs-content {
  /* Container for panels */
}

.course-tab-content {
  display: none;
  padding-top: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1.05em;
}
.course-tab-content h4 {
  margin-bottom: 10px;
  color: var(--text-primary); /* #eee */
}
.course-tab-content p,
.course-tab-content ul {
  margin-bottom: 15px;
}
.course-tab-content ul {
  padding-left: 25px;
  list-style: disc;
}
.course-tab-content li {
  margin-bottom: 8px;
}

.course-tab-content.active {
  display: block;
}

/* ================================== */
/*            Breadcrumbs             */
/* ================================== */
.breadcrumbs-container {
  width: 100%;
  padding: 12px 0;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-secondary);
  margin-bottom: 30px;
}

.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.breadcrumbs ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs li + li::before {
  content: "/";
  margin: 0 10px;
  color: var(--breadcrumb-separator); /* #6c757d */
}

.breadcrumbs a {
  color: var(--color-info);
}
.breadcrumbs a:hover {
  color: var(--color-info-hover);
  text-decoration: underline;
}

.breadcrumbs li span[aria-current="page"] {
  color: var(--text-heading);
  font-weight: 500;
}

/* ================================== */
/*            Pagination              */
/* ================================== */
.pagination-container {
  margin: 40px 0 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination-link,
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 4px;
  background-color: var(--bg-element-raised); /* #333 */
  color: var(--text-secondary); /* #ccc */
  font-weight: 500;
  border: 1px solid var(--border-primary); /* #444 */
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95em;
}

.pagination-link:hover,
.pagination-btn:not(.disabled):hover {
  background-color: var(--bg-element-raised-hover); /* #444 */
  border-color: var(--border-stronger); /* #666 */
  color: var(--text-heading); /* #fff */
  transform: translateY(-2px);
}

.pagination-link.current {
  background-color: var(--accent-primary);
  color: var(--text-heading); /* white */
  border-color: var(--accent-primary);
  font-weight: 600;
  cursor: default;
}

.pagination-btn {
  min-width: auto;
  padding: 0 15px;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bg-secondary); /* #2a2a2a */
  border-color: var(--border-secondary); /* #383838 */
  color: var(--text-very-disabled); /* #666 */
}
.pagination-btn.disabled:hover {
  transform: none;
}

.pagination-btn i {
  margin: 0 5px;
}
.pagination-btn.prev-btn i {
  margin-right: 5px;
  margin-left: 0;
}
.pagination-btn.next-btn i {
  margin-left: 5px;
  margin-right: 0;
}

.pagination-ellipsis {
  margin: 0 5px;
  color: var(--pagination-ellipsis-color); /* #777 */
  align-self: center;
  padding: 0 5px;
}

.pagination-info {
  color: var(--text-muted); /* #aaa */
  font-size: 0.9em;
}
.pagination-info span {
  font-weight: 600;
  color: var(--text-primary); /* #eee */
}

/* ================================== */
/*            Upload Form             */
/* ================================== */
.upload-form {
  max-width: 750px;
  margin: 30px auto;
  padding: 35px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
}

.upload-form h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-heading);
}

.upload-form .form-group {
  margin-bottom: 20px;
}

div.form-group label[for="manual_keywords"] {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: var(--text-secondary);
}

div.form-group textarea#manual_keywords {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-primary); /* #555 */
  border-radius: 4px;
  background-color: var(--bg-element-raised); /* #333 */
  color: var(--text-primary); /* #f0f0f0 */
  box-sizing: border-box;
  font-size: 16px;
  min-height: 70px;
  resize: vertical;
  margin-bottom: 5px;
}

div.form-group textarea#manual_keywords + small {
  display: block;
  font-size: 0.85em;
  color: var(--text-muted); /* #aaa */
  margin-top: 5px;
}

.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 {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-primary); /* #444 */
  background-color: var(--bg-element-raised); /* #333 */
  color: var(--text-primary); /* #e0e0e0 */
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.upload-form input:focus,
.upload-form textarea:focus,
.upload-form select:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary-transparent);
}

.upload-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.upload-form select {
  appearance: none;
  background-image: var(
    --select-arrow-icon
  ); /* Uses variable for themed arrow */
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 10px auto;
  padding-right: 40px;
}
.upload-form select[disabled] {
  background-color: var(--border-primary); /* #404040 */
  opacity: 0.6;
  cursor: not-allowed;
}

.upload-form input[type="file"] {
  padding: 10px;
  background-color: var(--border-secondary); /* #383838 */
}
.upload-form input[type="file"]::file-selector-button {
  padding: 8px 15px;
  margin-right: 15px;
  background-color: var(--text-disabled); /* #555 */
  color: var(--text-heading); /* #fff */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.upload-form input[type="file"]::file-selector-button:hover {
  background-color: var(--text-very-disabled); /* #666 */
}

.upload-form .form-group small {
  display: block;
  margin-top: 8px;
  font-size: 0.85em;
  color: var(--text-muted); /* #aaa */
}

.upload-form .checkbox-group {
  padding-top: 10px;
}
.upload-form .checkbox-group label {
  display: inline-flex;
  align-items: center;
  margin-right: 25px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
}
.upload-form input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  border: 1px solid var(--border-primary); /* #555 */
  border-radius: 3px;
  background-color: var(--bg-element-raised); /* #333 */
  vertical-align: middle;
}
.upload-form input[type="checkbox"]:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}
.upload-form input[type="checkbox"]:checked::before {
  content: "✓";
  position: absolute;
  color: var(--text-heading); /* white */
  font-size: 11px;
  font-weight: bold;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.upload-form button[type="submit"] {
  display: block;
  width: 100%;
  padding: 15px;
  background-color: var(--accent-primary);
  color: var(--text-heading); /* white */
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  margin-top: 25px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.upload-form button[type="submit"]:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-2px);
}

/* Message Styling */
.message {
  padding: 15px 20px;
  margin-bottom: 25px;
  border-radius: 5px;
  font-weight: 500;
  border: 1px solid transparent;
  line-height: 1.5;
}
.message.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success-border);
}
.message.error {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}
.message.error br {
  margin-bottom: 5px;
}

/* ================================== */
/*               FAQ Section            */
/* ================================== */
.faq-section {
  margin: 50px 0;
  padding: 30px;
  background-color: var(--bg-tertiary); /* #222222 */
  border-radius: 8px;
  box-shadow: 0 2px 5px var(--shadow-color);
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-heading);
  font-size: 28px;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-container details {
  margin-bottom: 15px;
  border: 1px solid var(--border-primary); /* #444444 */
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-element-raised); /* #333333 */
  transition: background-color 0.3s ease;
}
.faq-container details[open] {
  background-color: var(--element-bg-hover); /* #3a3a3a */
}

.faq-container summary {
  padding: 15px 20px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  outline: none;
  color: var(--text-heading);
  font-size: 1.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.faq-container summary::-webkit-details-marker {
  display: none;
}

.faq-container summary::after {
  content: "+";
  font-size: 1.5em;
  font-weight: 300;
  line-height: 1;
  color: var(--text-secondary); /* #cccccc */
  transition: transform 0.3s ease;
}

.faq-container details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-container details p {
  padding: 15px 20px 20px 20px;
  margin: 0;
  border-top: 1px solid var(--border-primary); /* #444444 */
  color: var(--text-secondary); /* #cccccc */
  line-height: 1.6;
}

/* ================================== */
/*            Footer Styles           */
/* ================================== */
.site-footer {
  background-color: var(--bg-gradient-end); /* #1a1a1a */
  color: var(--text-muted); /* #aaa */
  padding: 50px 0 20px;
  margin-top: 50px;
  font-size: 0.95em;
  border-top: 1px solid var(--border-secondary); /* #333 is close */
}

.site-footer .container {
  /* Uses global container */
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 30px;
}

.footer-section {
  flex: 1;
  min-width: 220px;
  margin-bottom: 30px;
}

.footer-section h3 {
  color: var(--text-primary); /* #eee */
  font-size: 1.2em;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
  font-weight: 600;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-primary);
}

.footer-section.about p {
  margin-bottom: 20px;
  line-height: 1.7;
  color: var(--text-secondary); /* #ccc */
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: var(--bg-element-raised); /* #333 */
  border-radius: 50%;
  color: var(--text-heading); /* #fff */
  margin-right: 8px;
  font-size: 1.1em;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background-color: var(--accent-primary);
  transform: scale(1.1);
}

.footer-section.links ul {
  list-style: none;
  padding: 0;
}

.footer-section.links ul li {
  margin-bottom: 12px;
}

.footer-section.links ul li a {
  color: var(--text-secondary); /* #ccc */
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.3s ease;
  display: block;
  position: relative;
}
.footer-section.links ul li a::before {
  content: "»";
  position: absolute;
  left: -15px;
  opacity: 0;
  transition: left 0.3s ease, opacity 0.3s ease;
  color: var(--accent-primary);
}

.footer-section.links ul li a:hover {
  color: var(--text-heading); /* #fff */
  padding-left: 5px;
}
.footer-section.links ul li a:hover::before {
  left: -5px;
  opacity: 1;
}

.footer-section.contact p {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  color: var(--text-secondary); /* #ccc */
}

.footer-section.contact p i {
  margin-right: 12px;
  color: var(--accent-primary);
  width: 18px;
  text-align: center;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  margin-top: 20px;
  border-top: 1px solid var(--border-secondary); /* #333 */
  font-size: 0.9em;
  color: var(--icon-color-muted); /* #888 */
}

.footer-bottom p {
  margin-bottom: 10px;
}

.disclaimer {
  font-size: 0.85em;
  color: var(--pagination-ellipsis-color); /* #777 */
  line-height: 1.5;
}
.disclaimer a {
  color: var(--icon-color-muted); /* #888 */
}
.disclaimer a:hover {
  color: var(--text-muted); /* #aaa */
}

/* ================================== */
/*       Responsive Adjustments       */
/* ================================== */
@media (max-width: 992px) {
  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2em;
  }
  h2 {
    font-size: 1.6em;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .logo {
    margin-bottom: 15px;
  }
  nav ul {
    margin-top: 10px;
    flex-wrap: wrap;
  }
  nav ul li {
    margin-left: 0;
    margin-right: 15px;
    margin-bottom: 5px;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
  }

  .item-detail-container {
    flex-direction: column;
    gap: 30px;
  }
  .item-detail-sidebar,
  .item-detail-main {
    flex-basis: 100%;
    min-width: unset;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    width: 280px;
    left: -300px; /* Adjust if width changes significantly affecting hide */
  }

  .tab-link {
    font-size: 1em;
    padding: 10px 15px;
  }

  .footer-content {
    flex-direction: column;
    gap: 15px;
  }
  .footer-section {
    margin-bottom: 25px;
  }

  .pagination {
    gap: 0.3rem;
  }
  .pagination-link,
  .pagination-btn {
    height: 36px;
    min-width: 36px;
    font-size: 0.9em;
    padding: 0 10px;
  }
  .pagination-info {
    font-size: 0.85em;
  }
}

@media (max-width: 576px) {
  .item-grid {
    grid-template-columns: 1fr;
  }
  .upload-form {
    padding: 25px;
  }
  .intro-text p {
    font-size: 1em;
  }
  .breadcrumbs {
    font-size: 0.85em;
  }
  .breadcrumbs li + li::before {
    margin: 0 6px;
  }
  .value-proposition {
    padding: 30px 20px;
  }
  .faq-section {
    padding: 20px;
  }
  .faq-container summary {
    font-size: 1em;
  }
}

/* Animation (Optional) */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* .item-grid { animation: fadeIn 0.5s ease-out forwards; } */

/* AI Fetch Styling */
.ai-fetch-container {
  background-color: var(--bg-secondary);
  padding: 25px;
  margin-bottom: 30px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
  border: 1px solid var(--border-secondary);
  box-shadow: 0 3px 10px var(--shadow-color);
}

.ai-fetch-container h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text-heading);
  font-size: 1.3em;
  font-weight: 600;
}

.input-group {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.url-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-element-raised);
  color: var(--text-primary);
  border-radius: 5px;
  font-size: 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary-transparent);
}

.ai-btn {
  background: linear-gradient(
    to right,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  color: var(--text-heading);
  padding: 0 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1em;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.ai-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px var(--shadow-color);
}

.ai-status {
  margin-top: 15px;
  padding: 12px 18px;
  border-radius: 5px;
  font-size: 0.95em;
  font-weight: 500;
  border-width: 1px; /* Ensure border width is set for consistent spacing */
  border-style: solid; /* Ensure border style is set */
}

.ai-status.loading {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info-border);
}

.ai-status.error {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

.ai-status.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success-border);
}

.ai-status i {
  margin-right: 8px;
}

.features-list {
  list-style: none;
  padding-left: 5px;
  margin-top: 15px;
}

.features-list li {
  margin-bottom: 12px;
  line-height: 1.5;
  display: flex;
  align-items: start;
}

.features-list li i {
  flex-shrink: 0;
  margin-top: 3px;
}

/* Enhanced Search Styling */
.search-container {
  margin-bottom: 30px;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  transition: all 0.3s ease;
}

.search-wrapper {
  display: flex;
  position: relative;
  box-shadow: 0 4px 15px var(--shadow-color);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--border-secondary);
  transition: all 0.3s ease;
  background-color: var(--bg-secondary);
}

.search-wrapper:focus-within {
  box-shadow: 0 6px 20px var(--shadow-strong-color);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

#search-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  border: none;
  outline: none;
  width: 100%;
  background-color: transparent;
  color: var(--text-primary);
}

.search-button {
  background: linear-gradient(
    45deg,
    var(--accent-primary-hover),
    var(--accent-primary)
  );
  border: none;
  color: var(--text-heading);
  padding: 0 30px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
}

.search-button:hover {
  background: linear-gradient(
    45deg,
    var(--accent-primary-hover),
    var(--accent-primary-hover-darker)
  );
}

.search-button:active {
  transform: scale(0.95);
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-radius: 15px;
  box-shadow: 0 10px 25px var(--shadow-color);
  z-index: 100;
  max-height: 350px;
  overflow-y: auto;
  display: none;
  margin-top: 10px;
  padding: 8px 0;
  border: 1px solid var(--border-secondary);
}

.search-suggestions::-webkit-scrollbar {
  width: 8px;
}
.search-suggestions::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}
.search-suggestions::-webkit-scrollbar-thumb {
  background: var(--border-primary);
}
.search-suggestions::-webkit-scrollbar-thumb:hover {
  background: var(--text-disabled);
}

.search-suggestions .suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.active {
  background-color: var(--bg-element-raised);
}

.search-suggestions .suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestions .suggestion-item:before {
  content: "\f002";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 10px;
  color: var(--accent-primary);
  opacity: 0.7;
  font-size: 12px;
}

.search-results-info {
  padding: 12px 18px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--accent-primary);
}

.search-results-info p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.search-results-info p strong {
  color: var(--text-heading);
  background-color: var(
    --accent-primary-transparent
  ); /* Using 0.3 alpha, original was 0.2 */
  padding: 2px 6px;
  border-radius: 3px;
}

.clear-search {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  background-color: var(--bg-element-raised);
  padding: 5px 10px;
  border-radius: 5px;
}

.clear-search:hover {
  color: var(--text-heading);
  background-color: var(--accent-primary);
}

.clear-search i {
  margin-right: 5px;
}

.no-results-container {
  text-align: center;
  padding: 50px 20px;
  background-color: var(--bg-secondary);
  border-radius: 15px;
  margin: 30px 0;
  border: 1px solid var(--border-secondary);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.no-results-icon {
  font-size: 70px;
  color: var(--text-muted);
  margin-bottom: 25px;
  opacity: 0.5;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

.no-results-container h3 {
  font-size: 26px;
  margin-bottom: 15px;
  color: var(--text-heading);
}

.no-results-container p {
  color: var(--text-muted);
  margin-bottom: 25px;
  font-size: 16px;
}

.btn-outline-primary {
  color: var(--color-info);
  border: 1px solid var(--color-info);
  padding: 10px 25px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s;
  font-weight: 500;
  display: inline-block;
}

.btn-outline-primary:hover {
  background-color: var(--color-info);
  color: var(--text-heading); /* white */
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--color-info-shadow);
}

@media (max-width: 768px) {
  .search-wrapper {
    border-radius: 8px;
  }
  #search-input {
    padding: 12px 15px;
    font-size: 14px;
  }
  .search-button {
    padding: 0 20px;
  }
  .search-results-info {
    flex-direction: column;
    align-items: flex-start;
  }
  .clear-search {
    margin-top: 8px;
  }
  .search-suggestions {
    border-radius: 8px;
  }
}

/* ================================== */
/*       Related Items Section        */
/* ================================== */
.related-items-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-secondary);
}

.related-items-section h2 {
  text-align: left;
  font-size: 1.8em;
  color: var(--text-heading);
  margin-bottom: 25px;
}

.related-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

/* The following styles for .item-card .item-meta apply to both main grid and related items grid */

/* CSS FOR ITEM CARD META TAGS (APPLIES TO MAIN GRID & RELATED ITEMS) */
.item-card .item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

/* General style for all tags (span elements) within .item-meta */
.item-card .item-meta span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.8em;
  border-radius: 4px;
  line-height: 1.3;
  font-weight: 500;
  /* Default subtle styling - often overridden by specific tags */
  background-color: var(--element-subtle-hover-bg); /* Very subtle tint */
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary); /* Very subtle border */
}

.item-card .item-meta span i {
  margin-right: 6px;
  font-size: 0.95em;
  opacity: 0.8;
}

/* Specific styling for CATEGORY tag */
.item-card .item-meta .category {
  /* This is for the tag named 'category' */
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info-border);
}
.item-card .item-meta .category i {
  color: var(--color-info);
  opacity: 1;
}

/* Specific styling for ITEM TYPE tags */
.item-card .item-meta .item-type-tag.item-type-theme {
  background-color: var(
    --color-info-bg
  ); /* Assuming 'theme' type uses info color */
  color: var(--color-info);
  border-color: var(--color-info-border);
}
.item-card .item-meta .item-type-tag.item-type-theme i {
  color: var(--color-info);
  opacity: 1;
}

.item-card .item-meta .item-type-tag.item-type-plugin {
  background-color: var(
    --color-download-bg
  ); /* Using download color scheme for plugin */
  color: var(--color-download);
  border-color: var(--color-download-border);
}
.item-card .item-meta .item-type-tag.item-type-plugin i {
  color: var(--color-download);
  opacity: 1;
}

.item-card .item-meta .item-type-tag.item-type-woocommerce {
  background-color: var(--accent-primary-transparent);
  color: var(--accent-primary);
  border-color: var(--accent-border);
}
.item-card .item-meta .item-type-tag.item-type-woocommerce i {
  color: var(--accent-primary);
  opacity: 1;
}

.item-card .item-meta .item-type-tag.item-type-unknown {
  background-color: var(--color-neutral-bg);
  color: var(--color-neutral-text);
  border-color: var(--color-neutral-border);
}
.item-card .item-meta .item-type-tag.item-type-unknown i {
  color: var(--color-neutral-text);
  opacity: 1;
}

/* Specific styling for VERSION tag */
.item-card .item-meta .version-tag {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-color: var(--color-success-border);
}
.item-card .item-meta .version-tag i {
  color: var(--color-success);
  opacity: 1;
}

/* Specific styling for DEVELOPER tag */
.item-card .item-meta .developer-tag {
  background-color: var(--color-neutral-bg); /* Using neutral scheme */
  color: var(--color-neutral-text);
  border-color: var(--color-neutral-border);
}
.item-card .item-meta .developer-tag i {
  color: var(--color-neutral-text);
  opacity: 1;
}

/* Responsive adjustments for related items grid (often covered by .item-grid) */
@media (max-width: 768px) {
  .related-items-section h2 {
    font-size: 1.6em;
  }
}

@media (max-width: 576px) {
  .related-items-grid {
    grid-template-columns: 1fr;
  }
  .related-items-grid .item-card .item-meta span,
  .item-card .item-meta span {
    /* Apply to all meta spans on small screens */
    font-size: 0.75em;
    padding: 4px 8px;
  }
}

/* --- Modal Styles --- */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.6); /* Black w/ opacity */
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto; /* 5% from the top and centered */
  padding: 25px 30px;
  border: 1px solid #ddd;
  width: 90%; /* Could be more or less, depending on screen size */
  max-width: 550px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
}

.close-modal-btn {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 30px;
  font-weight: bold;
  line-height: 1;
}

.close-modal-btn:hover,
.close-modal-btn:focus {
  color: #333;
  text-decoration: none;
  cursor: pointer;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
}

.modal-content p {
  font-size: 1em;
  line-height: 1.6;
  color: #555;
}

.bmc-button-link {
  display: flex;
  justify-content: center; /* Horizontally centers the flex item (the image) */
  align-items: center; /* Vertically centers (if the link had a fixed height larger than img) */
  /* ... other styles for the link ... */
}

.bmc-button-link img {
  margin: 15px 0;
  transition: transform 0.2s ease-in-out;
}
.bmc-button-link:hover img {
  transform: scale(1.05);
}

.modal-actions {
  margin-top: 25px;
  display: flex;
  flex-direction: column; /* Stack buttons on small screens */
  gap: 10px;
  align-items: center;
}

.modal-button {
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95em;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%; /* Full width for stacked buttons */
  max-width: 250px; /* Max width for larger screens if side-by-side */
}

.skip-btn {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}
.skip-btn:hover {
  background-color: #e0e0e0;
}

.support-btn {
  background-color: #ffdd00; /* BMC Yellow */
  color: #000000; /* Black text for BMC button */
  /* border: 1px solid #e6c600; */
}
.support-btn:hover {
  background-color: #e6c600; /* Darker BMC Yellow */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* On wider screens, make buttons side-by-side */
@media (min-width: 480px) {
  .modal-actions {
    flex-direction: row;
    justify-content: center;
  }
  .modal-button {
    width: auto; /* Auto width for side-by-side buttons */
  }
}
