/* Custom Styles for Portfolio */

/* Reset default margins and padding */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

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

/* Gradient text effect */
.text-gradient {
    background: linear-gradient(90deg, #7B68EE, #22D3EE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Rotating gradient animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gradient-spin {
    animation: spin 3s linear infinite;
}

/* Tools infinite scroll animation */
.tools-scroll-container {
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
}

.tools-scroll-track {
    animation: tools-scroll 30s linear infinite;
    will-change: transform;
}

.tools-scroll-track:hover {
    animation-play-state: paused;
}

@keyframes tools-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100% / 3));
    }
}

/* Custom scrollbar styling (Chrome/Safari/Edge) */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Additional hover effects for cards */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.card-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Performance optimization for animated elements */
.scroll-reveal,
.btn-primary,
[class*="hover:scale"],
[class*="hover:shadow"],
.modal-content {
    will-change: transform, opacity;
}

/* Hero section fading grid background */
.hero-grid-bg {
    background-image: linear-gradient(to right, #e2e8f0 1px, transparent 1px), 
                      linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
    background-size: 20px 30px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%);
    will-change: transform;
}

/* 3D transform for hero mockup */
.preserve-3d {
    transform-style: preserve-3d;
}

/* Profile picture rotating gradient background */
.profile-gradient-bg {
    background: conic-gradient(from 0deg, #3d5cf5, #22D3EE, #F472B6, #3d5cf5);
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Staggered animation delays */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

/* Flip Button Animation */
.btn-primary {
    position: relative;
    overflow: hidden;
    perspective: 1000px;
    will-change: transform;
}

.btn-primary .btn-front,
.btn-primary .btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.btn-primary .btn-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateX(-90deg);
    transform-origin: center bottom;
}

.btn-primary .btn-front {
    transform-origin: center top;
}

.btn-primary:hover .btn-front {
    transform: rotateX(90deg);
}

.btn-primary:hover .btn-back {
    transform: rotateX(0deg);
}

/* Line Tracker Canvas */
#line-tracker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
}
