/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* HTMX Loading States */
/* Only disable pointer events on the specific element making the request, not the entire page */
.htmx-request {
    opacity: 0.6;
}

/* Disable pointer events only on elements that are actively loading */
.htmx-request.htmx-requesting {
    pointer-events: none;
}

/* Apply pointer-events only to the target element and its direct children during swap */
.htmx-swapping {
    opacity: 0.5;
}

/* More specific: only block the element that's being swapped, not the whole page */
[class*="htmx-request"]:not(body):not(html) {
    pointer-events: none;
}

/* Allow interaction with other elements during loading */
body.htmx-request {
    pointer-events: auto;
}

/* Loading indicators should not block interactions */
.htmx-indicator {
    pointer-events: none;
}

/* Animations */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-marquee {
    animation: marquee 30s linear infinite;
    display: flex;
    width: max-content;
}

/* Marquee with JavaScript control */
.marquee-js {
    display: flex;
    width: max-content;
    will-change: transform;
}

/* Exchange rates container */
#exchange-rates-container {
    position: relative;
    overflow: hidden;
}

#exchange-rates-container .marquee-js {
    transition: opacity 0.2s ease-in-out;
}

/* Smooth swap transition */
#exchange-rates-container.htmx-swapping .marquee-js {
    opacity: 0.7;
}

#exchange-rates-container.htmx-swapped .marquee-js {
    opacity: 1;
}

/* Selection */
::selection {
    background-color: rgba(23, 115, 207, 0.3);
}
