:root {
    /* Colors */
    /* Default: let it blend with the page */
    --bg-dark: transparent;
    --bg-card: #070714;
    --primary-blue: #0077FF;
    --secondary-blue: #004FF6;
    --accent-blue: #1E50FF;
    --success-green: #00C839;
    --success-green-dark: #00AE2C;
    --text-white: #ffffff;
    --text-black: #000000;

    /* Gradients */
    --grad-primary: linear-gradient(270deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    --grad-card-glow: radial-gradient(142.21% 96.25% at 25.06% 7.04%, rgba(0, 119, 255, 0.20) 0%, rgba(0, 119, 255, 0.00) 100%);
    --grad-card-result: linear-gradient(0deg, #FFF 0%, #FFF 100%),
        radial-gradient(96.98% 96.98% at 89.94% 21.7%, rgba(0, 119, 255, 0.20) 0%, rgba(0, 119, 255, 0.00) 100%),
        var(--grad-card-glow);
    --grad-success: radial-gradient(96.98% 96.98% at 89.94% 21.7%, rgba(0, 200, 57, 0.20) 0%, rgba(0, 200, 57, 0.00) 100%),
        radial-gradient(251.01% 100.4% at 6.87% 9.33%, rgba(0, 200, 57, 0.20) 0%, rgba(0, 200, 57, 0.12) 100%);

    /* Fonts */
    --font-main: Arial, Helvetica, sans-serif;

    /* Spacing & Sizes */
    --orbit-dotted-width: min(349px, 60%);
    --radius-full: 50px;
    --radius-large: 30px;
    --radius-medium: 20px;
}

/* If the user's OS/browser is in dark mode, use the animation's intended dark background */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: transparent;
    }
}

/* --- Global Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: transparent;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-main);
    color: var(--text-white);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

/* --- Layout --- */
.animation-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

/* --- Frame 1: Prompt --- */
.prompt-box {
    width: min(535px, 85%);
    height: 170px;
    background: var(--bg-card);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(37, 99, 235, 0.05);
    overflow: hidden;
    border-radius: var(--radius-large);
    border: 1.015px solid var(--primary-blue);
    background: var(--grad-card-glow);
}

.prompt-text {
    font-size: clamp(20px, 2.5vw, 25px);
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-white);
    white-space: pre-wrap;
    display: inline;
    position: relative;
}

.prompt-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 32px;
    background-color: var(--accent-blue);
    vertical-align: middle;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 8px var(--accent-blue);
}

.prompt-box.shimmering::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: shimmer 0.8s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- AI Core & Orbit --- */
.ai-core-container {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(200px, 35%);
    aspect-ratio: 1 / 1;
}

.orbit-path-dotted {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    display: flex;
    max-width: var(--orbit-dotted-width);
}

.orbit-path-dotted img {
    width: 100%;
    height: auto;
}

.ai-core {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-logo {
    max-width: 100%;
    height: auto;
    z-index: 2;
}

/* --- Channels & Modifiers --- */
.channel-card {
    width: 189px;
    height: 78px;
    border-radius: var(--radius-medium);
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    padding-inline: 30px;
    color: var(--text-white);
    font-weight: 700;
    line-height: 1.2;
    position: absolute;
    top: -30px;
    right: -30px;
}

.channel-card:nth-child(2) {
    top: -40px;
    right: -40px;
}

.channel-card:nth-child(3) {
    top: -50px;
    right: -50px;
}

.channel-card-followup {
    top: -45px;
    right: -40px;
}

/* Processing Effect */
.channel-card.processing {
    position: absolute;
    z-index: 10;
    overflow: hidden;
    /* Important for containing the before element */
    background: transparent;
    /* Override original background so pseudoelements show clearly */
}

/* 
  We use a large rotating gradient element behind a slightly smaller
  mask (the after element) to create a border light effect.
*/
.channel-card.processing::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent 0%,
            transparent 75%,
            rgba(255, 255, 255, 0.4) 95%,
            #ffffff 100%);
    z-index: -2;
    animation: rotateBorder 2s linear infinite;
}

/* Inner content block that hides the middle of the rotating gradient */
.channel-card.processing::after {
    content: '';
    position: absolute;
    inset: 2px;
    /* Border thickness */
    border-radius: calc(var(--radius-medium) - 2px);
    background: var(--grad-primary);
    /* Should match the card's original background */
    z-index: -1;
}

/* Ensure text stays above the pseudo elements */
.channel-card.processing {
    /* Optional: add pulse for overall glowing */
    animation: pulseProcessing 1.5s ease-in-out infinite;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulseProcessing {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 119, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 119, 255, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.1);
    }
}

/* --- Result Cards (Base & Types) --- */
.card-base {
    position: absolute;
    display: flex;
    align-items: center;
    border-radius: var(--radius-full);
    border: 0.851px solid var(--primary-blue);
    padding: 16px;
}

.result-card-light,
.final-result-card-light {
    position: absolute;
    display: flex;
    gap: 2px;
    align-items: center;
    border-radius: var(--radius-full);
    border: 0.851px solid var(--primary-blue);
    background: var(--grad-card-result);
    width: min(126px, 50%);
    padding: 16px;
}

.result-card-light-2,
.final-result-card-light-2 {
    width: min(155px, 54%);
    right: 5%;
    bottom: -10px;
}

.result-card-light-1,
.final-result-card-light-1 {
    top: -20px;
    left: 10%;
}

.result-card-light .card-icon,
.final-result-card-light .card-icon {
    width: 24px;
    flex-shrink: 0;
}

.result-card-light .card-counter,
.final-result-card-light .card-counter {
    color: var(--text-black);
    text-align: center;
    font-size: clamp(20px, 3.5vw, 26px);
    font-weight: 700;
    line-height: 1.2;
    margin-inline-start: 4px;
}

.result-card-light .card-text,
.final-result-card-light .card-text {
    color: var(--text-black);
    font-size: 10px;
    font-weight: 400;
    line-height: 12px;
}

/* --- Booked Meetings Specific --- */
.meetings-booked-card,
.meetings-booked-card-2 {
    position: absolute;
}

.meetings-booked-card svg {
    max-width: 100%;
    height: auto;
}

.meetings-booked-card {
    top: 15px;
    right: -15%;
}

.meetings-booked-card-2 {
    bottom: 25%;
    left: -18%;
}

.meetings-booked-card .card-counter,
.meetings-booked-card-2 .card-counter {
    color: var(--text-white);
    text-align: center;
    font-size: clamp(26px, 2.5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    position: absolute;
    bottom: 10px;
    left: 15px;
}

.meetings-booked-card-2 .card-counter {
    left: 8px;
}

.meetings-booked-card .card-text,
.meetings-booked-card-2 .card-text {
    color: var(--text-white);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    width: 49px;
    position: absolute;
    bottom: 18px;
    left: 45px;
}

.meetings-booked-card-2 .card-text {
    left: 53px;
}

/* --- Complex Result Cards (MCP, Signals, Messages) --- */
.mcp-result-card,
.messages-card {
    position: absolute;
}

.mcp-result-card.mcp-result-1 {
    top: 50%;
    left: -40px;
    transform: translateY(-50%);
}

.mcp-result-card.mcp-result-2 {
    right: 0;
    bottom: 0;
}

.mcp-result-card .mcp-result-card-img {
    position: absolute;
    top: 11px;
    left: 10px;
    width: 47%;
}

.messages-card svg {
    max-width: 100%;
    height: auto;
}

.messages-card-1 {
    top: calc(50% - 45px);
    left: -33%;
}

.messages-card-2 {
    right: -16%;
    bottom: 0;
}

/* --- Follow-up Scene --- */
.followup-icon {
    position: absolute;
    z-index: 6;
    display: none;
}

.followup-icon img {
    max-width: 100%;
}

.followup-icon-like {
    top: 20px;
    left: 20px;
}

.followup-icon-message {
    bottom: -42px;
    left: calc(50% - 35px);
}

.followup-icon-mail {
    bottom: 20%;
    left: 0;
}

.followup-icon-share {
    bottom: 20%;
    right: 0;
}

/* --- Final Orbit Scene --- */
.final-results-orbit-container {
    display: none;
    position: absolute;
    z-index: 5;
    width: min(530px, 92%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px solid rgba(0, 119, 255, 0.2);
}

.channel-icons-container {
    min-width: 100%;
    min-height: 100%;
    aspect-ratio: 1;
}

.channel-icon {
    position: absolute;
    z-index: 5;
    display: none;
}

.channel-icon-1 {
    top: calc(0% - 25px);
    left: calc(50% - 25px);
}

.channel-icon-2 {
    top: 24%;
    right: 0;
}

.channel-icon-5 {
    bottom: 20%;
    left: 1%;
}

.channel-icon-6 {
    top: 24%;
    left: 0;
}

.channel-icon-3 {
    bottom: 24%;
    right: 0;
}

.channel-icon-4 {
    bottom: calc(0% - 25px);
    left: calc(50% - 25px);
}

/* --- Final Meeting Booked Card --- */
.final-meeting-booked-card {
    display: none;
    position: absolute;
    z-index: 10;
    top: calc(50% - 42px);
    right: calc(-15% - -5px);
    background: var(--grad-success);
    padding: 18px 22px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--success-green);
}

.booked-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.booked-card-title {
    color: var(--text-white);
    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 700;
    line-height: 1.06;
}

.booked-card-text {
    color: var(--text-white);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    margin-top: 4px;
}

.booked-card-icon {
    display: flex;
}

.booked-card-icon img {
    width: 17px;
}

/* --- Utilities --- */
.anim-hidden {
    display: none;
    opacity: 0;
}

@media screen and (max-width: 768px) {
    .animation-container {
        --radius-large: 20px;
        --radius-medium: 15px;
        transform: scale(.9);
    }

    .prompt-box {
        height: 130px;
        padding: 24px;
    }

    .channel-card {
        width: 165px;
        height: 60px;
        padding-inline: 18px;
    }

    .messages-card {
        max-width: 90px;
    }

    .messages-card-1 {
        top: calc(50% - 35px);
        left: -20%;
    }

    .messages-card-2 {
        right: 0%;
    }

    .result-card-light,
    .final-result-card-light {
        padding: 14px;
    }

    .meetings-booked-card {
        max-width: 105px;
        right: -22%;
    }

    .result-card-light-1,
    .final-result-card-light-1 {
        top: -30px;
    }

    .result-card-light-2,
    .final-result-card-light-2 {
        bottom: -20px;
    }

    .meetings-booked-card-2 {
        max-width: 105px;
    }

    .meetings-booked-card .card-text {
        bottom: 14px;
        left: 38px;
    }

    .meetings-booked-card-2 .card-text {
        left: 42px;
        bottom: 14px;
    }

    .final-meeting-booked-card {
        right: 0;
        padding: 12px 16px;
        border-radius: 12px;
    }

    .followup-icon {
        max-width: 35px;
    }

    .followup-icon-like {
        max-width: 50px;
    }

    .followup-icon-message {
        max-width: 55px;
        bottom: -30px;
        left: calc(50% - 30px);
    }
}
