/* ============================================
   SIMPLIFIED GLOBAL SCROLLBAR - Theme-Dependent
   ============================================ */

/* Hide main body scrollbar only */
body::-webkit-scrollbar {
  width: 0;
  display: none;
}

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Custom Scrollbar Track */
.simple-scrollbar {
  position: fixed;
  top: 0;
  right: 12px;
  width: 10px;
  height: 100vh;
  background: var(--bg-secondary);
  border-radius: 5px;
  z-index: 9999;
  opacity: 0.7;
  transition: opacity 0.3s ease, width 0.2s ease;
  pointer-events: auto;
}

.simple-scrollbar:hover {
  opacity: 1;
  width: 14px;
}

.simple-scrollbar.dragging {
  opacity: 1;
  width: 14px;
}

/* Custom Scrollbar Thumb */
.simple-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, 
    var(--accent-primary) 0%,
    var(--accent-secondary) 50%,
    var(--accent-tertiary) 100%
  );
  border-radius: 5px;
  cursor: grab;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
  will-change: transform;
}

.simple-scrollbar-thumb:active,
.simple-scrollbar.dragging .simple-scrollbar-thumb {
  cursor: grabbing;
  transition: none;
}

.simple-scrollbar-thumb:hover,
.simple-scrollbar.dragging .simple-scrollbar-thumb {
  background: linear-gradient(180deg, 
    var(--accent-secondary) 0%,
    var(--accent-tertiary) 50%,
    var(--accent-primary) 100%
  );
  box-shadow: 0 0 12px var(--glow-color);
}

/* Styled scrollbars for modals and nested containers */
*:not(body)::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*:not(body)::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

*:not(body)::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    var(--accent-primary) 0%,
    var(--accent-secondary) 50%,
    var(--accent-tertiary) 100%
  );
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

*:not(body)::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    var(--accent-secondary) 0%,
    var(--accent-primary) 50%,
    var(--accent-tertiary) 100%
  );
  box-shadow: 0 0 8px var(--glow-color);
}

/* Firefox scrollbar for nested containers */
*:not(html) {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .simple-scrollbar {
    right: 8px;
    width: 8px;
  }
  
  .simple-scrollbar:hover {
    width: 10px;
  }
}
