/* ============================================================
   SnappyName — Product Preview animation styles
   The animation classes are prefixed v4-* / gen-* / prompt-*
   (no risk of collision elsewhere).
   ============================================================ */

/* CPU optimizations: skip render off-screen, pause anims when hidden */
#product-preview {
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}
body.is-anim-paused #product-preview,
body.is-anim-paused #product-preview *,
body.is-anim-paused #product-preview *::before,
body.is-anim-paused #product-preview *::after {
    animation-play-state: paused !important;
}

/* === Stage / tilt frame === */
.stage-v4 {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1.05;
    position: relative;
    perspective: 1400px;
    margin-left: -140px;
}
.tilt-frame-v4 {
    position: absolute;
    inset: 0;
    transform: rotateY(-25deg) rotateX(3deg);
    transform-style: preserve-3d;
}

/* === Window === */
.v4-window {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #17181c 0%, #0f1013 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}
.v4-window.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.v4-body {
    position: relative;
    height: calc(100% - 45px);
    padding: 22px;
    overflow: hidden;
}
.v4-window.is-bare {
    background: transparent;
    border: none;
    box-shadow: none;
}
.v4-window.is-bare .v4-body { height: 100%; }
.v4-window.is-bare .prompt-cta { align-self: flex-end; }

/* === Window transitions === */
.v4-window.enter-slide { animation: v4SlideIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.v4-window.exit-slide  { animation: v4SlideOut 0.55s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes v4SlideIn  { from { opacity: 0; transform: translateX(105%); } to { opacity: 1; transform: translateX(0); } }
@keyframes v4SlideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-105%); } }

.v4-window.enter-zoom { animation: v4ZoomIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.v4-window.exit-zoom  { animation: v4ZoomOut 0.55s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes v4ZoomIn  { from { opacity: 0; transform: scale(1.35); filter: blur(6px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes v4ZoomOut { from { opacity: 1; transform: scale(1); filter: blur(0); } to { opacity: 0; transform: scale(0.78); filter: blur(6px); } }

.v4-window.enter-zoom2 { animation: v4Zoom2In 0.49s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.v4-window.exit-zoom2  { animation: v4Zoom2Out 0.385s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes v4Zoom2In  { from { opacity: 0; transform: scale(0.7); filter: blur(6px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes v4Zoom2Out { from { opacity: 1; transform: scale(1); filter: blur(0); } to { opacity: 0; transform: scale(1.35); filter: blur(6px); } }

.v4-window.enter-flip { animation: v4FlipIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.v4-window.exit-flip  { animation: v4FlipOut 0.6s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes v4FlipIn  { from { opacity: 0; transform: rotateY(100deg); } 50% { opacity: 1; } to { opacity: 1; transform: rotateY(0); } }
@keyframes v4FlipOut { from { opacity: 1; transform: rotateY(0); } to { opacity: 0; transform: rotateY(-100deg); } }

.v4-window.enter-push { animation: v4PushIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.v4-window.exit-push  { animation: v4PushOut 0.55s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes v4PushIn  { from { opacity: 0; transform: translateY(105%); } to { opacity: 1; transform: translateY(0); } }
@keyframes v4PushOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-105%); } }

.v4-window.enter-fade { animation: v4FadeIn 0.55s ease forwards; }
.v4-window.exit-fade  { animation: v4FadeOut 0.45s ease forwards; }
@keyframes v4FadeIn  { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes v4FadeOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.03); } }

/* === Panel 1 — Prompt === */
.panel-prompt { display: flex; flex-direction: column; justify-content: center; }
.v4-window.is-bare .panel-prompt { transform: translateY(-70px); }
.prompt-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.prompt-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    min-height: 68px;
    margin-bottom: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.prompt-input.is-focused {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}
.prompt-caret {
    display: inline-block; width: 1.5px; height: 14px; background: #f59e0b;
    margin-left: 2px; vertical-align: middle;
    animation: caretBlink 1s steps(2) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.prompt-cta {
    align-self: flex-start;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
    transition: transform 0.15s;
}
.prompt-cta.is-pressed { transform: scale(0.93); }

/* === Panel 2 — Generation table === */
.panel-generation { display: flex; flex-direction: column; }
.gen-header {
    display: flex; align-items: center; gap: 8px;
    padding: 0 4px;
    margin-bottom: 10px;
    font-size: 13px;
}
.gen-header-name { flex: 1; min-width: 0; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.gen-header-name .count { color: #f97316; font-weight: 700; }
.gen-header-ext {
    width: 250px;
    flex-shrink: 0;
    text-align: center;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}
.gen-header-intel { width: 92px; flex-shrink: 0; }

.gen-table { display: flex; flex-direction: column; flex: 1; }
.gen-row {
    display: flex; align-items: center; gap: 8px;
    height: 46px;
    padding: 0 4px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.gen-row.is-in { opacity: 1; transform: translateY(0); }
.gen-row-name {
    flex: 1; min-width: 0;
    display: flex; align-items: baseline;
    white-space: nowrap; overflow: visible; text-overflow: ellipsis;
}
.gen-row-name .name {
    font-size: 16px; font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}
.gen-row-name .ext {
    font-size: 14px; color: rgba(255, 255, 255, 0.7);
    margin-left: 1px;
}

/* Aigen.io zoom (text-clip stays on inner span — Firefox bug workaround) */
.gen-row-name .name.is-zooming {
    font-weight: 800;
    letter-spacing: -0.03em;
    display: inline-block;
}
.gen-row-name .name.is-zooming .name-inner {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.gen-row-name .name.is-zooming .io-suffix {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

/* Extension segmented bar */
.gen-ext-bar {
    position: relative;
    display: inline-flex;
    padding: 2px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 30px;
    align-items: center;
    flex-shrink: 0;
}
.gen-ext-pill {
    position: absolute;
    top: 2px; bottom: 2px;
    left: 2px;
    width: 0;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.25s ease,
                background 0.2s ease,
                border-color 0.2s ease;
    pointer-events: none;
}
.gen-ext-pill.is-available {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.25);
}
.gen-ext-cell {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.2);
    line-height: 1;
    transition: color 0.2s ease;
}
.gen-ext-cell[data-status="checking"]  { color: rgba(255, 255, 255, 0.5); }
.gen-ext-cell[data-status="taken"]     { color: rgba(255, 255, 255, 0.35); }
.gen-ext-cell[data-status="available"] { color: #f97316; }
.gen-ext-spin {
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.6);
    animation: gen-ext-spin 0.7s linear infinite;
}
@keyframes gen-ext-spin { to { transform: rotate(360deg); } }

/* Name Intel button with rotating halo */
@property --gen-intel-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}
@keyframes gen-intel-halo { to { --gen-intel-angle: 360deg; } }
.gen-intel-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 0;
}
.gen-intel-btn::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 9999px;
    background: conic-gradient(
        from var(--gen-intel-angle),
        rgba(255, 255, 255, 0.08) 0%,
        rgba(245, 158, 11, 0.45) 15%,
        rgba(255, 255, 255, 0.08) 30%,
        rgba(255, 255, 255, 0.08) 100%
    );
    animation: gen-intel-halo 3s linear infinite;
    z-index: -2;
}
.gen-intel-btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.92);
    z-index: -1;
}
.gen-row:nth-child(2n) .gen-intel-btn::before { animation-delay: -0.5s; }
.gen-row:nth-child(3n) .gen-intel-btn::before { animation-delay: -1.2s; }
.gen-row:nth-child(4n) .gen-intel-btn::before { animation-delay: -2.0s; }
.gen-row:nth-child(5n) .gen-intel-btn::before { animation-delay: -0.3s; }
.gen-row:nth-child(7n) .gen-intel-btn::before { animation-delay: -1.7s; }
.gen-intel-btn .gen-intel-icon { width: 11px; height: 11px; opacity: 0.9; }
.gen-intel-btn.is-pressed {
    transform: scale(0.93);
    transition: transform 0.15s ease;
}

/* === Social handles section === */
.v4-social-section {
    position: absolute;
    left: 22px;
    right: 22px;
    top: 55px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}
.v4-social-section.is-visible { opacity: 1; }
.v4-social-section.is-sliding-out {
    transition: transform 0.7s cubic-bezier(0.55, 0.085, 0.68, 0.53), opacity 0.7s ease;
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}
.v4-social-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 14px;
}
.v4-social-label .at { color: #f97316; font-weight: 700; }
.v4-social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.v4-social-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    aspect-ratio: 1 / 0.203;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-14px) scale(1.1);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.42s cubic-bezier(0.34, 1.4, 0.5, 1),
                border-color 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.v4-social-card.is-in { opacity: 1; transform: translateY(0) scale(1); }
.v4-social-card.is-available {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.08);
}
.v4-social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}
.v4-social-card.is-bursting::before {
    animation: v4SocialFlash 0.38s ease-out;
}
@keyframes v4SocialFlash {
    0%   { opacity: 0; }
    25%  { opacity: 0.5; }
    100% { opacity: 0; }
}
.v4-social-logo {
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.v4-social-logo.is-in { opacity: 1; transform: scale(1); }
.v4-social-card.is-taken    .v4-social-logo { color: rgba(255, 255, 255, 0.3); }
.v4-social-card.is-available .v4-social-logo { color: #f97316; }
.v4-social-logo--facebook  { width: 21px; height: 21px; }
.v4-social-logo--x         { width: 20px; height: 20px; }
.v4-social-logo--instagram { width: 25px; height: 25px; }
.v4-social-logo--tiktok    { width: 20px; height: 20px; }
.v4-social-logo--youtube   { width: 22px; height: 22px; }
.v4-social-logo--linkedin  { width: 22px; height: 22px; }
.v4-social-status {
    width: 17px; height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.v4-social-status.is-in { opacity: 1; transform: scale(1); }
.v4-social-status.is-positive {
    background: rgba(249, 115, 22, 0.18);
    color: #f97316;
}
.v4-social-status.is-negative {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.35);
}

/* === Google rankability check === */
.v4-rank-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.v4-rank-label {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 1.2em;
}
.v4-serp-list {
    display: flex; flex-direction: column;
    gap: 6px; margin-bottom: 10px;
}
.v4-serp-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    min-height: 42px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.v4-serp-row.is-in { opacity: 1; transform: translateY(0); }
.v4-serp-pos {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 800;
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
    border-radius: 7px;
    padding: 3px 8px;
    min-width: 34px;
    text-align: center;
}
.v4-serp-domain {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 3px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v4-serp-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Verdict pill */
.v4-verdict {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 22px;
    border-radius: 11px;
    border: 1px solid rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.08);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.v4-verdict.is-in { opacity: 1; transform: translateY(0); }
.v4-verdict.is-blinking {
    animation: v4VerdictBlink 0.9s ease-in-out 4;
}
@keyframes v4VerdictBlink {
    0%, 100% {
        background: rgba(249, 115, 22, 0.08);
        border-color: rgba(249, 115, 22, 0.3);
        box-shadow: none;
    }
    50% {
        background: rgba(249, 115, 22, 0.28);
        border-color: rgba(249, 115, 22, 0.75);
        box-shadow: 0 0 24px rgba(249, 115, 22, 0.45);
    }
}
.v4-verdict-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.18);
    color: #f97316;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.v4-verdict-icon svg { width: 14px; height: 14px; }
.v4-verdict-text {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v4-verdict-text .lead  { color: #f97316; }
.v4-verdict-text .arrow { color: #f97316; margin: 0 4px; }

/* === Grab it button + magic burst === */
.v4-grab-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s ease;
}
.v4-grab-wrapper.is-active { opacity: 1; }
.v4-grab-btn {
    position: relative;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    font-weight: 700;
    font-size: 50px;
    line-height: 1.1;
    padding: 6px 60px;
    border-radius: 200px;
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.45);
    white-space: nowrap;
    transform-origin: center;
    z-index: 2;
}
.v4-grab-btn.is-clicked {
    animation: v4GrabClick 340ms cubic-bezier(0.34, 1.5, 0.64, 1) forwards;
}
@keyframes v4GrabClick {
    0%   { transform: scale(1); }
    30%  { transform: scale(0.82); }
    65%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.v4-grab-burst {
    position: absolute;
    top: 50%; left: 50%;
    width: 3px;
    height: 16px;
    margin-left: -1.5px;
    margin-top: -8px;
    background: #f97316;
    border-radius: 2px;
    transform-origin: center;
    opacity: 0;
    z-index: 1;
}
.v4-grab-burst.is-bursting {
    animation: v4GrabBurstAnim 420ms cubic-bezier(0.25, 0.6, 0.4, 1) forwards;
}
@keyframes v4GrabBurstAnim {
    0%   { opacity: 1; transform: rotate(var(--angle)) translateY(-80px) scaleY(0.8); }
    100% { opacity: 0; transform: rotate(var(--angle)) translateY(-150px) scaleY(0.3); }
}

/* === Cursor === */
.v4-mouse-cursor {
    position: absolute;
    pointer-events: none;
    display: none;
    z-index: 20;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}
.v4-mouse-cursor.is-active { display: block; }

/* === Dots / debug label (hidden in prod) === */
.v4-dots, .v4-transition-label { display: none; }

