/**
 * Category Selector Widget Styles
 */

/* Common styles for all layouts */
.category-selector-container {
  margin: 0 0 30px;
  font-family: sans-serif;
}

.category-count {
  opacity: 0.7;
  font-size: 0.85em;
}

/* Grid Layout Style */
.grid-style .category-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.grid-style .category-item {
  display: block;
  text-decoration: none;
  color: #333;
  background-color: #f7f7f7;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
  height: 100%;
}

.grid-style .category-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  background-color: #fff;
  border-color: #ddd;
}

.grid-style .category-title {
  margin: 0 0 8px;
  font-size: 1em;
  font-weight: 600;
}

.grid-style .subcategories {
  margin-top: 8px;
  font-size: 0.8em;
}

.grid-style .subcategory-item {
  display: inline-block;
  background: #eee;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 4px;
  margin-bottom: 4px;
  color: #666;
}

.grid-style .more-subcategories {
  display: inline-block;
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 12px;
  color: #666;
  font-style: italic;
}

/* Dropdown Style */
.dropdown-style {
  position: relative;
  width: 100%;
}

.dropdown-style .dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f8f8;
  padding: 12px 15px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.dropdown-style .dropdown-header:hover {
  background-color: #f0f0f0;
}

.dropdown-style .dropdown-title {
  font-weight: 600;
}

.dropdown-style .dropdown-menu {
  position: absolute;
  width: 100%;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-top: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.dropdown-style.active .dropdown-menu {
  max-height: 500px;
  opacity: 1;
}

.dropdown-style .dropdown-item, 
.dropdown-style .parent-category,
.dropdown-style .child-category {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.2s ease;
}

.dropdown-style .dropdown-item:hover, 
.dropdown-style .parent-category:hover,
.dropdown-style .child-category:hover {
  background-color: #f7f7f7;
}

.dropdown-style .dropdown-parent-item {
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-style .dropdown-parent-item:last-child {
  border-bottom: none;
}

.dropdown-style .parent-category {
  font-weight: 600;
}

.dropdown-style .dropdown-submenu {
  background-color: #f9f9f9;
}

.dropdown-style .child-category {
  padding-left: 30px;
  font-size: 0.95em;
}

/* Accordion Style */
.accordion-style .accordion-list {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.accordion-style .accordion-item {
  border-bottom: 1px solid #e0e0e0;
}

.accordion-style .accordion-item:last-child {
  border-bottom: none;
}

.accordion-style .accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #f9f9f9;
  cursor: pointer;
}

.accordion-style .category-name {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  flex-grow: 1;
}

.accordion-style .accordion-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.accordion-style .accordion-toggle .minus-icon {
  display: none;
}

.accordion-style .accordion-item.active .accordion-toggle .plus-icon {
  display: none;
}

.accordion-style .accordion-item.active .accordion-toggle .minus-icon {
  display: block;
}

.accordion-style .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #fff;
}

.accordion-style .accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-style .accordion-subitem {
  display: block;
  padding: 10px 15px 10px 35px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.accordion-style .accordion-subitem:last-child {
  border-bottom: none;
}

.accordion-style .accordion-subitem:hover {
  background-color: #f7f7f7;
}

.accordion-style .accordion-item-flat {
  display: block;
  padding: 12px 15px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  background-color: #fff;
}

.accordion-style .accordion-item-flat:last-child {
  border-bottom: none;
}

.accordion-style .accordion-item-flat:hover {
  background-color: #f7f7f7;
}

/* Tag Cloud Style */
.tag-cloud-style .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 5px 0;
}

.tag-cloud-style .tag-item {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tag-cloud-style .tag-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.tag-cloud-style .category-count {
  opacity: 0.8;
  font-weight: normal;
}

/* Image Based Style */
.image-based-style .image-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}

.image-based-style .image-category-item {
  display: block;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
}

.image-based-style .image-category-item:hover {
  transform: translateY(-3px);
}

.image-based-style .image-category-item:hover .category-image {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.image-based-style .category-image {
  height: 140px;
  width: 100%;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.image-based-style .category-initial {
  font-size: 2.5em;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
}

.image-based-style .category-title {
  font-size: 0.95em;
  margin: 0 0 5px;
  font-weight: 600;
}

.image-based-style .category-count {
  font-size: 0.8em;
  color: #777;
}

/* Default Style */
.default-style .category-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.default-style .category-item {
  margin-bottom: 8px;
}

.default-style .category-item > a {
  display: block;
  text-decoration: none;
  color: #333;
  padding: 8px 0;
  font-weight: 600;
}

.default-style .subcategory-list {
  list-style-type: none;
  padding-left: 20px;
  margin: 5px 0 15px;
}

.default-style .subcategory-item {
  margin-bottom: 5px;
}

.default-style .subcategory-item a {
  display: block;
  text-decoration: none;
  color: #555;
  padding: 5px 0;
  font-size: 0.95em;
}

.default-style a:hover {
  color: #0073aa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .grid-style .category-items {
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  
  .image-based-style .image-category-grid {
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  
  .image-based-style .category-image {
      height: 110px;
  }
}

@media (max-width: 480px) {
  .grid-style .category-items,
  .image-based-style .image-category-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}