/* Custom Tailwind Configuration and Additional Styles */

/* Custom animations */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes purpleGlow {
    0% {
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.4), 0 0 40px rgba(147, 51, 234, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(147, 51, 234, 0.6), 0 0 60px rgba(147, 51, 234, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.4), 0 0 40px rgba(147, 51, 234, 0.2);
    }
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 20px rgba(147, 51, 234, 0.5), 0 0 40px rgba(139, 92, 246, 0.3);
    }
    50% {
        text-shadow: 0 0 30px rgba(147, 51, 234, 0.7), 0 0 60px rgba(139, 92, 246, 0.5);
    }
    100% {
        text-shadow: 0 0 20px rgba(147, 51, 234, 0.5), 0 0 40px rgba(139, 92, 246, 0.3);
    }
}

@keyframes backgroundPulse {
    0%, 100% {
        background-color: rgba(147, 51, 234, 0.1);
    }
    50% {
        background-color: rgba(147, 51, 234, 0.2);
    }
}

/* Cursor blink animation */
@keyframes blink-caret {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* Custom utility classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-purple-glow {
    animation: purpleGlow 3s ease-in-out infinite;
}

.animate-title-glow {
    animation: titleGlow 4s ease-in-out infinite;
}

.animate-background-pulse {
    animation: backgroundPulse 4s ease-in-out infinite;
}

/* Removed the old typewriter implementation */

/* Tech icons */
.tech-icon {
    transition: all 0.3s ease;
}

.tech-icon:hover {
    transform: translateY(-5px);
    color: rgb(216, 180, 254);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.25);
}

/* Enhanced scrollbar with purple theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.6), rgba(139, 92, 246, 0.6));
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.8), rgba(139, 92, 246, 0.8));
}

/* Selection styling */
::selection {
    background-color: rgba(147, 51, 234, 0.3);
    color: white;
}

::-moz-selection {
    background-color: rgba(147, 51, 234, 0.3);
    color: white;
}

/* Cursor styling for typing effect */
.cursor {
    display: inline-block;
    width: 3px;
    background-color: #a855f7;
    animation: blink-caret 0.75s step-end infinite;
    margin-left: 2px;
    height: 1.2em;
    position: relative;
    top: 2px;
}

.typewriter .cursor {
    display: inline-block;
    margin-left: 2px;
    width: 2px;
    height: 1.2em;
    background-color: #a855f7;
    animation: blink-caret 0.75s step-end infinite;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Enhanced focus states */
input:focus, textarea:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
}

/* Custom gradient borders */
.gradient-border {
    position: relative;
    background: linear-gradient(45deg, rgba(147, 51, 234, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 16px;
    padding: 2px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(45deg, #9333ea, #8b5cf6, #a855f7);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
}

/* Particle effect overlay */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(147, 51, 234, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(168, 85, 247, 0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(147, 51, 234, 0.2), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(139, 92, 246, 0.3), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: float 20s linear infinite;
    opacity: 0.6;
}

/* Enhanced button hover effects */
.btn-purple-glow {
    position: relative;
    overflow: hidden;
}

.btn-purple-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-purple-glow:hover::before {
    left: 100%;
}

/* Glowing text effect */
.glow-text {
    text-shadow: 0 0 10px rgba(147, 51, 234, 0.5), 0 0 20px rgba(147, 51, 234, 0.3), 0 0 30px rgba(147, 51, 234, 0.2);
}

/* Dark theme enhancements */
body {
    background-attachment: fixed;
}

/* Improved backdrop blur for better performance */
.backdrop-blur-enhanced {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.1) 0%, rgba(147, 51, 234, 0.3) 50%, rgba(147, 51, 234, 0.1) 100%);
    background-size: 468px 100%;
    animation: shimmer 3s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animate-purple-glow {
        animation-duration: 4s;
    }

    .animate-title-glow {
        animation-duration: 5s;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .animate-purple-glow {
        animation: none;
        box-shadow: 0 0 0 2px rgba(147, 51, 234, 1);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in-up,
    .animate-float,
    .animate-purple-glow,
    .animate-title-glow,
    .animate-background-pulse {
        animation: none;
    }
}
