/* Custom Cursor */
.cursor {
    width: 10px;
    height: 10px;
    border: 2px solid #6366f1;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease;
    display: none;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.4s ease;
    display: none;
}

@media (min-width: 1024px) {
    .cursor,
    .cursor-follower {
        display: block;
    }
}

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5, #7c3aed);
}

/* Navbar Scroll Effect */
#navbar.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dark #navbar.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Navigation Active Link */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Gradient Text Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Particle Canvas */
#particleCanvas {
    width: 100%;
    height: 100%;
}

/* Skill Bar Animation */
.skill-bar {
    width: 0;
    transition: width 1.5s ease-out;
}

.skill-bar.animate {
    width: var(--target-width);
}

/* Filter Button Styles */
.filter-btn {
    background: transparent;
    color: #6b7280;
    border: 2px solid transparent;
}

.dark .filter-btn {
    color: #9ca3af;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

/* Portfolio Item Animation */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item.hide {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Testimonial Carousel */
.testimonial-container {
    position: relative;
    min-height: 350px;
}

.testimonial-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease;
    pointer-events: none;
}

.testimonial-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.testimonial-slide.prev {
    transform: translateX(-100px);
}

.testimonial-dot {
    transition: all 0.3s ease;
    cursor: pointer;
}

.testimonial-dot:hover {
    transform: scale(1.2);
}

.testimonial-dot.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    width: 30px;
    border-radius: 10px;
}

/* Social Icon Hover Effect */
.social-icon {
    position: relative;
    display: inline-block;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.social-icon:hover::before {
    opacity: 0.2;
}

/* Form Focus Effect */
input:focus,
textarea:focus {
    transform: translateY(-2px);
}

/* Loading Animation for Form Button */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success/Error Message */
.message-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.message-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Back to Top Button */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* Pulse Animation */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.pulse-ring {
    animation: pulse-ring 2s ease-out infinite;
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.dark .glow {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.7);
}

/* Text Reveal Animation */
@keyframes text-reveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    animation: text-reveal 0.8s ease-out forwards;
}

/* Parallax Effect */
.parallax {
    transition: transform 0.3s ease-out;
}

/* Image Zoom Effect */
.zoom-hover {
    overflow: hidden;
}

.zoom-hover img {
    transition: transform 0.5s ease;
}

.zoom-hover:hover img {
    transform: scale(1.1);
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Counter Animation */
.counter {
    transition: all 0.5s ease;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .testimonial-container {
        min-height: 400px;
    }
    
    .cursor,
    .cursor-follower {
        display: none !important;
    }
}

/* Performance Optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    image-rendering: -webkit-optimize-contrast;
}

/* Dark Mode Transition */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 300ms;
    transition-timing-function: ease-in-out;
}

/* Prevent transition on page load */
.preload * {
    transition: none !important;
}
