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

html {
  scroll-behavior: smooth;
}

.navbar {
  z-index: 1 !important;
}

#loading-bar {
  height: 2px !important;
}

#loading-bar .progress-bar {
  display: none;
}

#loading-bar.show .progress-bar {
  display: block;
}

@keyframes youtube-loader-animation {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-bar {
  animation: youtube-loader-animation 2s infinite cubic-bezier(0.65, 0.81, 0.73, 0.4);
}

html, body {
  scroll-behavior: smooth;
}

.card-img-top {
  height: 250px;
  object-fit: cover;
}

.image-anchor-container {
  width: 100%;
  height: 250px;
  background-color: #f3f3f3;
}

.image-anchor-container.loading {
  background: linear-gradient(
      to right,
      #f3f3f3 0%,
      #ddd 18%,
      #f3f3f3 33%
  );
  background-size: 1000px 250px;
  animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loader {
  width: 28px;
  height: 28px;
  border: 5px solid var(--bs-secondary);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dropdown-menu .dropdown-item i {
  width: 20px !important;
}

.scrollarea {
  overflow-y: auto;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  border: 2px solid var(--bs-secondary-bg-subtle);
  padding: 10px 50px 10px 20px;
  width: 100%;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--bs-primary);
  box-shadow: none;
}

.search-icon {
  position: absolute;
  right: 20px;
  color: #666;
}

/* Category filters horizontal scroll */
.category-filters-wrapper {
  position: relative;
  overflow: hidden;
}

.category-filters-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  scroll-behavior: smooth;
  padding: 4px 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.category-filters-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-filters-scroll.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.category-filters-scroll .filter-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

.category-filters-scroll .filter-divider {
  flex-shrink: 0;
  align-self: stretch;
}

/* Scroll fade indicators - subtle shadow effect */
.category-filters-wrapper::before,
.category-filters-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.category-filters-wrapper::before {
  left: 0;
  background: linear-gradient(to right, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(255, 255, 255, 0.8) 30%, 
    rgba(255, 255, 255, 0) 100%);
}

.category-filters-wrapper::after {
  right: 0;
  background: linear-gradient(to left, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(255, 255, 255, 0.8) 30%, 
    rgba(255, 255, 255, 0) 100%);
}

.category-filters-wrapper.fade-left::before {
  opacity: 1;
}

.category-filters-wrapper.fade-right::after {
  opacity: 1;
}

/* Hide the old fade indicators (keeping for backwards compatibility) */
.scroll-fade-left,
.scroll-fade-right {
  display: none;
}

.filter-chip {
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
  background-color: transparent;
  border-color: var(--bs-secondary);
  color: var(--bs-secondary);
}

.toastify {
  background-image: none !important;
  padding-top: -7rem !important;
  padding-bottom: -7rem !important;
  border-radius: 0 !important;
}

.toastify-primary {
  background-color: var(--bs-primary) !important;
}

.toastify-secondary {
  background-color: var(--bs-secondary) !important;
}

.toastify-success {
  background-color: var(--bs-success) !important;
}

.toastify-danger {
  background-color: var(--bs-danger) !important;
}

/* Light-on-dark text colors (Warning, Info) */
.toastify-warning {
  background-color: var(--bs-warning) !important;
}

.toastify-info {
  background-color: var(--bs-info) !important;
  color: var(--bs-dark) !important;
}

/* Added: Dark background with white text */
.toastify-dark {
  background-color: var(--bs-dark) !important;
  color: var(--bs-white) !important;
}

/* Added: Light background with dark text */
.toastify-light {
  background-color: var(--bs-light) !important;
  color: var(--bs-dark) !important;
}

#existing-images-container {
  transition: all 0.2s ease !important;
}

/* Let pointer events pass through the number so drag handle and row can receive clicks */
#existing-images-container.list-group-numbered > .list-group-item::before {
  pointer-events: none;
}

#existing-images-container .list-group-item {
  border-width: 1px;
  transition: all 0.2s ease !important;
}

#existing-images-container .list-group-item:hover {
  background-color: #f8f9fa;
}

/* Keep default cursor on interactive elements inside sortable rows */
#existing-images-container .list-group-item textarea,
#existing-images-container .list-group-item input,
#existing-images-container .list-group-item button,
#existing-images-container .list-group-item .btn,
#existing-images-container .list-group-item .image-preview-thumbnail {
  cursor: default;
}

.image-preview-thumbnail {
  transition: all 0.2s ease;
}

.image-preview-thumbnail:hover {
  transform: scale(1.05);
}

/* Move up/down buttons: compact, clear states */
#existing-images-container .d-flex.flex-column.gap-0 {
  gap: 2px !important;
}

#existing-images-container .move-image-up,
#existing-images-container .move-image-down {
  width: 28px;
  min-width: 28px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border-color: var(--bs-border-color);
  color: var(--bs-secondary);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#existing-images-container .move-image-up:hover:not(:disabled),
#existing-images-container .move-image-down:hover:not(:disabled) {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

#existing-images-container .move-image-up:focus,
#existing-images-container .move-image-down:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

#existing-images-container .move-image-up:disabled,
#existing-images-container .move-image-down:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: transparent;
}

.sortable-ghost {
  opacity: 0.5;
}

.sortable-chosen {
  background-color: rgba(255, 255, 255, 0.03);
}
.breadcrumb-chevron {
  --bs-breadcrumb-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  gap: .5rem;
  min-width: 0; /* Allow flex item to shrink below content size */
  overflow: visible; /* Allow dropdown menu to overflow */
  flex-wrap: nowrap; /* Never wrap - keep button on same line */
  position: relative; /* For z-index context */
}

/* Make breadcrumb draggable with scroll and shadow indicators */
.breadcrumb-chevron > nav {
  flex: 1 1 auto;
  min-width: 0;
  position: relative; /* For shadow overlays */
  overflow: hidden; /* Clip overflow but allow scrolling */
}

/* Hide scrollbar but keep scroll functionality */
.breadcrumb-chevron > nav > ol {
  flex-wrap: nowrap;
  white-space: nowrap;
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  cursor: grab;
  scroll-behavior: smooth;
}

/* Disable smooth scrolling for instant positioning */
.breadcrumb-chevron > nav > ol.scrolling-instant {
  scroll-behavior: auto !important;
}

.breadcrumb-chevron > nav > ol::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.breadcrumb-chevron > nav > ol.dragging {
  cursor: grabbing;
  user-select: none;
}

/* Shadow overlays to indicate scrollable content */
.breadcrumb-chevron > nav::before,
.breadcrumb-chevron > nav::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Left shadow */
.breadcrumb-chevron > nav::before {
  left: 0;
  background: linear-gradient(to right, var(--bs-body-bg, #fff), transparent);
}

/* Right shadow */
.breadcrumb-chevron > nav::after {
  right: 0;
  background: linear-gradient(to left, var(--bs-body-bg, #fff), transparent);
}

/* Show shadows when needed */
.breadcrumb-chevron > nav.fade-left::before {
  opacity: 1;
}

.breadcrumb-chevron > nav.fade-right::after {
  opacity: 1;
}

/* Breadcrumb items maintain their real size */
.breadcrumb-chevron .breadcrumb-item {
  display: flex;
  gap: inherit;
  align-items: center;
  padding-left: 0;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0; /* Keep real size - don't shrink */
  flex-grow: 0;
}

/* Home icon (first item) always visible - sticky to the left */
.breadcrumb-chevron .breadcrumb-item:first-child {
  position: sticky;
  left: 0;
  z-index: 3; /* Above other items and shadows */
  background-color: var(--bs-body-bg, #fff); /* Solid background */
  padding-right: 0; /* No padding to avoid overlap */
}

/* Soft fade shadow to the right of the home icon - starts after the icon */
.breadcrumb-chevron .breadcrumb-item:first-child > a {
  position: relative;
  z-index: 2; /* Above the shadow */
}

.breadcrumb-chevron .breadcrumb-item:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: -30px; /* Position to the right, outside the item */
  bottom: 0;
  width: 30px;
  background: linear-gradient(to right, var(--bs-body-bg, #fff), transparent);
  pointer-events: none;
  z-index: 1; /* Behind the icon but fades content to the right */
}

.breadcrumb-chevron .breadcrumb-item > a {
  white-space: nowrap;
  display: block;
  pointer-events: auto; /* Allow clicks on links */
}

.breadcrumb-chevron .breadcrumb-item.active {
  white-space: nowrap;
}

.breadcrumb-chevron .breadcrumb-item::before {
  gap: inherit;
  float: none;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0; /* Keep chevron icon visible */
}

/* Ensure dropdown button container never wraps */
.breadcrumb-chevron > .d-flex {
  flex-shrink: 0; /* Never shrink the button container */
  flex-wrap: nowrap;
  position: relative;
  z-index: 10; /* Ensure dropdown is above breadcrumb and shadows */
}

/* Ensure dropdown menu appears correctly */
.breadcrumb-chevron .dropdown-menu {
  z-index: 1050 !important; /* Bootstrap dropdown z-index */
}

.breadcrumb-custom .breadcrumb-item {
  position: relative;
  flex-grow: 1;
  padding: .75rem 3rem;
}

.breadcrumb-custom .breadcrumb-item::before {
  display: none;
}

.breadcrumb-custom .breadcrumb-item::after {
  position: absolute;
  top: 50%;
  right: -25px;
  z-index: 1;
  display: inline-block;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  content: "";
  background-color: var(--bs-tertiary-bg);
  border-top-right-radius: .5rem;
  box-shadow: 1px -1px var(--bs-border-color);
  transform: scale(.707) rotate(45deg);
}

.breadcrumb-custom .breadcrumb-item:first-child {
  padding-left: 1.5rem;
}

.breadcrumb-custom .breadcrumb-item:last-child {
  padding-right: 1.5rem;
}

.breadcrumb-custom .breadcrumb-item:last-child::after {
  display: none;
}

.dropdown-item-danger {
  color: var(--bs-red);
}

.dropdown-item-danger:hover,
.dropdown-item-danger:focus {
  color: #fff;
  background-color: var(--bs-red);
}

.dropdown-item-danger.active {
  background-color: var(--bs-red);
}

.btn-hover-light {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

.btn-hover-light:hover,
.btn-hover-light:focus {
  color: var(--bs-link-hover-color);
  background-color: var(--bs-tertiary-bg);
}

.btn-xs {
  /* Smaller padding */
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.4rem;
  /* Smaller font size */
  /*--bs-btn-font-size: 0.7rem;*/
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
  font-size: var(--bs-btn-font-size);
  /* Make it circular/square if preferred */
  line-height: 1;
}

.font-default {
  font-family: var(--bs-font-sans-serif), serif !important;
}

/* Remove bullets from validation summary lists */
.validation-summary-errors ul,
[asp-validation-summary] ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.validation-summary-errors ul li,
[asp-validation-summary] ul li {
  list-style: none;
}