/*
    Custom CSS for Omar Abd Al-Aziz's Portfolio Website
    ---------------------------------------------------
    This file adds custom styling and animations
    on top of Tailwind CSS for a professional feel.
*/

/* --- Keyframe Animations --- */

/* Fade In animation for section titles and static content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up animation for cards and blocks */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Slide from Right animation for elements on the left */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Slide from Left animation for elements on the right */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Floating animation for decorative elements */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Pulse animation for highlights */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* --- Base Styles & Transitions --- */

/* Global scroll behavior for smooth navigation */
html {
    scroll-behavior: smooth;
}

/* Mobile Menu Transitions */
#mobile-menu ul {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu ul:not(.hidden) {
    max-height: 300px;
}

/* Animate the header on scroll for a sticky effect */
body.scrolled #main-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Interactivity & Animations on Scroll --- */

/* Initial state for all elements that will be animated */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* The state that triggers the animation */
[data-animate].animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Specific animations for different data attributes */
[data-animate="fade-in"].animate-visible {
    animation: fadeIn 1s ease-out forwards;
    transform: none;
}

[data-animate="slide-up"].animate-visible {
    animation: slideUp 0.8s ease-out forwards;
}

[data-animate="slide-right"].animate-visible {
    animation: slideRight 0.8s ease-out forwards;
}

[data-animate="slide-left"].animate-visible {
    animation: slideLeft 0.8s ease-out forwards;
}

/* Staggered animations for a smoother visual flow */
[data-animate="slide-up"]:nth-child(1) { transition-delay: 0.1s; }
[data-animate="slide-up"]:nth-child(2) { transition-delay: 0.2s; }
[data-animate="slide-up"]:nth-child(3) { transition-delay: 0.3s; }
[data-animate="slide-up"]:nth-child(4) { transition-delay: 0.4s; }
[data-animate="slide-up"]:nth-child(5) { transition-delay: 0.5s; }
[data-animate="slide-up"]:nth-child(6) { transition-delay: 0.6s; }

/* Custom input field styles for a clean look */
form input,
form textarea {
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease-in-out;
}
form input:focus,
form textarea:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: none;
}
