/**
 * FileToAI - Enhanced Animations & Effects
 * Additional visual enhancements for demo features
 */

/* ===== SMOOTH TRANSITIONS ===== */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PRODUCT CARD ANIMATIONS ===== */
.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }

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

/* ===== DEMO BUTTON PULSE ===== */
.btn-demo {
    position: relative;
    overflow: hidden;
}

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

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

/* ===== MODAL ANIMATIONS ===== */
.demo-modal.active .demo-modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== GALLERY NAVIGATION HOVER ===== */
.gallery-nav {
    position: relative;
}

.gallery-nav::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.2;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.gallery-nav:hover::after {
    width: 100%;
    height: 100%;
}

/* ===== THUMBNAIL ANIMATIONS ===== */
.gallery-thumbnail {
    position: relative;
    overflow: hidden;
}

.gallery-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-thumbnail:hover::before {
    opacity: 1;
}

.gallery-thumbnail.active::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== IMAGE LOADING EFFECT ===== */
.gallery-main img {
    animation: imageZoomIn 0.5s ease-out;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== DEMO CARD HOVER EFFECTS ===== */
.demo-card {
    position: relative;
    overflow: hidden;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(99, 102, 241, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s;
}

.demo-card:hover::before {
    left: 100%;
}

/* ===== FEATURE CARD ANIMATIONS ===== */
.demo-features li {
    animation: slideInLeft 0.4s ease-out;
    animation-fill-mode: both;
}

.demo-features li:nth-child(1) { animation-delay: 0.1s; }
.demo-features li:nth-child(2) { animation-delay: 0.15s; }
.demo-features li:nth-child(3) { animation-delay: 0.2s; }
.demo-features li:nth-child(4) { animation-delay: 0.25s; }
.demo-features li:nth-child(5) { animation-delay: 0.3s; }
.demo-features li:nth-child(6) { animation-delay: 0.35s; }

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

/* ===== CLOSE BUTTON ANIMATION ===== */
.demo-modal-close {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* ===== BADGE ANIMATIONS ===== */
.product-badge {
    animation: badgeBounce 2s ease-in-out infinite;
}

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

/* ===== SCROLL REVEAL ANIMATIONS ===== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.section-header {
    animation: fadeInScale 0.6s ease-out;
}

/* ===== BUTTON RIPPLE EFFECT ===== */
.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.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

/* ===== LOADING SPINNER FOR IMAGES ===== */
.gallery-main {
    position: relative;
}

.gallery-main::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

.gallery-main img {
    position: relative;
    z-index: 2;
}

/* ===== CAPTION SLIDE IN ===== */
.gallery-caption {
    animation: slideUp 0.4s ease-out 0.3s both;
}

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

/* ===== HOVER GLOW EFFECT ===== */
.btn-primary {
    position: relative;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}

.btn-primary:hover::before {
    opacity: 1;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
html {
    scroll-behavior: smooth;
}

/* ===== PARALLAX EFFECT FOR HERO ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ===== STAGGER ANIMATION FOR GRID ITEMS ===== */
.products-grid > * {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.demo-grid > * {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.demo-grid > *:nth-child(1) { animation-delay: 0.1s; }
.demo-grid > *:nth-child(2) { animation-delay: 0.2s; }
.demo-grid > *:nth-child(3) { animation-delay: 0.3s; }
