/* Interactive Features & Animations */

/* Case Study Side Sheet Styling */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 50vw;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-content {
    transform: translateX(0);
}

/* Mobile: Full width */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100vw;
    }
}

/* Smooth scrollbar for sheet */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #F8F9FC;
}

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

/* Hero mockup 3D tilt effect */
#heroMockup {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

#heroMockup > * {
    transform: translateZ(20px);
}

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

.scroll-reveal.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.scroll-reveal.animate-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger 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; }

/* Interactive button effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

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

.btn-primary:active::before {
    width: 300px;
    height: 300px;
}

/* Parallax effect for hero background */
.parallax-bg {
    transition: transform 0.3s ease-out;
}

/* Cursor follow effect for cards */
.card-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Navigation active state */
.nav-link-active {
    background-color: white;
    color: #1E293B;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 4%, #e0e0e0 25%, #f0f0f0 36%);
    background-size: 1000px 100%;
}

/* Tooltip styling */
.tooltip {
    position: absolute;
    background: #1E293B;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
}

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

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

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

/* Skill badge pulse */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(61, 92, 245, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(61, 92, 245, 0);
    }
}

.badge-pulse {
    animation: pulse-glow 2s infinite;
}

/* Typewriter effect */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid #3d5cf5;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}
