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

::-webkit-scrollbar-track {
    background: #0f172a;
}

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

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

/* Glassmorphism Utilities */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animated Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: #334155;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #8b5cf6;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    margin-top: -6px;
    border: 2px solid #1e293b;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #a78bfa;
    transform: scale(1.1);
}

/* Style Tag Active State */
.style-tag.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    color: #a78bfa;
}

/* Loading Animation */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.loading-ring {
    position: relative;
}

.loading-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #8b5cf6;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Card Hover Effects */
.sample-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sample-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.1), 0 8px 10px -6px rgba(139, 92, 246, 0.1);
}

.sample-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Video Container Aspect Ratio */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Obscurity Meter */
.obscurity-bar {
    background: linear-gradient(90deg, #22d3ee 0%, #8b5cf6 50%, #f472b6 100%);
    height: 4px;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.obscurity-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Selection Animation */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar for horizontal scroll areas */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
}

/* Custom Checkbox */
.custom-checkbox {
    appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #475569;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox:checked {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* List View Styles */
.list-view .sample-card {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.list-view .sample-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.list-view .sample-content {
    flex: 1;
    padding: 1.5rem;
}

/* Audio Wave Animation */
.wave-bar {
    display: inline-block;
    width: 3px;
    height: 20px;
    background: #8b5cf6;
    margin: 0 2px;
    animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}