/* ==========================
   Fade In Animation
========================== */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================
   Floating Profile Image
========================== */
.hero-image img {
    animation: floatImage 5s ease-in-out infinite;
}

@keyframes floatImage {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* ==========================
   Button Hover Animation
========================== */
.btn,
.btn-outline {
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.35);
}

.btn-outline:hover {
    background: #38bdf8;
    color: #081018;
    transform: translateY(-3px);
}

/* ==========================
   Card Hover Animation
========================== */
.skill,
.card,
.project {
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill:hover,
.card:hover,
.project:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================
   Image Zoom Animation
========================== */
.project {
    overflow: hidden;
}

.project img {
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project:hover img {
    transform: scale(1.08);
}

/* ==========================
   Navbar Entrance Animation
========================== */
.navbar {
    animation: slideDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-80px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================
   Hero Text Animations
========================== */
.hero-text h3 {
    animation: fadeInUp 0.8s ease forwards 0.2s both;
}

.hero-text h1 {
    animation: leftSlide 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-text h2 {
    animation: leftSlide 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-text p {
    animation: leftSlide 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-buttons {
    animation: fadeInUp 1.6s ease forwards 0.4s both;
}

@keyframes leftSlide {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================
   Logo Glow Animation
========================== */
.logo span {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5px #38bdf8;
    }
    50% {
        text-shadow:
            0 0 15px #38bdf8,
            0 0 30px #38bdf8;
    }
    100% {
        text-shadow: 0 0 5px #38bdf8;
    }
}

/* ==========================
   Floating Background Circles
========================== */
.circle-1 {
    animation: floatOne 8s ease-in-out infinite;
}

.circle-2 {
    animation: floatTwo 10s ease-in-out infinite;
}

.circle-3 {
    animation: floatThree 7s ease-in-out infinite;
}

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

@keyframes floatTwo {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-50px);
    }
}

@keyframes floatThree {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, -30px);
    }
}

/* ==========================
   Stats Card Entrance
========================== */
.stats div {
    animation: fadeIn 0.8s ease forwards;
    animation-delay: calc(0.2s * var(--index, 1));
}

/* ==========================
   Skill Grid Item Animation
========================== */
.skill {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: calc(0.05s * var(--index, 1));
}

/* ==========================
   Service Card Animation
========================== */
.card {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: calc(0.08s * var(--index, 1));
}

/* ==========================
   Project Animation
========================== */
.project {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: calc(0.1s * var(--index, 1));
}

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

/* ==========================
   Form Input Focus Animation
========================== */
input:focus,
textarea:focus {
    animation: focusGlow 0.3s ease;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0px rgba(56, 189, 248, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    }
}

/* ==========================
   Skeleton Loading Animation
========================== */
@keyframes skeleton-loading {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: skeleton-loading 2s infinite;
    background: linear-gradient(90deg, #16213d 25%, #1e3a5f 50%, #16213d 75%);
    background-size: 1000px 100%;
}

/* ==========================
   Typing Effect Cursor
========================== */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #38bdf8;
    margin-left: 4px;
    animation: blink 0.7s infinite;
}

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

/* ==========================
   Menu Entrance/Exit
========================== */
@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menuSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.nav-links.active {
    animation: menuSlideIn 0.3s ease;
}

/* ==========================
   Bounce Animation (for CTAs)
========================== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.btn-bounce {
    animation: bounce 2s infinite;
}

/* ==========================
   Pulse Animation (for notifications)
========================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================
   Success Animation
========================== */
@keyframes successCheck {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.success-icon {
    animation: successCheck 0.6s ease;
}

/* ==========================
   Reduced Motion Preferences
========================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
