body {
    font-family: 'Poppins', sans-serif;
}

/* Custom scrollbar for a touch of elegance */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Smooth scroll behavior fallback for older browsers */
html {
    scroll-behavior: smooth;
}

/* Keyframe for subtle fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Keyframe for button hover effect */
@keyframes buttonHoverPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.hover-pulse:hover {
    animation: buttonHoverPulse 0.5s ease-in-out infinite;
}

/* Custom scrollbar for modals, if different from body scrollbar */
.modal-content-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-content-scroll::-webkit-scrollbar-track {
    background: #f0f4f8; /* Lighter background for modal scrollbar */
    border-radius: 10px;
}

.modal-content-scroll::-webkit-scrollbar-thumb {
    background: #93c5fd; /* A lighter blue */
    border-radius: 10px;
}

.modal-content-scroll::-webkit-scrollbar-thumb:hover {
    background: #60a5fa; /* Original blue on hover */
}

/* Prevent body scrolling when modal is open */
.overflow-hidden-body {
    overflow: hidden;
}

/* Spinner Overlay */
.loading-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's on top of everything */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; /* Added visibility */
}

.loading-spinner-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Beautiful Dot Pulse Spinner */
.spinner-dot-pulse {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #3B82F6; /* Your blue-600 color */
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); /* Subtle shadow for depth */
    animation: spinner-dot-pulse-animation 1.5s infinite linear;
}

.spinner-dot-pulse::before,
.spinner-dot-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #60A5FA; /* A lighter shade of blue */
    opacity: 0.7;
}

.spinner-dot-pulse::before {
    animation: spinner-dot-pulse-before-animation 1.5s infinite linear;
}

.spinner-dot-pulse::after {
    animation: spinner-dot-pulse-after-animation 1.5s infinite linear;
}

@keyframes spinner-dot-pulse-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes spinner-dot-pulse-before-animation {
    0% {
        transform: translateX(-20px) scale(0.7);
        opacity: 0.7;
    }
    50% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(20px) scale(0.7);
        opacity: 0.7;
    }
}

@keyframes spinner-dot-pulse-after-animation {
    0% {
        transform: translateX(20px) scale(0.7);
        opacity: 0.7;
    }
    50% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-20px) scale(0.7);
        opacity: 0.7;
    }
}

/* --- Section Intro Animation CSS --- */

/* Initial state: hidden and slightly below */
.section-animated-content {
    opacity: 0;
    transform: translateY(30px); /* Increased initial slide for more impact */
    transition: none; /* Disable immediate transitions */
}

/* Navbar initial state - slightly higher, then drops down */
.navbar-animated {
    opacity: 0;
    transform: translateY(-20px);
    transition: none;
}

/* Define the fade-in-slide-up animation */
@keyframes fade-in-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Define the fade-in-slide-down animation for navbar */
@keyframes fade-in-slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation when 'body.loaded' is present */
body.loaded .section-animated-content {
    animation: fade-in-slide-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; /* Longer duration */
}

body.loaded .navbar-animated {
    animation: fade-in-slide-down 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.1s; /* Make navbar appear first */
}

/* Staggered animation delays for sections */
body.loaded #home .section-animated-content { animation-delay: 0.3s; } /* Hero section appears first */
body.loaded #about .section-animated-content { animation-delay: 0.6s; }
body.loaded #projects .section-animated-content { animation-delay: 0.9s; }
body.loaded #contact .section-animated-content { animation-delay: 1.2s; }
/* Footer animation */
body.loaded footer .section-animated-content { animation-delay: 1.5s; }
