/* ===============================================
   ANIMATIONS - Advanced Motion System
   3D Cinematic Portfolio for Akib Shariar
   =============================================== */

/* === SCROLL-TRIGGERED ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === PARALLAX MOVEMENT === */
[data-parallax] {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === STAGGER ANIMATION DELAYS === */
.stagger-1 {
    animation-delay: 0.08s !important;
}

.stagger-2 {
    animation-delay: 0.16s !important;
}

.stagger-3 {
    animation-delay: 0.24s !important;
}

.stagger-4 {
    animation-delay: 0.32s !important;
}

.stagger-5 {
    animation-delay: 0.40s !important;
}

.stagger-6 {
    animation-delay: 0.48s !important;
}

.stagger-7 {
    animation-delay: 0.56s !important;
}

.stagger-8 {
    animation-delay: 0.64s !important;
}

/* === BUTTON ANIMATIONS === */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    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.5s ease, height 0.5s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* === CARD HOVER ANIMATIONS === */
.glass-card {
    will-change: transform;
}

/* Shimmer effect disabled - was causing continuous flickering
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.6s ease;
}

.glass-card:hover::before {
    left: 100%;
}
*/

/* === ICON ANIMATIONS === */
@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.skill-icon,
.edu-icon,
.exp-icon,
.info-icon {
    will-change: transform;
}

.skill-card:hover .skill-icon,
.education-card:hover .edu-icon,
.info-card:hover .info-icon {
    animation: iconFloat 1s ease-in-out infinite;
}

/* === NAVIGATION ANIMATION === */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-menu.active {
    animation: slideDown 0.3s ease-out;
}

/* === FORM ANIMATIONS === */
.form-group input:focus+.form-label,
.form-group textarea:focus+.form-label {
    transform: translateY(-24px) scale(0.85);
    color: var(--color-primary);
}

@keyframes inputGlow {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(255, 140, 66, 0.2);
    }
}

.form-group input:focus,
.form-group textarea:focus {
    animation: inputGlow 2s ease-in-out infinite;
}

/* === BACKGROUND PARTICLES (Optional) === */
@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s linear infinite;
}

/* === LOADING BUTTON STATE === */
.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loading {
    display: inline-block;
}

.btn-loading {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* === SCROLL PROGRESS INDICATOR === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--color-primary);
}

/* === HERO CONTENT ANIMATIONS === */
/* === HERO CONTENT ANIMATIONS === */
/* Standard cinematic delays - plays nicely with loader fade out */
.hero-title {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-subtitle-secondary {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-description {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-visual {
    animation: fadeIn 1.2s ease-out 0.5s both;
}

/* === PHOTO FRAME 3D EFFECTS === */
.photo-frame-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes frameRotate {

    0%,
    100% {
        transform: rotateY(0deg) rotateX(0deg);
    }

    25% {
        transform: rotateY(5deg) rotateX(2deg);
    }

    50% {
        transform: rotateY(0deg) rotateX(-2deg);
    }

    75% {
        transform: rotateY(-5deg) rotateX(2deg);
    }
}

.hero-visual:hover .photo-frame-3d {
    animation: frameRotate 6s ease-in-out infinite;
}

/* === GLOW PULSE === */
@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        filter: blur(60px);
    }

    50% {
        opacity: 0.5;
        filter: blur(80px);
    }
}

.photo-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* === SECTION REVEAL ANIMATIONS === */
.section-tag {
    animation: fadeIn 0.6s ease-out both;
}

.section-title {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.section-description {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* === REDUCE MOTION === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .custom-cursor,
    .custom-cursor-follower {
        display: none;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */
.hero-section,
.parallax-bg,
.glass-card,
[data-parallax] {
    will-change: transform;
}

/* Disable animations on mobile for performance */
@media (max-width: 768px) {
    .gradient-orb {
        animation: none;
    }

    [data-parallax] {
        transform: none !important;
    }

    .custom-cursor,
    .custom-cursor-follower {
        display: none !important;
    }
}