/* ========================================
   QFLOWS HERO ANIMATION STYLES
   12-second loop: Describe → Generate → Deploy
   ======================================== */

/* ========================================
   BASE STYLES
   ======================================== */

.hero-animation-section {
    background: transparent;
    min-height: auto;
    font-family: 'Inter', sans-serif;
    color: #fff;
    overflow-x: hidden;
}

.hero-wrapper-mono, .mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ========================================
   STAGE LABEL GRADIENTS
   ======================================== */

.gradient-text-cyan {
    background: linear-gradient(90deg, #06b6d4, #22d3ee, #06b6d4);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.1em;
    background-clip: text;
}

.gradient-text-violet {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa, #8b5cf6);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.1em;
    background-clip: text;
}

.gradient-text-yellow {
    background: linear-gradient(90deg, #ffd32b, #fef08a, #ffd32b);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: 0.1em;
    background-clip: text;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.stage-label span {
    display: inline-block;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center center;
}

.stage-label.highlight-active span {
    transform: scale(1.3);
}

/* ========================================
   ANIMATED CONNECTION BEAMS
   ======================================== */

.connection-beam {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    /* Visibility controlled by JS highlight classes or media queries */
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

@media (min-width: 1024px) {
    .connection-beam {
        min-width: 80px;
    }
}

/* Always show beams on mobile */
@media (max-width: 1023px) {
    .connection-beam.beam-1,
    .connection-beam.beam-2 {
        opacity: 1 !important;
    }
}

.connection-beam.highlight-active {
    opacity: 1 !important;
    z-index: 0 !important;
}

.beam-line {
    position: absolute;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
    border-radius: 2px;
}

.beam-glow {
    position: absolute;
    height: 20px;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
    filter: blur(8px);
}

.beam-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd32b 0%, rgba(255, 211, 43, 0) 70%);
    box-shadow: 0 0 15px #ffd32b, 0 0 30px rgba(255, 211, 43, 0.5);
    animation: particleMove 2s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .beam-particle {
        width: 12px;
        height: 12px;
        box-shadow: 0 0 20px #ffd32b, 0 0 40px rgba(255, 211, 43, 0.5);
    }
}

.beam-particle-2 { animation-delay: 0.7s; opacity: 0.7; }
.beam-particle-3 { animation-delay: 1.4s; opacity: 0.5; }

@keyframes particleMove {
    0% { left: -10px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: calc(100% - 10px); opacity: 0; }
}

/* Cyan Beam Variant */
.connection-beam.beam-cyan .beam-line {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent);
}
.connection-beam.beam-cyan .beam-glow {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), transparent);
}
.connection-beam.beam-cyan .beam-particle {
    background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
    box-shadow: 0 0 15px #06b6d4, 0 0 30px rgba(6, 182, 212, 0.5);
}

/* Yellow Beam Variant */
.connection-beam.beam-yellow .beam-line {
    background: linear-gradient(90deg, transparent, rgba(255, 211, 43, 0.4), transparent);
}
.connection-beam.beam-yellow .beam-glow {
    background: linear-gradient(90deg, transparent, rgba(255, 211, 43, 0.2), transparent);
}

/* ========================================
   STAGE 1: DESCRIBE (Chat)
   ======================================== */

.chat-window {
    background: rgba(9, 9, 11, 0.8);
    transition: all 0.5s ease;
    position: relative;
    z-index: 1;
}

.user-bubble { opacity: 1; }
.typing-cursor {
    background-color: #ffd32b;
    animation: cursorBlink 0.6s infinite;
}

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

.chat-window.highlight-active {
    border-color: rgba(6, 182, 212, 0.6) !important;
    box-shadow: 0 0 80px rgba(6, 182, 212, 0.4) !important;
    transform: scale(1.15);
    z-index: 200;
}

/* ========================================
   STAGE 2: GENERATE (Engine & APIs)
   ======================================== */

.engine-glow {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.engine-card.highlight-active ~ .engine-glow {
    opacity: 0.7;
}

.engine-card { transition: all 0.5s ease; }

.processing-indicator {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.engine-card.highlight-active {
    border-color: rgba(139, 92, 246, 0.6) !important;
    box-shadow: 0 0 100px rgba(139, 92, 246, 0.5) !important;
    transform: scale(1.2);
    z-index: 100;
}

.engine-card.highlight-active .processing-indicator {
    opacity: 1 !important;
}

/* API Boxes */
.api-box {
    opacity: 1;
    position: relative;
    z-index: 1;
}
.api-box:has(.highlight-active) { z-index: 200; }
.api-item, .api-item .rounded-full { transition: all 0.3s ease; }

.api-card { transition: all 0.3s ease; }
/* .api-card:hover { transform: scale(1.2); z-index: 100; } */

/* Device APIs Highlight */
.device-apis .api-card.highlight-active {
    border-color: rgba(6, 182, 212, 0.7) !important;
    box-shadow: 0 0 50px rgba(6, 182, 212, 0.4) !important;
    transform: scale(1.2);
    z-index: 100;
}
.device-apis .api-item.highlight-active span { color: rgb(6, 182, 212); font-weight: 600; }
.device-apis .api-item.highlight-active .rounded-full {
    background: rgb(6, 182, 212);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

/* Software APIs Highlight */
.software-apis .api-card.highlight-active {
    border-color: rgba(236, 72, 153, 0.7) !important;
    box-shadow: 0 0 50px rgba(236, 72, 153, 0.4) !important;
    transform: scale(1.2);
    z-index: 100;
}
.software-apis .api-item.highlight-active span { color: rgb(236, 72, 153); font-weight: 600; }
.software-apis .api-item.highlight-active .rounded-full {
    background: rgb(236, 72, 153);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}

/* QR Bridge */
.qr-bridge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.qr-bridge .qr-box { opacity: 1; transition: all 0.3s ease; }
.qr-box.highlight-active {
    transform: scale(1.1) !important;
    border-color: rgba(255, 211, 43, 0.6) !important;
    box-shadow: 0 0 30px rgba(255, 211, 43, 0.4) !important;
    z-index: 100;
}
@media (min-width: 1024px) {
    .qr-box.highlight-active {
        transform: scale(1.2) !important;
        box-shadow: 0 0 40px rgba(255, 211, 43, 0.4) !important;
    }
}

/* ========================================
   STAGE 3: DEPLOY (Devices)
   ======================================== */

.device-card { opacity: 1; }
.device-inner { transition: all 0.6s ease; }

.device-inner.highlight-active {
    transform: scale(1.25) translateY(-5px);
    border-color: rgba(255, 211, 43, 0.6) !important;
    box-shadow: 0 15px 60px rgba(255, 211, 43, 0.3) !important;
    z-index: 100;
}

.device-inner.highlight-persistent {
    border-color: rgba(255, 211, 43, 0.6) !important;
    box-shadow: 0 8px 30px rgba(255, 211, 43, 0.2) !important;
}

.device-inner.highlight-active .device-icon,
.device-inner.highlight-persistent .device-icon {
    background: rgba(255, 211, 43, 0.1);
    border-color: rgba(255, 211, 43, 0.3);
}

.device-inner.highlight-active .device-icon i,
.device-inner.highlight-persistent .device-icon i {
    color: rgb(250, 204, 21);
}

/* ========================================
   HOVER EFFECTS (Match Highlight-Active)
   ======================================== */

.chat-window:hover, .chat-window.hover {
    border-color: rgba(6, 182, 212, 0.6) !important;
    box-shadow: 0 0 80px rgba(6, 182, 212, 0.4) !important;
    transform: scale(1.15) !important;
    z-index: 200 !important;
}

.engine-card:hover, .engine-card.hover {
    border-color: rgba(139, 92, 246, 0.6) !important;
    box-shadow: 0 0 100px rgba(139, 92, 246, 0.5) !important;
    transform: scale(1.2) !important;
    z-index: 100 !important;
}

.engine-card:hover .processing-indicator, 
.engine-card.hover .processing-indicator {
    opacity: 1 !important;
}

.device-apis .api-card:hover, .device-apis .api-card.hover {
    border-color: rgba(6, 182, 212, 0.7) !important;
    box-shadow: 0 0 50px rgba(6, 182, 212, 0.4) !important;
    transform: scale(1.2) !important;
    z-index: 100 !important;
}

.software-apis .api-card:hover, .software-apis .api-card.hover {
    border-color: rgba(236, 72, 153, 0.7) !important;
    box-shadow: 0 0 50px rgba(236, 72, 153, 0.4) !important;
    transform: scale(1.2) !important;
    z-index: 100 !important;
}

.device-inner:hover, .device-inner.hover {
    transform: scale(1.25) translateY(-5px) !important;
    border-color: rgba(255, 211, 43, 0.6) !important;
    box-shadow: 0 15px 60px rgba(255, 211, 43, 0.3) !important;
    z-index: 100 !important;
}

.device-inner:hover .device-icon,
.device-inner.hover .device-icon {
    background: rgba(255, 211, 43, 0.1);
    border-color: rgba(255, 211, 43, 0.3);
}

.device-inner:hover .device-icon i,
.device-inner.hover .device-icon i {
    color: rgb(250, 204, 21);
}

.qr-box:hover, .qr-box.hover {
    transform: scale(1.2) !important;
    border-color: rgba(255, 211, 43, 0.6) !important;
    box-shadow: 0 0 40px rgba(255, 211, 43, 0.4) !important;
    z-index: 100 !important;
}

.timeline-section > div:hover, .timeline-section > div.hover {
    border-color: rgba(255, 211, 43, 0.5) !important;
    box-shadow: 0 0 60px rgba(255, 211, 43, 0.2) !important;
    transform: scale(1.05) !important;
    z-index: 100 !important;
}

.chat-input button {
    transition: all 0.2s ease;
}

.chat-input button:hover {
    background-color: #fef08a !important;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 211, 43, 0.4);
}

.chat-input button:active {
    transform: scale(0.95);
}

.engine-card:hover .engine-icon img {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

.stage-label:hover span {
    filter: brightness(1.2);
}

.deploy-status { opacity: 0; transition: all 0.3s ease; }
.deploy-status.highlight-active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ========================================
   TIMELINE SECTION
   ======================================== */

.timeline-section > div { transition: all 0.3s ease; }

.qflows-bar, .traditional-bar { width: 0; }

.animation-running .qflows-bar {
    animation: qflowsFill 1.4s ease-out forwards, qflowsGlow 3s ease-in-out infinite 1.4s;
}
.animation-running .traditional-bar {
    animation: traditionalFill var(--cycle-duration, 15s) linear forwards;
}

@keyframes qflowsFill { 0% { width: 0; } 100% { width: 100%; } }
@keyframes traditionalFill { 0% { width: 0; } 100% { width: 100%; } }
@keyframes qflowsGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 211, 43, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 211, 43, 0.5), 0 0 30px rgba(255, 211, 43, 0.2); }
}

/* ========================================
   MOBILE & RESPONSIVE LAYOUT
   ======================================== */

@media (min-width: 1024px) {
    .mobile-layout { display: none !important; }
    .desktop-layout { display: block !important; }
}

@media (max-width: 1023px) {
    .mobile-layout { display: block !important; }
    .desktop-layout { display: none !important; }
    
    /* Hide connectors on mobile as requested */
    .mobile-layout .scroll-connector { display: none !important; }
}

/* Mobile Horizontal Scroll */
.horizontal-scroll-container {
    overflow-x: hidden;
    overflow-y: visible;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.horizontal-scroll-container::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome/Safari */

.horizontal-scroll-content {
    display: flex;
    align-items: stretch;
    min-width: max-content;
    padding: 0.5rem 0 3rem 0; /* Remove horizontal padding, increase bottom padding to prevent clipping */
    gap: 0; /* Remove gap so stages act as full pages */
}

.scroll-stage {
    scroll-snap-align: center;
    flex-shrink: 0;
    width: 100vw; /* Full viewport width */
    max-width: none; /* Remove constraint to allow full centering */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    min-height: 380px;
}

/* Ensure content remains a reasonable size within the full-width stage */
.scroll-stage .stage-content {
    width: 100%;
    max-width: 320px;
}

.scroll-stage .stage-label {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 0.5rem;
}

.scroll-connector {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}
.scroll-connector.flex-col {
    flex-direction: column;
    padding: 0 0.5rem;
}
.scroll-connector.flex-col .connection-beam { margin-bottom: 0; }

/* Mobile Pagination Dots */
.scroll-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0.75rem 0;
}
.scroll-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.scroll-dot.active { transform: scale(1.3); border-color: transparent; }

.scroll-dot.dot-cyan { border-color: rgba(6, 182, 212, 0.3); }
.scroll-dot.dot-violet { border-color: rgba(139, 92, 246, 0.3); }
.scroll-dot.dot-yellow { border-color: rgba(255, 211, 43, 0.3); }

.scroll-dot.dot-cyan.active { background: #06b6d4; }
.scroll-dot.dot-violet.active { background: #8b5cf6; }
.scroll-dot.dot-yellow.active { background: #ffd32b; }

/* Mobile Component Tweaks */
.compact-api-card { padding: 0.5rem 0.75rem !important; }
.compact-api-card .api-items { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.75rem; }
.compact-api-card .api-item { font-size: 10px; }
.compact-api-card .api-item .rounded-full { width: 4px; height: 4px; }

.generate-stage .stage-content { display: flex; flex-direction: column; gap: 0.5rem; }
.generate-stage .api-card, .generate-stage .engine-card { width: 100%; }

.compact-engine-card { padding: 0.75rem !important; }
.compact-engine-card .engine-icon { width: 48px !important; height: 48px !important; margin-bottom: 0.5rem !important; }
.compact-engine-card .engine-icon img { width: 36px !important; height: 36px !important; }

.deploy-stage .devices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    max-width: 200px;
}
.deploy-stage .device-inner { padding: 0.5rem; }
.deploy-stage .device-icon { width: 24px; height: 24px; margin-bottom: 0.25rem; }
.deploy-stage .device-icon i { width: 14px; height: 14px; }
.deploy-stage .device-card .text-xs { font-size: 10px; }
.deploy-stage .device-card .text-\[10px\] { font-size: 9px; }

.compact-qr-box { padding: 0.5rem 0.75rem !important; gap: 0.5rem !important; }
.compact-qr-box .w-10 { width: 32px !important; height: 32px !important; }
.compact-qr-box .w-10 i { width: 18px !important; height: 18px !important; }

@media (max-width: 768px) {
    .timeline-row { flex-direction: column !important; gap: 0.5rem !important; text-align: center; }
    .timeline-row > div { width: auto !important; text-align: center !important; }
}

.d-none { display: none !important; }