/* ============================================
   MSTF Graphics Portfolio - Animation Styles
   ============================================ */

/* ============================================
   BASE ANIMATION CLASSES
   ============================================ */

/* Fade Up Animation */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade Right Animation */
.animate-fade-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Fade Left Animation */
.animate-fade-left {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-left.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale Up Animation */
.animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-scale.animated {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   ANIMATION DELAYS
   ============================================ */

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Bounce Animation for Scroll Indicator */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-15px);
    }
    60% {
        transform: translateX(-50%) translateY(-7px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(218, 114, 0, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(218, 114, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(218, 114, 0, 0);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

/* Service Card Hover */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.service-card:hover .service-icon {
    animation: pulse 1s ease infinite;
}

/* Portfolio Item Hover */
.portfolio-item {
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-img img {
    transition: transform 0.5s ease;
}

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

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Social Link Hover */
.social-link {
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   COUNTER ANIMATION STYLES
   ============================================ */

.stat-number {
    display: inline-block;
}

.stat-number.counting {
    animation: none;
}

/* ============================================
   LIGHTBOX ANIMATIONS
   ============================================ */

.lightbox {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active .lightbox-content {
    animation: scaleIn 0.3s ease forwards;
}

.lightbox-close {
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
}

/* ============================================
   HEADER SCROLL ANIMATION
   ============================================ */

.header {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
    background: var(--secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Animation */
.nav {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav.active {
    transform: translateX(0);
}

/* Hamburger Animation */
.hamburger span {
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   BACK TO TOP ANIMATION
   ============================================ */

.back-to-top {
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ============================================
   PORTFOLIO FILTER ANIMATION
   ============================================ */

.portfolio-item {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.portfolio-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.portfolio-item:not(.hidden) {
    position: relative;
    opacity: 1;
    transform: scale(1);
}

/* Filter Button Animation */
.filter-btn {
    transition: all 0.3s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
}

.filter-btn.active {
    transform: scale(1.05);
}

/* ============================================
   HERO SECTION ANIMATIONS
   ============================================ */

.hero-content .hero-title,
.hero-content .hero-subtitle,
.hero-content .hero-buttons {
    animation: fadeIn 1s ease forwards;
}

.hero-content .hero-title {
    animation-delay: 0.2s;
}

.hero-content .hero-subtitle {
    animation-delay: 0.4s;
}

.hero-content .hero-buttons {
    animation-delay: 0.6s;
}

/* ============================================
   LOADING ANIMATION (Optional)
   ============================================ */

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ============================================
   STAGGER ANIMATION FOR GRID ITEMS
   ============================================ */

.services-grid .service-card:nth-child(1) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.15s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.25s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.3s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.35s; }

.portfolio-grid .portfolio-item:nth-child(1) { transition-delay: 0.05s; }
.portfolio-grid .portfolio-item:nth-child(2) { transition-delay: 0.1s; }
.portfolio-grid .portfolio-item:nth-child(3) { transition-delay: 0.15s; }
.portfolio-grid .portfolio-item:nth-child(4) { transition-delay: 0.2s; }
.portfolio-grid .portfolio-item:nth-child(5) { transition-delay: 0.25s; }
.portfolio-grid .portfolio-item:nth-child(6) { transition-delay: 0.3s; }
.portfolio-grid .portfolio-item:nth-child(7) { transition-delay: 0.35s; }
.portfolio-grid .portfolio-item:nth-child(8) { transition-delay: 0.4s; }
.portfolio-grid .portfolio-item:nth-child(9) { transition-delay: 0.45s; }

/* ============================================
   ABOUT SECTION ANIMATIONS
   ============================================ */

.about-badge {
    animation: float 3s ease-in-out infinite;
}

.about-stats .stat-item {
    transition: transform 0.3s ease;
}

.about-stats .stat-item:hover {
    transform: scale(1.1);
}

/* ============================================
   CONTACT SECTION ANIMATIONS
   ============================================ */

.contact-item {
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateX(10px);
}

.contact-icon {
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background: var(--primary);
}

.contact-item:hover .contact-icon i {
    color: var(--text-light);
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-fade-up,
    .animate-fade-right,
    .animate-fade-left,
    .animate-scale {
        opacity: 1;
        transform: none;
    }
}
