/* ── Base font ── */
body {
  font-family: "DM Sans", system-ui, sans-serif;
}

/* ── Left sidebar: fading right-edge divider ── */
#mobileSidebar {
  transition: width 0.25s ease;
  border-right: 1px solid #8080801a;
}

#mobileSidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(156, 163, 175, 0.25) 20%, rgba(156, 163, 175, 0.25) 80%, transparent 100%);
  pointer-events: none;
}

/* ── Sidebar tooltip (visible only when collapsed on desktop) ── */
.sidebar-tip {
  display: none;
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #e5e7eb;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.sidebar-tip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #111827;
}

#mobileSidebar[data-collapsed="true"] .sidebar-link:hover .sidebar-tip {
  display: block;
}

[data-theme="light"] .sidebar-tip {
  background: #1E2B3C;
  color: #f4f3ea;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar-tip::before {
  border-right-color: #1E2B3C;
}

/* ── Light theme (default) ── */
[data-theme="light"] body {
  background-color: #F4F3EA !important;
  color: #333D51 !important;
}

[data-theme="light"] .bg-dark {
  background-color: #FFFFFF !important;
}

[data-theme="light"] .bg-darker {
  background-color: #ffffff !important;
}

[data-theme="light"] .bg-gray-900 {
  background-color: #ffffff !important;
}

[data-theme="light"] .bg-gray-800 {
  background-color: #E8E4DA !important;
}

[data-theme="light"] .bg-gray-700 {
  background-color: #DDD9CF !important;
}

[data-theme="light"] .text-gray-100,
[data-theme="light"] .text-gray-200,
[data-theme="light"] .text-white {
  color: #1E2B3C !important;
}

[data-theme="light"] .text-gray-300 {
  color: #3D4B60 !important;
}

[data-theme="light"] .text-gray-400 {
  color: #687080 !important;
}

[data-theme="light"] .text-gray-500 {
  color: #8a93a0 !important;
}

[data-theme="light"] .border-gray-800 {
  border-color: #CBD0D847 !important;
}

[data-theme="light"] .border-white {
  border-color: #ffffff !important;
}

[data-theme="light"] .border-gray-700 {
  border-color: #D5D1C8 !important;
}

[data-theme="light"] #preloader {
  background: #F4F3EA !important;
}

[data-theme="light"] .text-gray-300\/90 {
  color: #3D4B60 !important;
}

[data-theme="light"] .text-blue-100\/90 {
  color: #3D4B60 !important;
}

[data-theme="light"] .text-white\/80 {
  color: #333D51 !important;
}

@keyframes flash-highlight-border {
  0% {
    box-shadow: 0 0 0 0px rgba(255, 215, 0, 0.9),
      0 0 0 0px rgba(255, 215, 0, 0.7) inset;
    border: 2px solid rgba(255, 215, 0, 0.9);
    transform: scale(1);
    filter: brightness(100%);
  }

  25% {
    box-shadow: 0 0 15px 8px rgba(255, 215, 0, 0.7),
      0 0 10px 4px rgba(255, 215, 0, 0.5) inset;
    transform: scale(1.03);
    filter: brightness(120%);
  }

  50% {
    box-shadow: 0 0 20px 12px rgba(255, 215, 0, 0.5),
      0 0 15px 6px rgba(255, 215, 0, 0.3) inset;
    transform: scale(1.01);
  }

  75% {
    box-shadow: 0 0 10px 6px rgba(255, 215, 0, 0.3),
      0 0 5px 3px rgba(255, 215, 0, 0.2) inset;
    filter: brightness(110%);
  }

  100% {
    box-shadow: none;
    border: 2px solid transparent;
    transform: scale(1);
    filter: brightness(100%);
  }
}

.flash-once {
  animation: flash-highlight-border 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  padding: 6px;
  background-clip: padding-box;
  will-change: transform, box-shadow, filter;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.flash-once::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: rgba(255, 215, 0, 0.8);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: particle-float 1s ease-out forwards;
}

@keyframes particle-float {
  0% {
    transform: translate(-50%, 0) scale(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -40px) scale(1.5);
    opacity: 0;
  }
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #010203;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

body.loading {
  overflow: hidden;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top: 4px solid #c4ad2bff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* Toast animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-out forwards;
}

.animate-progress {
  animation: progress 10s linear forwards;
}