/* =====================================================
   PRODUCT SHOWCASE — Scroll-animated feature sections
   Sysdig-inspired: real screenshots with zoom/reveal
   ===================================================== */

/* Showcase Section */
.product-showcase {
    padding: 0;
    background: var(--dark-bg);
    position: relative;
    overflow: hidden;
}

.product-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, var(--light-section-bg-alt), var(--dark-bg));
    pointer-events: none;
    z-index: 1;
}

/* Individual feature block */
.showcase-feature {
    padding: 100px 0;
    position: relative;
}

.showcase-feature:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.showcase-feature .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.showcase-feature--reversed .container {
    direction: rtl;
}

.showcase-feature--reversed .container > * {
    direction: ltr;
}

/* Text side */
.showcase-text {
    position: relative;
    z-index: 2;
}

.showcase-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 1rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(217, 70, 239, 0.3);
    border-radius: 50px;
    background: rgba(217, 70, 239, 0.08);
}

.showcase-text h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.showcase-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.showcase-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.showcase-bullets li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.showcase-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 8px;
    height: 8px;
    background: var(--gradient-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--glow-secondary);
}

.showcase-bullets li strong {
    color: var(--text-primary);
}

/* Screenshot side */
.showcase-screenshot {
    position: relative;
    perspective: 1200px;
    min-width: 0;
}

.screenshot-frame {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 80px rgba(114, 9, 183, 0.08);
    will-change: transform, opacity;
}

.screenshot-frame.animate-in {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.screenshot-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* Glow effect behind screenshot */
.screenshot-glow {
    position: absolute;
    top: 10%;
    left: -5%;
    right: -5%;
    bottom: 10%;
    background: radial-gradient(ellipse at center,
        rgba(114, 9, 183, 0.15) 0%,
        rgba(181, 23, 158, 0.08) 40%,
        transparent 70%);
    filter: blur(40px);
    z-index: -1;
}

/* Floating highlight badge on screenshots */
.screenshot-highlight {
    position: absolute;
    background: rgba(10, 6, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(114, 9, 183, 0.4);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.screenshot-highlight .highlight-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}

.screenshot-highlight .highlight-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.screenshot-highlight--critical .highlight-value { color: #ef4444; }
.screenshot-highlight--success .highlight-value { color: #22c55e; }
.screenshot-highlight--accent .highlight-value { color: var(--accent-color); }

/* Pulse ring on highlight */
.screenshot-highlight::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 2px solid rgba(114, 9, 183, 0.3);
    border-radius: 12px;
    animation: highlight-pulse 2s ease-in-out infinite;
}

@keyframes highlight-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.08); }
}

/* Zoom effect placeholder */
.screenshot-zoom-trigger {
    position: absolute;
    border: 2px dashed rgba(114, 9, 183, 0.4);
    border-radius: 8px;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease 1.2s;
}

.showcase-in-view .screenshot-zoom-trigger {
    opacity: 1;
}

.screenshot-zoom-trigger:hover {
    border-color: var(--accent-color);
    background: rgba(114, 9, 183, 0.1);
}

/* Hero image upgrade */
.hero-image-showcase {
    flex: 0 1 560px;
    min-width: 0;
    position: relative;
}

.hero-image-showcase img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 80px rgba(114, 9, 183, 0.12);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image-showcase:hover img {
    transform: translateY(-4px) scale(1.01);
}

.hero-image-showcase .screenshot-glow {
    opacity: 0.7;
}

/* Stats callout on hero screenshot */
.hero-stats-overlay {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0;
    background: rgba(10, 6, 24, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(114, 9, 183, 0.3);
    border-radius: 12px;
    padding: 0.75rem 0;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero-stat {
    padding: 0 1.25rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat:last-child {
    border-right: none;
}

.hero-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-stat-value--critical { color: #ef4444; }
.hero-stat-value--warn { color: #f97316; }
.hero-stat-value--info { color: #3b82f6; }
.hero-stat-value--success { color: #22c55e; }

.hero-stat-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Free tier CTA banner */
.free-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(90deg, rgba(114, 9, 183, 0.12), rgba(181, 23, 158, 0.12));
    border-top: 1px solid rgba(114, 9, 183, 0.2);
    border-bottom: 1px solid rgba(114, 9, 183, 0.2);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.free-banner strong {
    color: var(--text-primary);
}

.free-banner a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.free-banner a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .showcase-feature .container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .showcase-feature--reversed .container {
        direction: ltr;
    }

    .showcase-text h2 {
        font-size: 1.75rem;
    }

    .showcase-feature {
        padding: 60px 0;
    }

    .hero-image-showcase {
        flex: 0 1 100%;
        max-width: 100%;
    }

    .showcase-screenshot {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .hero-stats-overlay {
        bottom: -12px;
        padding: 0.5rem 0;
    }

    .hero-stat {
        padding: 0 0.75rem;
    }

    .hero-stat-value {
        font-size: 0.9rem;
    }

    .screenshot-highlight {
        display: none;
    }

    .free-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
}

/* =====================================================
   Feature Demo Cards
   ===================================================== */

.panel-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.panel-dot--red { background: #ef4444; }
.panel-dot--yellow { background: #eab308; }
.panel-dot--green { background: #22c55e; }

.panel-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.attack-path-panel,
.ai-explorer-panel {
    background: rgba(10, 6, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.feature-demo-card {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(217, 70, 239, 0.1), transparent 40%),
        rgba(10, 6, 24, 0.96);
}

.feature-demo-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center top;
    background: #0a0618;
}

.feature-demo-video::-webkit-media-controls {
    display: none !important;
}

/* Scroll-triggered animations — JS adds .showcase-in-view to the parent [data-showcase] */

/* Text elements start hidden */
[data-showcase] .showcase-label,
[data-showcase] .showcase-text h2,
[data-showcase] .showcase-text p,
[data-showcase] .showcase-bullets li {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Screenshot starts scaled down */
[data-showcase] .screenshot-frame {
    transform: scale(0.92) translateY(30px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease;
}

/* When in view — reveal everything with stagger */
.showcase-in-view .screenshot-frame {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.showcase-in-view .showcase-screenshot {
    /* Triggers highlight animations via CSS */
}

.showcase-in-view .showcase-label { opacity: 1; transform: translateY(0); transition-delay: 0s; }
.showcase-in-view .showcase-text h2 { opacity: 1; transform: translateY(0); transition-delay: 0.08s; }
.showcase-in-view .showcase-text p { opacity: 1; transform: translateY(0); transition-delay: 0.16s; }
.showcase-in-view .showcase-bullets li:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.24s; }
.showcase-in-view .showcase-bullets li:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.32s; }
.showcase-in-view .showcase-bullets li:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.40s; }

/* Highlight badges also trigger from parent */
.showcase-in-view .screenshot-highlight {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Override the initial hidden state for highlights — set in parent scope */
[data-showcase] .screenshot-highlight {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.5s ease 0.8s,
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

/* Screenshot glow */
[data-showcase] .screenshot-glow {
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.showcase-in-view .screenshot-glow {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .screenshot-frame,
    .screenshot-glow,
    [data-showcase] .showcase-label,
    [data-showcase] .showcase-text h2,
    [data-showcase] .showcase-text p,
    [data-showcase] .showcase-bullets li,
    [data-showcase] .screenshot-highlight {
        transition: none;
        opacity: 1 !important;
        transform: none !important;
    }

    .screenshot-highlight,
    [data-showcase] .screenshot-highlight {
        animation: none;
        opacity: 1 !important;
        transform: none !important;
    }

    .screenshot-highlight::before {
        animation: none;
    }
}

/* =====================================================
   LIGHTBOX — Click-to-enlarge product screenshots
   ===================================================== */

/* Clickable cursor on screenshot frames */
[data-lightbox],
[data-lightbox-video] {
    cursor: zoom-in;
}

[data-lightbox]:hover,
[data-lightbox-video]:hover {
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(114, 9, 183, 0.4),
        0 0 80px rgba(114, 9, 183, 0.12);
}

[data-lightbox]:focus-visible,
[data-lightbox-video]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

/* Overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.lightbox-open {
    opacity: 1;
    visibility: visible;
}

/* Image */
.lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.lightbox-open .lightbox-img {
    transform: scale(1);
}

/* Video */
.lightbox-video {
    display: none;
    max-width: 92vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    background: #0a0618;
}

.lightbox-open .lightbox-video {
    transform: scale(1);
}

.lightbox-open.lightbox-mode-video .lightbox-video {
    display: block;
}

.lightbox-open.lightbox-mode-video .lightbox-img {
    display: none;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Hint label */
[data-lightbox]::after,
[data-lightbox-video]::after {
    content: 'Click to enlarge';
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(10, 6, 24, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 5;
}

[data-lightbox]:hover::after,
[data-lightbox-video]:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    .lightbox-overlay {
        padding: 1rem;
    }

    .lightbox-img {
        max-width: 98vw;
        max-height: 85vh;
    }

    [data-lightbox]::after,
    [data-lightbox-video]::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-overlay {
        transition: none;
    }

    .lightbox-img,
    .lightbox-video {
        transform: none;
    }
}
