/* Product Pages Specific CSS */

/* Scroll Snap */
html {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 40px;
}

/* Hero Section for Product Pages */
.hero {
    min-height: calc(100vh - 5rem);
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    padding: 4rem 0 6rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    flex: 1;
}

.hero-video {
    flex: 1;
}

.hero-title {
    font-size: var(--font-size-5xl);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow:0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Video Optimization */
video {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

/* How It Works Section */
.how-it-works {
    min-height: 100vh;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    padding: 6rem 0 4rem 0;
    text-align: center;
}

.typing-animation-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
}

.typing-message-box {
    border-radius: 16px;
    padding: 1.5rem 2rem;
    display: inline-block;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.typing-text {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    min-height: 1.5em;
    display: inline-block;
}

.typing-cursor {
    font-size: var(--font-size-2xl);
    color: var(--primary);
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

/* Steps Section */
.how-it-works-steps {
    min-height: 100vh;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    padding: 6rem 0 4rem 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    text-align: center;
}

.step-image {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
}

.step-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.step h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Scanning Animation */
.scanning-lens {
    position: absolute;
    top: 0;
    left: -50px;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(66, 165, 245, 0.3), transparent);
    animation: scanMove 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanMove {
    0% {
        left: -50px;
    }
    50% {
        left: 200px;
    }
    100% {
        left: -50px;
    }
}

/* How to Use Section */
.how-to-use {
    min-height: 100vh;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    padding: 6rem 0 4rem 0;
}

.how-to-use-content {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

.interface-side,
.api-side {
    flex: 1;
}

.interface-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 16px;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.interface-image:hover {
    transform: translateY(-10px) scale(1.02);
}

/* API Integration Grid */
.api-integration-grid {
    width: 100%;
    max-width: 400px;
    max-height: 200px;
    aspect-ratio: 1.33;
    margin: 0 auto;
    border-radius: 16px;
    background: var(--background-light);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1rem;
    padding: 2rem;
    align-items: center;
    justify-items: center;
}

.api-integration-grid img {
    width: 80px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.api-integration-grid img:hover {
    transform: scale(1.1);
}

.api-side img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Chat Message Animation */
.chat-message {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Match homepage hero responsiveness and invert order on mobile */
    .hero {
        padding: 1rem 0 2rem;
        min-height: calc(100vh - 4rem);
    }

    .hero .hero-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }

    /* Ensure media shows first, then text, on mobile */
    .hero .hero-video { order: 1; width: 100% !important; }
    .hero .hero-text { order: 2; width: 100% !important; }

    .hero-title { font-size: var(--font-size-4xl); }

    .hero-actions { justify-content: center; }

    /* How To Use section mobile */
    .how-to-use-content {
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .interface-side,
    .api-side {
        width: 100% !important;
    }

    .interface-image,
    .api-side img {
        max-width: 100% !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    /* Adjust section padding for mobile */
    .how-to-use,
    .how-it-works-steps,
    .how-it-works {
        padding-top: 6rem !important;
        min-height: calc(100vh - 2rem) !important;
    }

    /* Steps grid mobile */
    .steps-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .step-image {
        width: 150px !important;
        height: 150px !important;
    }

    /* Typing message box mobile */
    .typing-message-box {
        padding: 1rem 1.5rem !important;
        max-width: 90% !important;
        margin: 0 auto !important;
    }

    .typing-text,
    .typing-cursor {
        font-size: var(--font-size-lg) !important;
    }

    .typing-animation-container {
        min-height: 50px;
    }

    /* Stack buttons vertically on mobile */
    .how-to-use div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center !important;
    }
    
    .how-to-use .btn {
        width: auto !important;
        min-width: 200px !important;
        font-size: 0.9rem !important;
        padding: 0.75rem 1.5rem !important;
    }

    /* Interface side mobile adjustments */
    .interface-side {
        margin-bottom: 3rem !important;
    }

    /* How to Use section header mobile */
    .how-to-use .section-header p {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .step-image {
        width: 120px !important;
        height: 120px !important;
    }

    /* Step 3 text content mobile */
    .step:nth-child(3) .step-image > div {
        font-size: 0.5rem !important;
        line-height: 1.1 !important;
    }

    .cta-actions {
        flex-direction: column;
        gap: 1rem;
    }
}