/* Custom Overrides & Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}

/* Hide scrollbar for clean UI but allow scroll */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@keyframes slideIn { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}
.animate-slideIn {
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Checkbox Uiverse wicked-catfish-29 */
.checkbox-wrapper-46 input[type="checkbox"] {
  display: none;
  visibility: hidden;
}

.checkbox-wrapper-46 .cbx {
  margin: auto;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
.checkbox-wrapper-46 .cbx span {
  display: inline-block;
  vertical-align: middle;
  transform: translate3d(0, 0, 0);
}
.checkbox-wrapper-46 .cbx span:first-child {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  transform: scale(1);
  vertical-align: middle;
  border: 1px solid #9098A9;
  transition: all 0.2s ease;
}
.checkbox-wrapper-46 .cbx span:first-child svg {
  position: absolute;
  top: 3px;
  left: 2px;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16px;
  stroke-dashoffset: 16px;
  transition: all 0.3s ease;
  transition-delay: 0.1s;
  transform: translate3d(0, 0, 0);
}
.checkbox-wrapper-46 .cbx span:first-child:before {
  content: "";
  width: 100%;
  height: 100%;
  background: #506EEC;
  display: block;
  transform: scale(0);
  opacity: 1;
  border-radius: 50%;
}
.checkbox-wrapper-46 .cbx span:last-child {
  padding-left: 8px;
}
.checkbox-wrapper-46 .cbx:hover span:first-child {
  border-color: #506EEC;
}

.checkbox-wrapper-46 .inp-cbx:checked + .cbx span:first-child {
  background: #506EEC;
  border-color: #506EEC;
  animation: wave-46 0.4s ease;
}
.checkbox-wrapper-46 .inp-cbx:checked + .cbx span:first-child svg {
  stroke-dashoffset: 0;
}
.checkbox-wrapper-46 .inp-cbx:checked + .cbx span:first-child:before {
  transform: scale(3.5);
  opacity: 0;
  transition: all 0.6s ease;
}

@keyframes wave-46 {
  50% {
    transform: scale(0.9);
  }
}

/* Custom Menu Uiverse soft-falcon-79 */
.menu-falcon {
  padding: 0.5rem;
  background-color: transparent;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.menu-falcon .link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 46px;
  border-radius: 8px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  transform-origin: center left;
  transition: width 0.2s ease-in;
  text-decoration: none;
  color: #64748b; /* slate-500 */
  margin: 0 0.125rem;
}

.menu-falcon .link:before {
  position: absolute;
  z-index: -1;
  content: "";
  display: block;
  border-radius: 8px;
  width: 100%;
  height: 100%;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.2s ease-in;
  transform-origin: center right;
  background-color: #eff6ff; /* brand-50 */
}

.menu-falcon .link:hover,
.menu-falcon .link:focus,
.menu-falcon .link.active {
  outline: 0;
  width: 170px;
  color: #3b82f6; /* brand-500 */
}

.menu-falcon .link:hover:before,
.menu-falcon .link:focus:before,
.menu-falcon .link.active:before {
  transform: translateX(0);
}

.menu-falcon .link:hover .link-title,
.menu-falcon .link:focus .link-title,
.menu-falcon .link.active .link-title {
  transform: translateX(0);
  opacity: 1;
}

.menu-falcon .link-icon {
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  left: 18px; /* (60 - 24) / 2 = 18 */
  position: absolute;
}
.menu-falcon .link-icon svg,
.menu-falcon .link-icon i {
  width: 24px;
  height: 24px;
}

.menu-falcon .link-title {
  transform: translateX(100%);
  transition: transform 0.2s ease-in;
  transform-origin: center right;
  display: block;
  text-align: left;
  padding-left: 52px;
  width: 100%;
  opacity: 0;
  font-weight: 500;
  font-size: 0.875rem; /* 14px */
  white-space: nowrap;
}

/* Custom Modal Uiverse stupid-mole-90 */
.modal-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  background: transparent;
  padding: 5px;
}

.modal-bg {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  z-index: 2;
  background: rgba(255, 255, 255, var(--modal-glass-opacity, 0.85));
  backdrop-filter: blur(24px);
  border-radius: 12px;
  outline: 2px solid white;
}

.modal-card > .relative.z-10 {
  border-radius: 12px;
  overflow: hidden;
}

.modal-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 25% 25%, var(--modal-blob-color, #3b82f6) 0%, transparent 40%);
  transform-origin: center;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: blob-spin var(--modal-blob-speed, 8s) infinite linear;
  filter: blur(var(--modal-blob-blur, 24px));
  z-index: 1;
}

@keyframes blob-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animated X Close Button */
@keyframes draw-1 {
  0% { transform: rotate(0deg) scaleX(0); opacity: 0; }
  100% { transform: rotate(45deg) scaleX(1); opacity: 1; }
}

@keyframes draw-2 {
  0% { transform: rotate(0deg) scaleX(0); opacity: 0; }
  100% { transform: rotate(-45deg) scaleX(1); opacity: 1; }
}

.animate-draw-x-1 {
  animation: draw-1 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-draw-x-2 {
  animation: draw-2 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

/* ──────────────────────────────────────────────
   BMS Tab System (Level 1 & Level 2)
   Explicit CSS to override Bootstrap conflicts
   ────────────────────────────────────────────── */

/* Level 1: Primary tab container (pill-bar) */
.bms-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9; /* slate-100 */
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
  border: 1px solid #e2e8f0; /* slate-200 */
  overflow-x: auto;
  white-space: nowrap;
}
.bms-tabs::-webkit-scrollbar { display: none; }
.bms-tabs { -ms-overflow-style: none; scrollbar-width: none; }

/* Level 1: Tab buttons */
.bms-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b; /* slate-500 */
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1.5;
  outline: none;
}
.bms-tab:hover {
  color: #1e293b; /* slate-800 */
}
.bms-tab.active,
.bms-tab[aria-selected="true"] {
  color: var(--brand-500, #3b82f6);
  border-bottom-color: var(--brand-500, #3b82f6);
}
.bms-tab i,
.bms-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Level 2: Sub-tab container (underline bar) */
.bms-subtabs {
  display: flex;
  gap: 24px;
  padding: 12px 20px 0 20px;
  border-bottom: 1px solid #e2e8f0; /* slate-200 */
  background: #f8fafc; /* slate-50 */
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 1.5rem;
}
.bms-subtabs::-webkit-scrollbar { display: none; }
.bms-subtabs { -ms-overflow-style: none; scrollbar-width: none; }

/* Level 2: Sub-tab buttons */
.bms-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 12px 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b; /* slate-500 */
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1.5;
  outline: none;
}
.bms-subtab:hover {
  color: #1e293b; /* slate-800 */
}
.bms-subtab.active,
.bms-subtab[aria-selected="true"] {
  color: var(--brand-500, #3b82f6);
  border-bottom-color: var(--brand-500, #3b82f6);
}
.bms-subtab i,
.bms-subtab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* BMS Action Buttons */
.bms-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
  line-height: 1.5;
}
.bms-btn-primary {
  background: var(--brand-600, #2563eb);
  color: #fff;
  border-color: var(--brand-600, #2563eb);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}
.bms-btn-primary:hover {
  background: var(--brand-500, #3b82f6);
  border-color: var(--brand-500, #3b82f6);
  color: #fff;
}
.bms-btn-secondary {
  background: #fff;
  color: #475569; /* slate-600 */
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.bms-btn-secondary:hover {
  background: #f8fafc;
  color: #334155;
}

/* ──────────────────────────────────────────────
   Mobile Menu Panel
   ────────────────────────────────────────────── */
.mobile-menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  z-index: 50;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}
.mobile-menu-panel.open {
  display: block;
  max-height: 500px;
  opacity: 1;
}

/* Mobile Menu Items */
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569; /* slate-600 */
  text-decoration: none !important;
  transition: all 0.15s ease;
}
.mobile-menu-item:hover {
  background: #f8fafc;
  color: var(--brand-500, #3b82f6);
}
.mobile-menu-item.active {
  background: var(--brand-50, #eff6ff);
  color: var(--brand-600, #2563eb);
}
.mobile-menu-item i,
.mobile-menu-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────
   Responsive BMS Tabs
   ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .bms-tabs {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .bms-tab {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }
  .bms-subtabs {
    padding: 10px 12px 0 12px;
    gap: 16px;
  }
  .bms-subtab {
    font-size: 0.8125rem;
    padding-bottom: 10px;
  }
}
