/* Custom styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Enhanced Dithering Background Effect */
.dithered-background {
    background-color: #1a1a1a;
    position: relative;
}

.dither-layer-1 {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 80% 25%, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 8px 8px, 12px 12px;
    animation: ditherShift 8s ease-in-out infinite;
    opacity: 0.4;
}

.dither-layer-2 {
    background-image: 
        radial-gradient(circle at 60% 30%, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 6px 6px, 10px 10px;
    animation: ditherShift 12s ease-in-out infinite reverse;
    opacity: 0.3;
}

.dither-layer-3 {
    background-image: 
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 4px 4px, 14px 14px;
    animation: ditherPulse 6s ease-in-out infinite;
    opacity: 0.5;
}

/* Dithering Animations */
@keyframes ditherShift {
    0%, 100% { 
        background-position: 0 0, 3px 3px;
        opacity: 0.3;
    }
    50% { 
        background-position: 4px 4px, -2px 7px;
        opacity: 0.6;
    }
}

@keyframes ditherPulse {
    0%, 100% { 
        opacity: 0.2;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.02);
    }
}

@keyframes subtleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .dither-layer-1,
    .dither-layer-2,
    .dither-layer-3 {
        animation: none;
    }
    
    .animate-subtle-float {
        animation: none;
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Enhanced focus states */
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

/* Form field animations */
.form-field {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-field:focus-within {
    transform: translateY(-1px);
}

/* Button hover effects */
button {
    position: relative;
    overflow: hidden;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

button:hover:before {
    left: 100%;
}

/* Enhanced neon glow effect for Subscribe button */
.neon-glow {
    box-shadow: 
        0 0 20px rgba(204, 255, 0, 0.3),
        0 0 40px rgba(204, 255, 0, 0.1),
        inset 0 0 20px rgba(204, 255, 0, 0.1);
}

.neon-glow:hover {
    box-shadow: 
        0 0 30px rgba(204, 255, 0, 0.5),
        0 0 60px rgba(204, 255, 0, 0.2),
        inset 0 0 30px rgba(204, 255, 0, 0.15);
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dark mode scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

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

/* Backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(10px);
    }
    .backdrop-blur-lg {
        backdrop-filter: blur(16px);
    }
}

/* Pulse animation for errors */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced card styling for better integration */
.bg-dark-secondary\/60 {
    background-color: rgba(42, 42, 42, 0.6);
}

.border-gray-600\/30 {
    border-color: rgba(75, 85, 99, 0.3);
}

/* Performance optimizations */
* {
    transition: all 0.2s ease-in-out;
}

/* Ensure proper layering and performance */
.relative.z-10 {
    position: relative;
    z-index: 10;
}

.fixed.inset-0.z-0 {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
}