/* 
 * MagicHost.ro - Animations Stylesheet
 * Author: MagicHost Team
 * Version: 1.0
 */

/* ===== KEYFRAME ANIMATIONS ===== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer */
@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* ===== ANIMATION CLASSES ===== */

/* Base animation class */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s ease;
}

/* Animation types */
.fade-in {
    animation-name: fadeIn;
}

.fade-in-up {
    animation-name: fadeInUp;
}

.fade-in-down {
    animation-name: fadeInDown;
}

.slide-in-left {
    animation-name: slideInLeft;
}

.slide-in-right {
    animation-name: slideInRight;
}

.zoom-in {
    animation-name: zoomIn;
}

.bounce {
    animation-name: bounce;
}

.pulse {
    animation-name: pulse;
    animation-iteration-count: infinite;
    animation-duration: 2s;
}

.rotate {
    animation-name: rotate;
    animation-iteration-count: infinite;
    animation-duration: 10s;
    animation-timing-function: linear;
}

/* Animation states */
.animated {
    opacity: 1;
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

/* Shimmer effect for buttons and cards */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    pointer-events: none;
}

/* Hover animations */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Animated background gradient */
.animated-bg {
    background: linear-gradient(-45deg, #4f46e5, #818cf8, #10b981, #34d399);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Typing animation */
.typing-animation {
    overflow: hidden;
    border-right: 0.15em solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

/* Floating animation for images */
.float {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* App Factory Animation */
.app-factory-animation {
    position: relative;
    width: 100%;
    height: 350px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for app factory animation */
@media (max-width: 1024px) {
    .app-factory-animation {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .app-factory-animation {
        height: 250px;
        margin-bottom: 30px;
    }

    .idea-bulb, .success-trophy {
        transform: scale(0.9);
    }

    .factory-conveyor {
        width: 90%;
    }
}

@media (max-width: 576px) {
    .app-factory-animation {
        height: 250px;
    }

    .idea-bulb {
        top: 10px;
        left: 30px;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }

    .success-trophy {
        bottom: 10px;
        right: 30px;
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .factory-conveyor {
        height: 100px;
        margin: 60px auto;
        width: 95%;
    }

    .code-block, .design-tool, .web-app {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .mobile-app {
        width: 60px;
        height: 60px;
        font-size: 30px;
        z-index: 10;
    }
}

/* Idea Bulb */
.idea-bulb {
    position: absolute;
    top: 20px;
    left: 50px;
    width: 60px;
    height: 60px;
    background: #FFC107;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 30px;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.7);
    animation: pulse 2s ease-in-out infinite, floatBulb 5s ease-in-out infinite;
    z-index: 10;
}

@keyframes floatBulb {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

/* Factory Conveyor */
.factory-conveyor {
    position: relative;
    width: 80%;
    height: 100px;
    background: linear-gradient(90deg, #e9f0ff 0%, #f6f8ff 100%);
    border-radius: 10px;
    margin: 80px auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.factory-conveyor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 20px,
        rgba(0, 0, 0, 0.05) 20px,
        rgba(0, 0, 0, 0.05) 40px
    );
    animation: conveyorMove 10s linear infinite;
}

@keyframes conveyorMove {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100px 0;
    }
}

/* Gears */
.gear {
    position: absolute;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4f46e5;
    font-size: 30px;
    z-index: 5;
}

.gear-1 {
    top: -20px;
    left: 30%;
    animation: rotateGear 8s linear infinite;
}

.gear-2 {
    bottom: -20px;
    right: 30%;
    animation: rotateGear 8s linear infinite reverse;
}

@keyframes rotateGear {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Factory Elements */
.code-block, .design-tool, .mobile-app, .web-app {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: moveOnConveyor 10s linear infinite;
}

.code-block {
    background-color: #10b981;
    color: white;
    animation-delay: 0s;
}

.design-tool {
    background-color: #f59e0b;
    color: white;
    animation-delay: 2.5s;
}

.mobile-app {
    background-color: #ef4444;
    color: white;
    animation-delay: 5s;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    border: 2px solid white;
}

.web-app {
    background-color: #3b82f6;
    color: white;
    animation-delay: 7.5s;
}

@keyframes moveOnConveyor {
    0% {
        left: -50px;
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        left: calc(100% + 50px);
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
}

/* Connection Path */
.app-factory-animation::after {
    content: '';
    position: absolute;
    top: 50px;
    left: 80px;
    width: calc(100% - 160px);
    height: 200px;
    background: transparent;
    border-top: 3px dashed rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    z-index: 1;
}

/* Animated Particles */
@keyframes particleMove {
    0% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100% - 130px)) translateY(200px) scale(0.8);
        opacity: 0;
    }
}

.app-factory-animation::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 80px;
    width: 10px;
    height: 10px;
    background: rgba(79, 70, 229, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
    animation: particleMove 8s linear infinite;
    z-index: 2;
}

/* Success Trophy */
.success-trophy {
    position: absolute;
    bottom: 20px;
    right: 50px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 35px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: pulseTrophy 2s ease-in-out infinite, floatTrophy 5s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulseTrophy {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
    }
}

@keyframes floatTrophy {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

/* Scroll-triggered animations */
.scroll-trigger {
    transition: opacity 0.5s, transform 0.5s;
    opacity: 0;
}

.scroll-trigger.from-bottom {
    transform: translateY(50px);
}

.scroll-trigger.from-left {
    transform: translateX(-50px);
}

.scroll-trigger.from-right {
    transform: translateX(50px);
}

.scroll-trigger.visible {
    opacity: 1;
    transform: translate(0);
}

/* Staggered animations for lists */
.stagger-item {
    opacity: 0;
}

.stagger-item.animated {
    animation-name: fadeInUp;
}

/* Animation delays */
[data-delay="100"] {
    animation-delay: 0.1s;
}

[data-delay="200"] {
    animation-delay: 0.2s;
}

[data-delay="300"] {
    animation-delay: 0.3s;
}

[data-delay="400"] {
    animation-delay: 0.4s;
}

[data-delay="500"] {
    animation-delay: 0.5s;
}

[data-delay="600"] {
    animation-delay: 0.6s;
}

[data-delay="700"] {
    animation-delay: 0.7s;
}

[data-delay="800"] {
    animation-delay: 0.8s;
}

[data-delay="900"] {
    animation-delay: 0.9s;
}

[data-delay="1000"] {
    animation-delay: 1s;
}
