/* Custom Font */
* {
    font-family: 'Inter', sans-serif;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

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

/* Custom Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-fade-in-up {
    animation: fade-in-up 1s ease-out;
}

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

.floating-element:nth-child(2) {
    animation-delay: -1s;
}

.floating-element:nth-child(3) {
    animation-delay: -2s;
}

/* Navigation Active State */
.nav-link.active {
    color: #ffffff !important;
}

/* Skill Bars Animation */
.skill-progress {
    width: 0%;
    transition: width 1.5s ease-out;
}

.skill-item.animate .skill-progress {
    width: var(--skill-width);
}

/* Project Cards Hover Effects */
.project-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::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.5s ease;
}

.project-card:hover::before {
    left: 100%;
}

/* Form Focus Effects */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Hover Effects */
.btn-primary {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

.btn-primary:hover {
    animation-duration: 1s;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .floating-element {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* Typing Animation */
.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Section Reveal Animation */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Grid Animation */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.stagger-animation.animate > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.animate > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.animate > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.animate > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.animate > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animation.animate > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-animation.animate > * {
    opacity: 1;
    transform: translateY(0);
}

/* Glowing Border Effect */
.glow-border {
    position: relative;
    background: linear-gradient(45deg, #1f2937, #374151);
    border: 1px solid transparent;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-border:hover::before {
    opacity: 1;
}

/* Particle Background */
.particle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    animation: particle-float 6s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Loading Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #60a5fa;
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out both infinite;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Text Gradient Animation */
.text-gradient {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-text 3s ease infinite;
}

@keyframes gradient-text {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Magnetic Effect for Buttons */
.magnetic-btn {
    transition: transform 0.2s ease;
}

.magnetic-btn:hover {
    transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* Code Block Styling */
.code-block {
    position: relative;
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    overflow: hidden;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    border-radius: 12px 12px 0 0;
}

/* Intersection Observer Fade In */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}

/* Highlight Box */
.highlight-box {
    position: relative;
    padding: 2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
}

.highlight-box-content {
    background: #1f2937;
    border-radius: 10px;
    padding: 20px;
}

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Dark Mode Optimizations */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
