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

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

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

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

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

/* Glass utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loaders & Controls */
.loader {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-left-color: #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

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

/* Slider styling */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #3b82f6;
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 2px;
}

.dark input[type=range]::-webkit-slider-runnable-track {
    background: #475569;
}

/* --- Directional Hover Button Styles --- */
.btn-directional {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    /* Creates stacking context */
    transition: transform 0.1s ease;
}

.btn-directional:active {
    transform: scale(0.98);
}

/* Pseudo-element acting as the "curtain" */
.btn-directional::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: var(--transform-from, scale(0));
    transform-origin: var(--origin, center);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    border-radius: inherit;
}

/* Hover state: Always full scale */
.btn-directional:hover::before {
    transform: scale(1, 1);
}

/* Colors for Main Analyze Button */
#fetchBtn.btn-directional::before {
    background: #0f172a;
    /* Very dark slate */
}

/* Colors for Secondary Buttons (White/Dark ones) */
button.btn-directional:not(#fetchBtn)::before {
    background: #3b82f6;
    /* Bright Blue */
}

/* Text color transitions */
button.btn-directional:not(#fetchBtn):hover span,
button.btn-directional:not(#fetchBtn):hover svg {
    color: white;
    transition-delay: 0.05s;
}

button.btn-directional:not(#fetchBtn) span,
button.btn-directional:not(#fetchBtn) svg {
    transition: color 0.2s ease;
}