/**
 * Build Your System Page Styles
 * Uses global --primary-color (#ffc222) from design-hub.css
 * Note: design-hub.css must be loaded first via dependency
 */

/* ========================================
   Animations
   ======================================== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Hero Section Override
   ======================================== */

.build-system-hero.hero-section {
  background-image: url("../images/build_your_system_static_banner-1.jpg");
}

/* ========================================
   Layout & Structure
   ======================================== */

.build-system-wrapper {
  background-color: #fff;
}

/* ========================================
   Left Sidebar - Journey Map
   ======================================== */

.hide {
  display: none !important;
}

.build-system-sidebar {
  background-color: var(--primary-color) !important;
  padding: 30px 15px;
  min-height: calc(100vh - 120px);
  position: relative;
}

.journey-map {
  width: 100%;
  position: sticky;
  top: 50px;
}

.journey-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
}

.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background-color: #fff;
  border-radius: 8px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.journey-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.journey-step.active {
  border-color: #1e9dd8;
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}
.journey-step[data-journey-stage="7"] {
  background-color: #c7c7c7;
  cursor: not-allowed;
}
.step-number {
  font-weight: 700;
  color: #333;
  font-size: 15px;
  flex-shrink: 0;
  min-width: 20px;
  margin-top: -3px;
}

.step-text {
  color: #333;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  flex: 1;
}

.btn-journey-load,
.btn-journey-start {
  display: block !important;
  width: 100%;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white !important;
  background-color: #000000 !important;
}

.btn-journey-load:hover,
.btn-journey-start:hover {
  background-color: #333 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Active Build Profile Indicator */
.active-profile-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 14px;
}

.active-profile-check {
  flex-shrink: 0;
  background-color: #fff;
  border-radius: 100%;
}

.active-profile-label {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.active-profile-name {
  flex: 1;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bootstrap Tooltip Override for active profile indicator - matches lattice-tooltip style */
.tooltip.lattice-tooltip {
  --bs-tooltip-max-width: 240px;
  --bs-tooltip-bg: rgba(26, 26, 26, 0.75);
}

.tooltip.lattice-tooltip .tooltip-inner {
  background-color: rgba(26, 26, 26, 0.75);
  color: #ffffff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  line-height: 1.45;
  max-width: 240px;
}

.tooltip.lattice-tooltip {
  background: transparent !important;
  background-color: transparent !important;
}

.tooltip.lattice-tooltip .tooltip-arrow,
.tooltip.lattice-tooltip .arrow {
  background: transparent !important;
  background-color: transparent !important;
}

.tooltip.lattice-tooltip .tooltip-arrow::before,
.tooltip.lattice-tooltip .tooltip-arrow::after,
.tooltip.lattice-tooltip .arrow::before,
.tooltip.lattice-tooltip .arrow::after {
  background: transparent !important;
  background-color: transparent !important;
}

/* Custom tooltip for active profile indicator */
.bys-custom-tooltip {
  position: absolute;
  z-index: 9999;
  background-color: rgba(26, 26, 26, 0.75);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 6px;
  max-width: 240px;
  pointer-events: none;
  white-space: normal;
  text-align: center;
}

/* Arrow pointing left (when tooltip is to the right of text) */
.bys-custom-tooltip.arrow-left::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent rgba(26, 26, 26, 0.75) transparent transparent;
}

/* Arrow pointing up (when tooltip is below text) */
.bys-custom-tooltip.arrow-top::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 16px;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent rgba(26, 26, 26, 0.75) transparent;
}

.tooltip.lattice-tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.lattice-tooltip.bs-tooltip-right .tooltip-arrow::before,
.tooltip.lattice-tooltip.bs-tooltip-end .arrow::before,
.tooltip.lattice-tooltip.bs-tooltip-right .arrow::before {
  border-color: transparent !important;
  border-right-color: rgba(26, 26, 26, 0.75) !important;
}

.tooltip.lattice-tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.lattice-tooltip.bs-tooltip-top .arrow::before {
  border-color: transparent !important;
  border-top-color: rgba(26, 26, 26, 0.75) !important;
}

.tooltip.lattice-tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.lattice-tooltip.bs-tooltip-bottom .arrow::before {
  border-color: transparent !important;
  border-bottom-color: rgba(26, 26, 26, 0.75) !important;
}

/* ========================================
   Main Content Area
   ======================================== */

.build-system-main {
  padding: 0;
  background-color: #fff;
  overflow: visible;
  position: relative;
}

/* ========================================
   Resource Cards
   ======================================== */

.resource-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-3px);
  transition: all 0.3s ease;
}

.card .ratio-1x1 {
  --bs-aspect-ratio: 60% !important;
}

.card-badge {
  border-radius: 6px 6px 0 0;
}

/* Arrow Button Styling */
.card-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #ffc222;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.3s ease;
  flex-shrink: 0;
  align-self: end;
}

.card-arrow-btn:hover {
  background-color: #e6ad1f;
  transform: scale(1.1);
  text-decoration: none;
}

.card-title-link {
  color: #1a1a1a;
}

.card-title-link:hover {
  color: #0071bc;
}

.card-title-link .card-title {
  transition: color 0.2s ease;
}

.card-arrow-btn .arrow-icon {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -3px;
}

/* Download icon styling */
.card-arrow-btn .download-icon {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blue scroll button for resources without links */
.card-arrow-btn.card-scroll-btn {
  background-color: #0071bc;
}

.card-arrow-btn.card-scroll-btn:hover {
  background-color: #005a96;
}

.card-arrow-btn.card-scroll-btn .scroll-icon {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* White arrow icon for blue scroll button */
.card-arrow-btn.card-scroll-btn .arrow-icon {
  color: #fff;
}

/* Legacy card link styles (if still used elsewhere) */
.card-link .arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}

.card-link:hover .arrow {
  transform: translateX(3px);
}

/* ========================================
   Category Filter Panel (Multi-column with sub-items)
   ======================================== */

#category-filter-container {
  animation: fadeIn 0.3s ease-in-out;
  margin-bottom: 0 !important;
}

.category-filter-panel {
  background-color: #fff;
  border-color: #dee2e6 !important;
  border: 1px solid;
  border-top: 9px solid #ffc222 !important;
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
  border-radius: 5px;
}

#category-filter-columns ul {
  margin: 0 0 10px 0 !important;
}

#category-filter-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.category-column {
  min-width: 120px;
  max-width: 160px;
  flex: 0 0 auto;
}

.category-header {
  font-weight: 700 !important;
  font-size: 14px;
  color: #1a1a1a;
  padding: 4px 0 8px 0;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 8px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.category-header:hover {
  color: #0071bc !important;
  border-bottom-color: #0071bc !important;
}

.category-header.active {
  color: #0071bc !important;
  border-bottom: 1px solid #0071bc !important;
}

.category-sub-item {
  font-size: 13px;
  color: #333;
  padding: 4px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  padding-left: 2px !important;
}

.category-sub-item:hover {
  color: #0071bc !important;
  padding-left: 2px !important;
  border-left-color: #ffc222 !important;
}

.category-sub-item.active {
  color: #0071bc !important;
  border-left-color: #0071bc !important;
  background-color: rgba(0, 113, 188, 0.05);
  border-left: 2px solid transparent;
  padding-left: 2px !important;
}

/* Legacy button styles (kept for backwards compatibility) */
.category-filter-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-filter-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.category-filter-btn.active {
  background-color: #ffc222;
  border-color: #ffc222;
  color: #000;
  font-weight: 600;
}

.category-filter-btn.active:hover {
  background-color: #e6ad1f;
  border-color: #e6ad1f;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Table Links
   ======================================== */

.table a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}
.table tr td a {
  display: inherit !important;
}

.table a:hover {
  color: var(--primary-color);
}

#clear-all-filters-btn:hover {
  background: #1789c2 !important;
}

/* ========================================
   Pagination
   ======================================== */

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #dee2e6;
  background-color: white;
  color: #6c757d;
  font-weight: 500;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  color: #333;
}

.pagination-btn.active {
  background-color: transparent;
  border-color: #0071bc;
  color: #0071bc;
  font-weight: 600;
}

.pagination-btn.active:hover {
  background-color: rgba(0, 113, 188, 0.05);
  border-color: #0071bc;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  border: none !important;
}

.pagination-arrow {
  color: #6c757d;
  font-size: 16px;
  font-weight: 400;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  color: #6c757d;
  font-size: 14px;
}

/* ========================================
   Fixed Chatbox - Enhanced Smooth Sticky
   No Flickering, Elementor-Style Transitions
   ======================================== */
.input-group .btn {
  position: absolute !important;
}

.chatbox-sticky-wrapper {
  position: relative;
  padding-bottom: 20px;
  /* Reserve space to prevent layout shift */
  min-height: 200px;
}

.fixed-chatbox {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, #1e5a8e 0%, #0d3b5f 100%);
  border-radius: 8px;
  padding: 15px 40px 20px 40px;
  margin-top: 50px;
  margin-bottom: 10px;
  /* Remove transitions initially - will be added after initialization */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-sizing: border-box;
}

/* Smooth transitions - only applied after initialization */
.chatbox-sticky-initialized .fixed-chatbox {
  transition:
    all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.3s ease,
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* State: Sticky to bottom of viewport */
.fixed-chatbox.is-stuck-bottom {
  position: fixed;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateZ(0);
}

/* State: Reached natural position */
.fixed-chatbox.is-natural {
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateZ(0);
}

/* State: Past wrapper (detached) */
.fixed-chatbox.is-detached {
  position: absolute;
  box-shadow: none;
  transform: translateZ(0);
}

/* Prevent content shift */
.chatbox-sticky-wrapper::after {
  content: "";
  display: block;
  height: 0;
  clear: both;
}

.chatbox-inner {
  max-width: 100%;
  margin: 0 auto;
}

.chatbox-title {
  color: white;
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 10px 0;
}

.chatbox-input-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.chatbox-input-wrapper .input-group {
  position: relative;
}

.chatbox-input-wrapper .form-control {
  padding: 12px 60px 12px 20px;
  font-size: 15px;
  box-shadow: none !important;
  height: 48px;
}

.chatbox-input-wrapper .form-control:focus {
  outline: none;
  box-shadow: none !important;
}

.chatbox-send-btn {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 100 !important;
  border: none;
  flex-shrink: 0;
  pointer-events: auto !important;
}

.chatbox-send-btn svg {
  display: block !important;
  margin: 0;
  position: relative;
  left: 24%;
  transform: translateX(-50%);
  pointer-events: none;
}

.chatbox-send-btn:hover {
  background-color: #e6ad1f;
}

/* ========================================
   Search Autocomplete
   ======================================== */

.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

.search-autocomplete.active {
  display: block;
}

.autocomplete-section {
  padding: 8px 0;
}

.autocomplete-section:not(:last-child) {
  border-bottom: 1px solid #e9ecef;
}

.autocomplete-section-title {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6c757d;
  background-color: #f8f9fa;
  letter-spacing: 0.5px;
}

.autocomplete-item-wrapper {
  display: block;
  color: inherit;
}

.autocomplete-item-wrapper:hover {
  text-decoration: none;
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 14px;
  color: #333;
  border-left: 3px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}

.autocomplete-item:hover,
.autocomplete-item.active,
.autocomplete-item-wrapper:hover .autocomplete-item {
  background-color: #f8f9fa;
  border-left-color: #ffc222;
}

.autocomplete-item-title {
  font-weight: 500;
  color: #0071bc;
  margin-bottom: 2px;
  flex: 1;
}

.autocomplete-item-desc {
  font-size: 12px;
  color: #6c757d;
  margin: 0;
  flex: 1;
}

.autocomplete-item-notice {
  font-size: 12px;
  line-height: 1.5;
  color: #6c757d !important;
  margin-top: 4px;
}

.autocomplete-item-notice a:first-child {
  color: #6c757d !important;
  font-weight: 500;
}

.autocomplete-item-notice a {
  color: #0071bc;
  font-weight: 500;
}

.autocomplete-item-link {
  color: #0071bc;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
  margin-top: -2px;
}

.autocomplete-item:hover .autocomplete-item-link {
  opacity: 1;
}

.cursor-pointer {
  cursor: pointer;
}

.autocomplete-no-results {
  padding: 16px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
}

.search-highlight {
  background-color: #fff3cd;
  font-weight: 600;
  padding: 0 2px;
}

/* ========================================
   Resource Description & Notice
   ======================================== */

.resource-description {
  display: contents;
  font-size: 13px;
  line-height: 1.2 !important;
}

.resource-description a {
  color: #0071bc;
  margin-left: 3px;
}

.resource-notice-box {
  font-size: 13px;
  line-height: 1.5;
}

#resources-table .resource-notice-box {
  color: #6c757d !important;
  display: inline-block;
  margin-top: 8px;
}

.resource-notice-box a {
  color: #0071bc;
  font-weight: 500;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 991px) {
  .build-system-sidebar {
    min-height: auto;
    padding: 25px 15px;
  }
}

@media (max-width: 768px) {
  .fixed-chatbox {
    padding: 20px 15px;
    margin-top: 30px;
    margin-bottom: 20px;
  }

  .chatbox-inner {
    padding: 0;
  }

  .chatbox-title {
    font-size: 18px;
    margin-bottom: 15px;
  }

  .chatbox-input-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .chatbox-input-wrapper .form-control {
    padding: 10px 55px 10px 16px;
    font-size: 14px;
    height: 44px;
  }

  .chatbox-send-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ========================================
   Build Your System Modal
   ======================================== */

.bys-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.bys-modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 30px 35px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.bys-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.bys-modal-close:hover,
.bys-modal-close:focus,
.bys-modal-close:active {
  color: #000;
  background: none !important;
  background-color: transparent !important;
  outline: none;
  box-shadow: none;
}

.bys-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #333;
}

.bys-modal-body {
  font-size: 14px;
  color: #555;
}

.bys-modal-hint {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-top: 15px;
}

body.bys-modal-open {
  overflow: hidden;
}

/* Profile List in Load Modal */
.bys-profile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.bys-profile-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bys-profile-item:hover {
  border-color: #ffc222;
  background: #fffbf0;
}

.bys-profile-item.bys-profile-active {
  border-color: #0071bc;
  background: #f0f8ff;
}

.bys-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bys-profile-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.bys-active-badge {
  font-size: 11px;
  font-weight: 600;
  color: #0071bc;
  background: rgba(0, 113, 188, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
}

.bys-profile-stage,
.bys-profile-filters {
  font-size: 13px;
  color: #666;
  margin: 0 0 4px 0;
}

.bys-profile-filters {
  margin-bottom: 0;
}

/* Save Form Styles */
.bys-form-group {
  margin-bottom: 18px;
}

.bys-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.bys-form-input,
.bys-form-select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px !important;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.bys-form-input:focus,
.bys-form-select:focus {
  outline: none;
  border-color: #333 !important;
  box-shadow: none !important;
}

.bys-form-input::placeholder {
  color: #999;
}

input#bys-profile-name {
  border-color: #d7d7d7 !important;
}

input#bys-profile-name:hover {
  border-color: #ffc222 !important;
  opacity: 1;
}

input#bys-profile-name:focus {
  border-color: #ffc222 !important;
  border-style: solid;
}

.bys-readonly-field {
  padding: 12px 15px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  color: #555;
}

.bys-form-error {
  padding: 10px 15px;
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  color: #dc3545;
  font-size: 13px;
  margin-bottom: 15px;
}

.bys-save-btn {
  width: 100%;
  padding: 14px;
  background: #ffc222;
  border: none;
  border-radius: 6px;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bys-save-btn svg {
  flex-shrink: 0;
}

.bys-save-btn:hover {
  background: #e6ad1f;
  color: #000;
}

.bys-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bys-save-btn:disabled:hover {
  background: #ffc222 !important;
  color: #000 !important;
  opacity: 0.4;
}

/* Custom Dropdown Select (Save Profile modal) */
.bys-custom-select {
  position: relative;
  width: 100%;
}

.bys-custom-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: border-color 0.2s;
  user-select: none;
}

.bys-custom-select-toggle:hover {
  border-color: #ffc222;
}

.bys-custom-select-arrow {
  font-size: 10px;
  color: #666;
  transition: transform 0.2s;
}

.bys-custom-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 2px solid #ffc222;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.bys-custom-select-option {
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.15s;
}

.bys-custom-select-option:hover {
  background-color: #f0f0f0;
}

.bys-custom-select-option.bys-option-selected {
  background-color: #f0f0f0;
  color: #333;
  font-weight: 600;
}

.bys-custom-select-menu:has(.bys-custom-select-option:hover) .bys-custom-select-option.bys-option-selected:not(:hover) {
  background-color: transparent;
}

.bys-custom-select-option.bys-option-disabled {
  color: #aaa;
  cursor: not-allowed;
  pointer-events: none;
}

/* Toast Notification */
.bys-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.bys-toast-success {
  background: #28a745;
  color: #fff;
}

.bys-toast-error {
  background: #dc3545;
  color: #fff;
}

@media (max-width: 576px) {
  .bys-modal-content {
    padding: 25px 20px;
    margin: 10px;
  }

  .bys-profile-list {
    max-height: 300px;
  }
}

/* ========================================
   Dropdown Filter Styles (Table Header)
   ======================================== */

.dropdown-filter-wrapper {
  position: relative;
}

.dropdown-filter-btn {
  background: #fff !important;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
  text-align: left;
}

.dropdown-filter-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.dropdown-filter-btn.active,
.dropdown-filter-btn.has-filter {
  border-color: #0071bc;
  background: rgba(0, 113, 188, 0.05);
}

.filter-badge {
  background: #0071bc;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.dropdown-filter-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  max-width: 320px;
  background: white;
  border: 2px solid #ffc222;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 4px;
}

/* Position Topic dropdown to align right instead of left */
.dropdown-filter-wrapper:last-child .dropdown-filter-menu,
.dropdown-filter-wrapper:nth-child(3) .dropdown-filter-menu {
  left: auto;
  right: 0;
}

.dropdown-filter-search {
  background: #f8f9fa;
}

.dropdown-filter-search input {
  font-size: 13px;
}

.dropdown-filter-options {
  max-height: 350px;
  overflow-y: auto;
  padding: 8px 0;
}

.dropdown-filter-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-filter-options::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dropdown-filter-options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.dropdown-filter-options::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Select All Option */
.filter-select-all {
  padding: 8px 12px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 4px;
}

.filter-select-all label {
  font-weight: 600;
  color: #333;
}

.filter-select-all input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0071bc;
}

/* Main Category (Parent) */
.filter-category-group {
  margin-bottom: 4px;
}

.filter-category-parent {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-category-parent:hover {
  background: #fff8e1;
}

.filter-category-parent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0071bc;
}

.filter-category-parent label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* Sub-category (Child) */
.filter-category-children {
  padding-left: 24px;
}

.filter-category-child {
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-category-child:hover {
  background: #fff8e1;
}

.filter-category-child input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #0071bc;
}

.filter-category-child label {
  font-size: 12px;
  color: #555;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* Flat list item (no children) */
.filter-item-flat {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-item-flat:hover {
  background: #fff8e1;
}

.filter-item-flat input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0071bc;
}

.filter-item-flat label {
  font-size: 13px;
  color: #333;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* Action buttons */
.dropdown-filter-actions {
  background: #f8f9fa;
}
.dropdown-filter-cancel {
  border: 1px solid #ddd !important;
}
.dropdown-filter-cancel:hover {
  background-color: #eee !important;
  color: #000 !important;
  border-color: #999 !important;
}
.dropdown-filter-actions .btn {
  font-size: 12px;
  padding: 6px 16px;
  color: #000;
}
.dropdown-filter-actions .btn:hover {
  color: #000 !important;
}
/* Hidden state for search filtering */
.filter-hidden {
  display: none !important;
}

/* Table container min-height to allow dropdown visibility */
#browse-section .table-responsive,
#resources-table {
  min-height: 600px;
}

/* Ensure dropdown menu doesn't get cut off by table overflow */
#browse-section {
  overflow: visible !important;
}

#browse-section .table-responsive {
  overflow: visible !important;
}
