/* =========================================
   Step Animations (Replaces Images)
   ========================================= */

.step-visual-animation {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: none;
}

/* Step 1: Type */
.anim-type-container {
    width: 85%;
    max-width: 280px;
}

.anim-chat-input {
    background: #fff;
    border-radius: 999px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 12, 42, 0.06);
    border: 1px solid rgba(0, 12, 42, 0.06);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    height: 52px;
    overflow: hidden;
}

.anim-type-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--color-primary);
    width: 0;
    display: inline-block;
    animation: typing 4s steps(20, end) infinite;
}

@keyframes typing {

    0%,
    15% {
        width: 0;
        border-color: var(--color-primary);
    }

    50%,
    80% {
        width: 100%;
        border-color: transparent;
    }

    100% {
        width: 100%;
        border-color: transparent;
    }
}

/* Step 2: Improve - Uses hero animation components */
.anim-improve-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
}

/* Step 2 mini hero frame */
.anim-hero-mini {
    --ha-bg: #ffffff;
    --ha-sidebar-bg: #f9f9f9;
    --ha-border: #e5e5e5;
    --ha-text: #0d0d0d;
    --ha-text-secondary: #666666;
    --ha-primary: #0083ff;
    --ha-primary-hover: #006ecc;
    --ha-bubble-user: #f3f3f3;
    --ha-bubble-ai: transparent;
    --ha-font-family: 'Inter', sans-serif;
    position: relative;
    width: min(320px, 88%);
    max-width: 100%;
    height: 240px;
    height: 240px;
    height: 240px;
    transform: translateY(35px) scale(0.9);
    transform-origin: center;
    font-family: var(--ha-font-family);
}

.anim-hero-mini .ha-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 15% 24px;
    background: transparent;
}

.anim-hero-mini .ha-input-text {
    min-height: 20px;
}

.anim-hero-mini .ha-popover {
    left: 50%;
    bottom: 58px;
    width: min(260px, 100%);
    max-width: calc(100% - 16px);
    transform: translateX(-50%);
}

/* Position popover above for Step 2 */
.anim-popover-step2 {
    z-index: 10;
    opacity: 0;
    animation: step2-popover-toggle 6s infinite;
}

/* Position button in center for Step 2 */
.anim-button-step2 {
    position: relative;
    z-index: 2;
}

.anim-pro-item {
    animation: step2-pro-highlight 6s infinite;
}

/* Cursor Animation for Step 2 */
.anim-cursor-path {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 15;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    width: 24px;
    height: 24px;
    animation: step2-cursor-sequence 6s infinite ease-in-out;
}

/* Step 2 Cursor Sequence */
@keyframes step2-cursor-sequence {
    0% {
        transform: translate(260px, 170px);
    }

    /* Move to menu button */
    15% {
        transform: translate(200px, 180px);
    }

    17% {
        transform: translate(200px, 180px) scale(0.9);
    }

    /* Click */
    19% {
        transform: translate(200px, 180px) scale(1);
    }

    /* Move to 'Professional' in popover */
    30% {
        transform: translate(140px, 25px);
    }

    32% {
        transform: translate(140px, 25px) scale(0.9);
    }

    /* Click */
    34% {
        transform: translate(140px, 25px) scale(1);
    }

    /* Move to 'Upscale' button (left side) */
    48% {
        transform: translate(120px, 180px);
    }

    50% {
        transform: translate(120px, 180px) scale(0.9);
    }

    /* Click */
    52% {
        transform: translate(120px, 180px) scale(1);
    }

    /* Move away */
    70% {
        transform: translate(260px, 170px);
    }

    100% {
        transform: translate(260px, 170px);
    }
}

/* Step 2 Popover Toggle */
@keyframes step2-popover-toggle {

    0%,
    16% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.95);
    }

    17%,
    33% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    35%,
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.95);
    }
}

@keyframes step2-pro-highlight {

    0%,
    24% {
        background: transparent;
    }

    30%,
    40% {
        background: #f0f0f0;
    }

    46%,
    100% {
        background: transparent;
    }
}

/* Step 3: Done */
.anim-done-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anim-doc-sheet {
    width: 100px;
    height: 130px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 12, 42, 0.1);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(0, 12, 42, 0.05);
    transform: rotate(-3deg);
    animation: doc-float 4s ease-in-out infinite;
}

.anim-doc-line {
    height: 8px;
    background: var(--color-surface-alt);
    border-radius: 4px;
}

.anim-check-circle {
    position: absolute;
    bottom: 25px;
    right: 50px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-success);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 157, 88, 0.35);
    animation: check-pop 4s ease infinite;
}

@keyframes doc-float {

    0%,
    100% {
        transform: rotate(-3deg) translateY(0);
    }

    50% {
        transform: rotate(-3deg) translateY(-8px);
    }
}

@keyframes check-pop {

    0%,
    45% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.1) rotate(0deg);
        opacity: 1;
    }

    55% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    85% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    90% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
}