/* ===================================
   SEE HOW BROC WORKS SECTION
   =================================== */

/* Persistent AI Avatars & Speech Bubble */
.demo-ai-persistent {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto 16px auto;
    padding: 0 16px;
    z-index: 10;
}

.demo-ai-persistent > .ai-avatars-stack {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
}

.demo-ai-persistent > .ai-speech-bubble {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
}

.demo-ai-persistent > .journey-continue-button {
    grid-row: 2 / 3;
    grid-column: 1 / 3;
    justify-self: center;
    margin: 0;
}

/* Stacked Avatars Container */
.ai-avatars-stack {
    position: relative;
    width: 56px;
    height: 72px; /* Increased to accommodate 16px offset below */
    min-width: 56px;
}

.ai-avatar-floating {
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2px;
    box-shadow: var(--shadow-colored-gold);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

/* Clive avatar - gold gradient */
.clive-avatar {
    background: var(--gradient-action);
    transform: translate(0, 0);
}

/* Clara avatar - blue gradient */
.clara-avatar {
    background: var(--gradient-primary);
    transform: translate(0, 0);
    z-index: 0;
}

/* Active avatar - higher z-index but positioned below, inactive peeks from above */
.ai-avatar-floating.active {
    z-index: 2;
    transform: translate(0, 16px) scale(1);
}

/* Inactive avatar - lower z-index, positioned at top to peek out */
.clive-avatar:not(.active) {
    transform: translate(0, 0) scale(0.85);
    opacity: 0.7;
    z-index: 1;
}

.clara-avatar:not(.active) {
    transform: translate(0, 0) scale(0.85);
    opacity: 0.7;
    z-index: 1;
}

/* Pulse ring for active avatar */
.ai-avatar-floating.active::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--color-complement);
    opacity: 0.3;
    animation: pulseRing 2s ease-in-out infinite;
}

.clive-avatar.active::before {
    border-color: var(--color-complement);
}

.clara-avatar.active::before {
    border-color: var(--color-primary);
}

.ai-avatar-floating.active:hover {
    transform: translate(0, 16px) scale(1.08) !important;
}

.ai-avatar-floating:not(.active):hover {
    transform: translate(0, 0) scale(0.95) !important;
}

.ai-avatar-floating.speaking {
    animation: avatarPulse 1.5s ease-in-out infinite;
}

/* Side by side mode for celebration */
.ai-avatars-stack.side-by-side {
    width: 130px;
    height: 56px; /* Reset height for side-by-side */
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.ai-avatars-stack.side-by-side .ai-avatar-floating {
    position: relative;
    transform: translate(0, 0) scale(1) !important;
    opacity: 1 !important;
    z-index: 2 !important;
}

.ai-avatars-stack.side-by-side .ai-avatar-floating::before {
    border-color: var(--color-complement);
    opacity: 0.3;
    animation: pulseRing 2s ease-in-out infinite;
}

.ai-avatars-stack.side-by-side .clara-avatar::before {
    border-color: var(--color-primary);
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes dotPulse {
    0%, 100% { 
        transform: scale(1.1);
        box-shadow: var(--shadow-colored-orange);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
    }
}

.ai-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

.ai-speaking-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-avatar-floating.speaking .ai-speaking-indicator {
    opacity: 1;
    animation: indicatorPulse 1s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.ai-speech-bubble {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 248, 240, 0.98) 100%);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: var(--shadow-colored-gold);
    border: 2px solid rgba(251, 191, 36, 0.2);
    position: relative;
    opacity: 0;
    transform: scale(0.9) translateX(-10px);
    transform-origin: left center;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex: 1;
    min-width: 0;
}

.ai-speech-bubble.show {
    opacity: 1;
    transform: scale(1) translateX(0);
    pointer-events: auto;
}

.ai-speech-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid white;
}

.speech-bubble-content {
    font-size: 13px;
    line-height: 1.4;
    color: #1e293b;
    font-weight: 500;
}

[data-theme="dark"] .ai-speech-bubble {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .ai-speech-bubble::before {
    border-right-color: rgba(30, 41, 59, 0.98);
}

[data-theme="dark"] .speech-bubble-content {
    color: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] .ai-speech-bubble .speech-bubble-content {
    color: #ffffff !important;
}

[data-theme="dark"] .ai-speaking-indicator {
    border-color: var(--bg-elevated);
}

/* Scroll Indicator for Overflowing Content */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-indicator.show {
    opacity: 1;
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-arrow svg {
    width: 24px;
    height: 24px;
    color: white;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* Confetti Effect for Goal Achievement */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-gold);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

.confetti.animate {
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Spotlight Effect */
.journey-step-content {
    position: relative;
}

.journey-step-content::before {
    display: none;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .demo-clive-persistent,
    .demo-ai-persistent {
        gap: 8px;
        margin-bottom: 12px;
        padding: 0 12px;
        max-width: 100%;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }
    
    .demo-ai-persistent > .journey-continue-button {
        margin-top: 4px;
    }
    
    .clive-avatar-floating,
    .ai-avatar-floating {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
    
    .ai-avatars-stack {
        height: 60px;
    }
    
    .ai-avatars-stack.side-by-side {
        height: 44px;
    }
    
    .ai-speech-bubble {
        padding: 8px 12px;
    }
    
    .ai-speech-bubble::before {
        left: -6px;
        top: 50%;
        transform: translateY(-50%);
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-right-width: 6px;
    }
    
    .speech-bubble-content {
        font-size: 11px;
        line-height: 1.3;
    }
    
    /* Adjust stacked avatars for mobile */
    .ai-avatars-stack {
        width: 48px;
        /* height already set above */
        min-width: 48px;
    }
    
    .ai-avatar-floating {
        width: 48px;
        height: 48px;
    }
    
    .ai-avatar-floating.active {
        transform: translate(0, 16px) scale(1);
    }
    
    .ai-avatar-floating:not(.active) {
        transform: translate(0, 0) scale(0.85);
    }
    
    /* Side by side mode for mobile */
    .ai-avatars-stack.side-by-side {
        width: 110px;
        height: 48px;
        gap: 10px;
    }
}

.demo-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.demo-section::before {
    display: none;
}

[data-theme="light"] .demo-section::before {
    display: none;
}

.demo-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.demo-content {
    max-width: 1100px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
}

.demo-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 400;
    line-height: 1.5;
}

.demo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.6;
    opacity: 0.8;
    font-style: italic;
}

[data-theme="dark"] .demo-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .demo-subtitle {
    color: rgba(15, 23, 42, 0.6);
}

/* Clive Introduction */
.clive-intro-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.clive-avatar-large {
    width: 120px;
    height: 120px;
    position: relative;
    cursor: pointer;
}

.clive-avatar-large::after {
    content: '🎙️';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    pointer-events: none; /* Don't block clicks */
}

.clive-avatar-large:hover::after {
    transform: scale(1.1);
}

.demo-clive-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    object-position: center;
}

.clive-message {
    max-width: 700px;
}

.clive-quote {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
    position: relative;
    padding: 0 32px;
}

.clive-quote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.clive-hint {
    margin-top: 16px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: normal;
    opacity: 0.8;
}

/* Journey Container - NO BACKGROUND/BORDER/SHADOW */
.journey-container {
    margin: 0 auto;
    max-width: 800px;
    position: relative;
    perspective: 1000px;
    min-height: auto;
    max-height: calc(85vh - 120px);
    background: transparent;
    border-radius: 0;
    padding: 8px 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .journey-container {
    background: transparent;
}

.journey-container::before {
    display: none;
}

/* Journey Steps */
.journey-step {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.journey-step.active {
    opacity: 1;
    transform: translateY(0);
}

.journey-step-content {
    text-align: center;
    padding: 12px 16px;
    max-height: calc(85vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Continue Button */
.journey-continue-button {
    padding: 10px 24px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: var(--shadow-colored-gold);
    animation: pulseGlow 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    width: fit-content;
}

.journey-continue-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.journey-continue-button:hover::before {
    left: 100%;
}

.journey-continue-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 32px rgba(217, 166, 33, 0.5);
}

.journey-continue-button:active {
    transform: translateY(0) scale(1);
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(217, 166, 33, 0.3);
    }
    50% {
        box-shadow: 0 4px 24px rgba(217, 166, 33, 0.5), 0 0 20px rgba(217, 166, 33, 0.3);
    }
}

/* Top Progress Bar */
.demo-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(37, 99, 235, 0.1);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-progress-bar.show {
    opacity: 1;
}

.demo-progress-fill {
    height: 100%;
    background: var(--gradient-action);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.journey-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.journey-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 16px;
}

/* Step 1: Goal Introduction */
.goal-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.user-initial {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.goal-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: transparent;
    border: 2px solid rgba(249, 115, 22, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.1);
    backdrop-filter: none;
}

.goal-icon {
    font-size: 36px;
    line-height: 1;
}

.goal-target {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
}

/* Step 2: Quick Stats Mini */
.quick-stats-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.stat-mini {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-mini:hover {
    transform: translateY(-2px);
}

.stat-mini-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-mini-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-mini-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Step 2.5: Clara's Analysis Section */
.clara-analysis-section {
    max-width: 600px;
    margin: 0 auto;
}

.ai-analyst-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--modal-bg);
    border: 2px solid var(--color-primary);
    border-radius: 16px;
    margin-bottom: 24px;
}

.analyst-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid var(--color-primary);
}

.analyst-info {
    flex: 1;
}

.analyst-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.analyst-role {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 600;
    margin: 0;
}

.analysis-insight {
    background: var(--bg-elevated);
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--modal-bg);
    border: 2px solid var(--color-complement);
    border-radius: 12px;
    margin-bottom: 20px;
}

.insight-icon {
    font-size: 48px;
    line-height: 1;
}

.insight-content {
    flex: 1;
}

.insight-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.insight-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-complement);
}

.insight-factors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.factor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid #10b981;
    border-radius: 8px;
}

.factor-icon {
    color: #10b981;
    font-weight: 700;
    font-size: 1.125rem;
}

.factor-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

[data-theme="dark"] .factor-item {
    background: rgba(16, 185, 129, 0.08);
}

[data-theme="light"] .factor-item {
    background: rgba(16, 185, 129, 0.04);
}

/* Step 3: Action Card (reuse existing styles) */
.interactive-demo-container {
    margin: 12px auto;
    max-width: 550px;
}

.demo-instruction {
    text-align: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.demo-action-card-wrapper {
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Set size on flip-card-container so both sides match */
.demo-action-card-wrapper .flip-card-container {
    width: 220px !important;
    height: 320px !important;
    min-width: 220px !important;
    min-height: 320px !important;
    max-width: 220px !important;
    max-height: 320px !important;
}

/* Ensure flip-card-front and flip-card-back fill the container */
.demo-action-card-wrapper .flip-card-front {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

.demo-action-card-wrapper .flip-card-back {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

/* The swipeable-action-card inside the back provides the background */
.demo-action-card-wrapper .flip-card-back .swipeable-action-card {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    z-index: 0 !important;
}

/* The step-by-step-container scrolls on top of the background */
.demo-action-card-wrapper .flip-card-back .step-by-step-container {
    position: relative !important;
    z-index: 1 !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Action card inside flip-card-front also fills parent */
.demo-action-card-wrapper .flip-card-front .action-card,
.demo-action-card-wrapper .flip-card-front .action-card .card-inner {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px !important;
}

/* Swipeable Action Card - Uses 100% to fill parent */
.demo-action-card-wrapper .swipeable-action-card {
    width: 100% !important;
    height: 100% !important;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    transform-style: preserve-3d;
    touch-action: pan-y;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    /* High priority gold gradient - matching sandbox */
    background: linear-gradient(135deg, #E6C200 0%, #FFD700 35%, #F2CC0D 65%, #CCAB00 100%) !important;
    border-color: rgba(255, 215, 0, 0.8);
    color: white !important;
    
    /* Enable container queries like sandbox */
    container-type: size;
}

.swipeable-action-card:active {
    cursor: grabbing;
}

.swipeable-action-card.swiping {
    transition: none;
}

.swipeable-action-card.swipe-left {
    animation: swipeOutLeft 0.4s ease-out forwards;
}

.swipeable-action-card.swipe-right {
    animation: swipeOutRight 0.4s ease-out forwards;
}

@keyframes swipeOutLeft {
    to {
        transform: translateX(-150%) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes swipeOutRight {
    to {
        transform: translateX(150%) rotate(20deg);
        opacity: 0;
    }
}

/* Card Inner - Matching Sandbox */
.sandbox-action-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    border-radius: 20px;
    background: transparent;
}

/* Header - Matching Sandbox */
.sandbox-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sandbox-category-badge {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sandbox-priority {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Title & Description - Matching Sandbox */
.sandbox-action-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.sandbox-action-description {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

/* Impact Grid - Matching Sandbox */
.sandbox-impact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
    margin-bottom: 16px;
}

.sandbox-impact-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px;
}

.sandbox-impact-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.sandbox-impact-value {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

/* Swipe Hint Overlay */
.swipe-hint-overlay {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 600;
}

.swipe-arrow-left {
    color: rgba(255, 255, 255, 0.9);
}

.swipe-arrow-right {
    color: rgba(255, 255, 255, 0.9);
}

/* Landing Demo Action Card Front - Balanced Size */
.demo-action-card-wrapper .swipeable-action-card {
    container-type: size;
}

.demo-action-card-wrapper .card-inner {
    padding: 3.2cqh 3.8cqh !important;
}

.demo-action-card-wrapper .card-category {
    font-size: 2.8cqh !important;
    padding: 1cqh 2cqh !important;
}

.demo-action-card-wrapper .savings-amount {
    gap: 0.7cqh !important;
    margin-top: 0.7cqh !important;
}

.demo-action-card-wrapper .savings-amount .currency {
    font-size: 2.8cqh !important;
}

.demo-action-card-wrapper .savings-amount .amount {
    font-size: 11cqh !important;
}

.demo-action-card-wrapper .card-divider {
    margin: 1.8cqh 0 !important;
}

.demo-action-card-wrapper .card-title {
    font-size: 3.8cqh !important;
    margin: 0.6cqh 0 1.1cqh !important;
}

.demo-action-card-wrapper .card-description {
    font-size: 2.1cqh !important;
}

/* Landing Demo Step-by-Step Container - Balanced Size */
.demo-action-card-wrapper .step-by-step-container {
    padding: 16px 14px 40px 14px !important;
    gap: 16px !important;
    min-height: 100%;
    box-sizing: border-box;
}

.demo-action-card-wrapper .step-by-step-header {
    padding-bottom: 12px !important;
    gap: 12px !important;
}

.demo-action-card-wrapper .ai-avatar-gradient-border {
    width: 48px !important;
    height: 48px !important;
}

.demo-action-card-wrapper .ai-avatar-inner {
    width: 44px !important;
    height: 44px !important;
}

.demo-action-card-wrapper .step-by-step-intro {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
}

.demo-action-card-wrapper .step-row {
    padding: 10px 12px 10px 40px !important;
    border-radius: 12px !important;
    min-height: 44px !important;
    gap: 0 !important;
}

.demo-action-card-wrapper .step-number-circle {
    width: 24px !important;
    height: 24px !important;
    top: 10px !important;
    left: 10px !important;
}

.demo-action-card-wrapper .step-number {
    font-size: 12px !important;
}

.demo-action-card-wrapper .step-title {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 3px !important;
}

.demo-action-card-wrapper .step-description {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
}

.demo-action-card-wrapper .back-to-action-btn {
    padding: 10px 16px !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
    margin-top: 12px !important;
}

.demo-action-card-wrapper .back-to-action-btn svg {
    width: 14px !important;
    height: 14px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .demo-action-card-wrapper .flip-card-container {
        width: min(220px, 88vw) !important;
        max-width: 88vw !important;
        height: 320px !important;
        min-height: 320px !important;
        max-height: 320px !important;
    }
}

/* Step 4: Goal Progress */
.goal-progress-container {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    padding: 16px 20px;
    max-width: 400px;
    margin: 0 auto 16px auto;
}

.goal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.goal-progress-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.goal-progress-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.goal-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

[data-theme="light"] .goal-progress-bar {
    background: rgba(102, 126, 234, 0.15);
}

.goal-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-progress-status {
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #50C878;
    margin-top: 8px;
}

.actions-completed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 450px;
    margin: 0 auto;
}

.action-completed-item {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    opacity: 0;
}

.action-completed-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #50C878;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.action-completed-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-align: left;
}

.action-completed-value {
    font-size: 1rem;
    font-weight: 700;
    color: #50C878;
    flex-shrink: 0;
}

/* Step 5: CTA */
.journey-cta-button {
    padding: 16px 40px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 16px;
}

.journey-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--accent-dark);
}

.journey-cta-button:active {
    transform: translateY(0);
}

.journey-restart-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.journey-restart-button:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.05);
}

/* Journey Progress Indicator */
.journey-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px 0;
}

.journey-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(217, 166, 33, 0.2) 100%);
    border: 2px solid rgba(249, 115, 22, 0.3);
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journey-dot.active {
    width: 16px;
    height: 16px;
    background: var(--gradient-warm);
    border: 2px solid var(--accent);
    opacity: 1;
    animation: dotPulse 1s ease-in-out infinite;
    box-shadow: var(--shadow-colored-orange);
    transform: scale(1.1);
}

/* Journey Controls */
.journey-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
}

.journey-control-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.journey-control-button:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--accent);
}

.journey-control-button svg {
    opacity: 0.8;
}

/* Responsive Journey */
@media (max-width: 768px) {
    /* Improve touch interaction for demo */
    .journey-continue-button {
        min-height: 44px;
        padding: 10px 20px;
        font-size: 0.9rem;
        touch-action: manipulation; /* Prevents double-tap zoom */
    }
    
    /* Ensure demo scrolling is smooth */
    .journey-container {
        max-width: 100%;
        padding: 6px 10px;
        min-height: auto;
        max-height: calc(90vh - 80px); /* Increased available height */
        -webkit-overflow-scrolling: touch;
    }
    
    .journey-step-content {
        max-height: calc(90vh - 180px); /* Increased available height */
        -webkit-overflow-scrolling: touch;
        padding: 8px;
    }
    
    .journey-title {
        font-size: 1.15rem;
        margin-bottom: 6px;
    }
    
    .journey-text {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    /* Keep stats horizontal on mobile, just make them smaller */
    .quick-stats-mini {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 100%;
    }
    
    .stat-mini {
        padding: 8px 6px;
    }
    
    .stat-mini-icon {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }
    
    .stat-mini-value {
        font-size: 0.95rem;
    }
    
    .stat-mini-label {
        font-size: 0.65rem;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-initial {
        font-size: 30px;
    }
    
    .goal-visual {
        padding: 10px 14px;
        gap: 6px;
    }
    
    .goal-icon {
        font-size: 28px;
    }
    
    .goal-target {
        font-size: 1rem;
    }
    
    .goal-progress-container {
        padding: 12px;
    }
    
    .demo-instruction {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .interactive-demo-container {
        margin: 10px auto;
    }
    
    /* Compact Clara's analysis section on mobile */
    .clara-analysis-section {
        max-width: 100%;
    }
    
    .analysis-insight {
        padding: 12px;
        margin-top: 12px;
    }
    
    .insight-card {
        padding: 10px;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .insight-icon {
        font-size: 1.75rem;
        min-width: 40px;
    }
    
    .insight-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .insight-value {
        font-size: 1rem;
    }
    
    .insight-factors {
        gap: 6px;
        margin-top: 8px;
    }
    
    .factor-item {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .factor-icon {
        font-size: 0.85rem;
    }
    
    /* Compact agentic action section on mobile */
    .agentic-action-visual {
        gap: 20px;
    }
    
    .agentic-animation {
        gap: 16px;
    }
    
    .agentic-avatar {
        width: 64px;
        height: 64px;
        border: 2px solid var(--accent);
    }
    
    .agentic-progress {
        gap: 10px;
        max-width: 100%;
    }
    
    .progress-step {
        padding: 8px 12px;
        gap: 10px;
        border-radius: 10px;
    }
    
    .progress-step svg,
    .spinner-small {
        width: 18px;
        height: 18px;
    }
    
    .progress-step span {
        font-size: 0.85rem;
    }
    
    .action-completed-item {
        padding: 10px;
    }
    
    .action-completed-text {
        font-size: 0.8rem;
    }
    
    .journey-continue-button {
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .journey-cta-button {
        width: 100%;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .journey-restart-button {
        width: 100%;
        justify-content: center;
    }
}

/* Card Tap Hint */
.card-tap-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Back to Action Button (Accept Plan) */
.back-to-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.back-to-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-action-btn:active {
    transform: translateY(0);
}

/* Step 3.5: Agentic Action */
.agentic-action-visual {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.agentic-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.agentic-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    object-fit: cover;
    object-position: center;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
    }
}

.agentic-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.progress-step.completed {
    opacity: 1;
}

.progress-step.completed svg {
    color: #50C878;
}

.progress-step.active {
    opacity: 1;
    border-color: var(--accent);
}

.progress-step svg {
    flex-shrink: 0;
}

.progress-step span {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tender Preview */
.tender-preview {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 16px;
    padding: 24px;
}

.tender-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tender-badge {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tender-status {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.tender-status.active {
    background: rgba(80, 200, 120, 0.15);
    color: #50C878;
}

.tender-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.tender-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tender-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Demo CTA */
.demo-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding-top: 32px;
}

.demo-cta-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 500;
}

.demo-cta-button {
    padding: 16px 40px;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.demo-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--accent-dark);
}

.demo-cta-button:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .demo-intro {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .demo-subtitle {
        font-size: 0.8rem;
        margin-bottom: 36px;
        line-height: 1.5;
    }
    
    .clive-avatar-large {
        width: 96px;
        height: 96px;
    }
    
    .clive-quote {
        font-size: 1.125rem;
        padding: 0 16px;
    }
    
    .demo-cta-text {
        font-size: 1rem;
    }
    
    .demo-cta-button {
        font-size: 1rem;
        padding: 14px 32px;
    }
}

