/* Shared public marketing surface styles for the homepage and generated SEO templates. */

/* =====================================================
   CAROUSEL COMPONENT
   Transformation carousel showing CAD to rendered comparisons
   ===================================================== */

#carousel-section {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--spacing-xl) 0;
    margin: 0;
    min-height: auto;
    box-sizing: border-box;
    overflow: visible !important;
    isolation: auto;
    background-color: var(--color-bg-tertiary);
    contain: layout style;
}

#carousel-section > * {
    max-height: none;
    height: auto;
    overflow: visible;
}

/* --- CAROUSEL STYLES --- */
#transformation-carousel {
    width: 100%;
    height: 312px; /* Original carousel height */
    min-height: 312px;
    max-height: 312px;
    position: relative;
    overflow: visible !important;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    opacity: 0;
    transition: opacity 0.8s ease-out;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    isolation: auto;
    margin: 0; /* Remove margin - section padding handles spacing */
    align-self: center; /* Center within flex container */
    /* Performance: contain to prevent reflows during animation */
    contain: layout style;
}

#transformation-carousel.loaded {
    opacity: 1;
}

#transformation-carousel.dragging {
    cursor: grabbing;
}

/* Simple black rectangle divider with drop shadow */
#transformation-carousel .carousel-divider {
    position: absolute;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: #000000;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.4);
    overflow: visible;
}

/* Carousel items with shadows */
#transformation-carousel .carousel-item {
    max-height: 100%;
    overflow: hidden; /* Clip image to border-radius */
    border-radius: var(--radius-md); /* Match site-wide radius (2px micro-chamfer) */
    position: relative;
    /* Use filter drop-shadow instead of box-shadow to work with clip-path */
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Apply border-radius to carousel images */
#transformation-carousel .carousel-item img {
    border-radius: var(--radius-md); /* Match site-wide radius (2px micro-chamfer) */
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Greyscale filter for CAD (before) images on the left side */
#transformation-carousel .cad-inner .carousel-item img {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}

/* Ensure parent containers allow shadows to be visible */
/* Performance: GPU-accelerate the animated inner containers */
#transformation-carousel .cad-inner,
#transformation-carousel .ai-inner,
#transformation-carousel > div {
    overflow: visible;
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Allow shadows to extend beyond clip-path boundaries */
#transformation-carousel > div[style*="clip-path"] {
    overflow: visible !important;
}

/* Items themselves need overflow hidden for content, but shadows extend beyond */
#transformation-carousel .carousel-item {
    overflow: hidden;
    position: relative;
}

#transformation-carousel .carousel-divider,
#transformation-carousel .carousel-divider * {
    overflow: visible;
    clip-path: none;
}

#carousel-section,
#carousel-section * {
    z-index: 1;
}

#transformation-carousel {
    z-index: 1;
}

#transformation-carousel * {
    z-index: 1;
}

/* Fixed height - no responsive changes */
/* =====================================================
   FLOATING TOOL COMPONENT
   Simplified UI for the browser extension floating tool
   ===================================================== */

.rendercad-floating-tool {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
    padding: 2rem 0;
}

/* Modal Container */
.rendercad-loading-modal {
    position: relative;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0;
    color: white;
    font-family: 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                0 0 8px rgba(0, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 320px;
    min-height: 60px;
    user-select: none;
}

/* Header */
.rendercad-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 50px;
    padding: 18px 8px 12px 8px;
    margin: 0 0 12px 0;
}

.rendercad-header-content {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
}

/* Logo Wrapper */
.rendercad-logo-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 0.25rem;
    width: 40.128px;
    height: 33.44px;
    font-size: 33.44px;
}

.rendercad-logo {
    width: 40.128px;
    height: 33.44px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    vertical-align: middle;
    display: block;
    position: relative;
}

.rendercad-logo-wrapper .tm {
    position: absolute;
    top: 96.8%;
    right: -4.98%;
    font-size: 0.585em;
    line-height: 0;
    font-family: 'Proxima Nova Thin', 'Inter', sans-serif;
    font-weight: 300;
    opacity: 0.9;
    color: #f50057;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

/* Title */
.rendercad-title-wrapper {
    font-family: 'Proxima Nova Thin', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    font-size: 30.096px;
    letter-spacing: -0.01em;
    line-height: 1;
    position: relative;
}

.rendercad-title-wrapper .tm {
    font-family: 'Proxima Nova Thin', 'Inter', sans-serif;
    font-size: 0.65em;
    font-weight: 300;
    vertical-align: baseline;
    position: relative;
    top: -0.3em;
    margin-left: 0.1em;
    line-height: 0;
    opacity: 0.9;
}

/* Hamburger Menu Button */
.rendercad-hamburger-button {
    position: absolute;
    top: 6px;
    right: 8px;
    background: linear-gradient(-75deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    z-index: 1000002;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05),
                inset 0 -1px 1px rgba(255, 255, 255, 0.5),
                0 2px 4px rgba(0, 0, 0, 0.2);
}

.rendercad-hamburger-button:hover {
    background: linear-gradient(-75deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05), inset 0 -1px 1px rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Camera Button (left side, inside modal) */
.rendercad-camera-button {
    position: absolute;
    top: 12px;
    left: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(-75deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0 6px 6px 0;
    color: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    z-index: 1000003;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05),
                inset 0 -1px 1px rgba(255, 255, 255, 0.5),
                0 2px 4px rgba(0, 0, 0, 0.2);
}

.rendercad-camera-button:hover {
    background: linear-gradient(-75deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05), inset 0 -1px 1px rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rendercad-tool-icon {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

/* Content Wrapper */
.rendercad-content-wrapper {
    padding: 0 15px 15px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Horizontal Loading Bar (Divider) */
.rendercad-divider {
    position: relative;
    width: 100%;
    height: 2px;
    overflow: visible;
    margin-top: 8px;
    margin-bottom: 0;
    transform: scaleX(1);
    opacity: 1;
    transform-origin: left center;
}

.rendercad-divider-base {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.rendercad-divider-dark-core {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 1px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
    pointer-events: none;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.rendercad-divider-glow {
    position: absolute;
    top: 0;
    height: 100%;
    left: 0;
    width: 100%;
    border-radius: 1px;
    background: linear-gradient(90deg, transparent 0%, transparent 1.5%, cyan 8%, #faff70 20%, pink 32%, #faff70 44%, cyan 50%, #faff70 56%, pink 68%, #faff70 80%, cyan 92%, transparent 98.5%, transparent 100%);
    background-size: 400% 100%;
    background-position: 0% 0%;
    filter: blur(2px);
    opacity: 1;
    z-index: 3;
    pointer-events: none;
    animation: rendercad-divider-glow 3s linear infinite;
}

@keyframes rendercad-divider-glow {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 400% 0%;
    }
}

/* ==================== THEME INVERTED SECTION ==================== */
/* Inverts the color scheme: dark in light mode, light in dark mode */

.feature-section.theme-inverted {
    --color-bg-primary: var(--home-section-inverted-bg);
    --color-bg-secondary: var(--home-section-inverted-surface);
    --color-text-primary: var(--home-section-inverted-text);
    --color-text-secondary: var(--home-section-inverted-text-secondary);
    --color-text-muted: var(--home-section-inverted-text-muted);
    --color-border-light: var(--home-section-inverted-border-light);
    --color-border-medium: var(--home-section-inverted-border-medium);

    background-color: var(--color-bg-primary);
}

/* Narrow section variant - compact vertical spacing */
.feature-section.narrow {
    padding: var(--spacing-md) 0;
}

/* AI Engine section specific styles */
.ai-engine-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xs) var(--spacing-md);
}

.ai-engine-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.ai-engine-description {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    max-width: 650px;
    margin: 0 auto;
}

/* ==================== FULL VIDEO SECTIONS ==================== */

.full-video-section {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--color-bg-primary);
}

.full-video-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    box-sizing: border-box;
    max-width: 980px;
    min-height: clamp(7rem, 12vw, 9rem);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.5rem) var(--spacing-md);
    text-align: center;
}

.full-video-title {
    margin: 0;
    color: var(--color-text-primary);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: 0;
    text-transform: uppercase;
}

.full-video-description {
    max-width: 900px;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

.full-video-media {
    --full-video-content-scale: 1.76;
    --full-video-unfold-overlap: clamp(4rem, 8vw, 7rem);
    --full-video-edge-fade-width: 30vw;
    --full-video-edge-fade-color: var(--color-bg-primary);

    position: relative;
    width: 100%;
    height: calc(var(--full-video-copy-height, clamp(7rem, 12vw, 9rem)) * 2);
    overflow: hidden;
    isolation: isolate;
    background: var(--color-bg-primary);
}

.full-video-media::before,
.full-video-media::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 4;
    width: var(--full-video-edge-fade-width);
    pointer-events: none;
}

.full-video-media::before {
    left: 0;
    background: linear-gradient(to right, var(--full-video-edge-fade-color), transparent);
}

.full-video-media::after {
    right: 0;
    background: linear-gradient(to left, var(--full-video-edge-fade-color), transparent);
}

.full-video-media .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-position: center center;
}

.full-video-media .full-video-primary {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: auto;
    height: calc(100% * var(--full-video-content-scale));
    aspect-ratio: 16 / 9;
    max-width: none;
    min-width: 0;
    z-index: 2;
    object-fit: fill;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--full-video-unfold-overlap), #000 calc(100% - var(--full-video-unfold-overlap)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--full-video-unfold-overlap), #000 calc(100% - var(--full-video-unfold-overlap)), transparent 100%);
    transform: translate(-50%, -50%);
}

.full-video-media .full-video-unfold {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: auto;
    height: calc(100% * var(--full-video-content-scale));
    aspect-ratio: 16 / 9;
    max-width: none;
    min-width: 0;
    object-fit: fill;
    opacity: 1;
    filter: blur(12px);
    transform-origin: center;
}

.full-video-media .full-video-unfold {
    z-index: 1;
}

.full-video-media .full-video-unfold-left {
    transform: translate(calc(-150% + var(--full-video-unfold-overlap)), -50%) scaleX(-1);
}

.full-video-media .full-video-unfold-right {
    transform: translate(calc(50% - var(--full-video-unfold-overlap)), -50%) scaleX(-1);
}

/* ==================== SPLIT VIDEO SECTIONS ==================== */

.split-video-section {
    --split-video-panel-bg: var(--color-brand-primary);
    --split-video-panel-color: var(--color-text-inverse);
    --split-video-panel-muted: color-mix(in srgb, var(--split-video-panel-color) 74%, transparent);
    --split-video-canvas-bg: var(--color-bg-secondary);
    --split-video-canvas-color: var(--color-text-primary);
    --split-video-canvas-muted: var(--color-text-secondary);
    --split-video-height: clamp(28rem, 48vw, 42rem);

    display: grid;
    width: 100%;
    height: var(--split-video-height);
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--split-video-panel-bg);
}

[data-theme="dark"] .split-video-section {
    --split-video-canvas-bg: var(--color-brand-primary);
    --split-video-canvas-color: var(--color-text-inverse);
    --split-video-canvas-muted: color-mix(in srgb, var(--split-video-canvas-color) 70%, transparent);
}

.split-video-section.video-left {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    grid-template-areas: "media copy";
}

.split-video-section.video-right {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    grid-template-areas: "copy media";
}

.split-video-media {
    grid-area: media;
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--split-video-canvas-bg);
}

.split-video-media .hero-video {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: var(--split-video-object-position, center);
}

.split-video-copy {
    grid-area: copy;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: clamp(2rem, 3.5vw, 4rem) clamp(1.5rem, 2.6vw, 3rem);
    color: var(--split-video-panel-color);
    background: var(--split-video-panel-bg);
}

.split-video-title {
    margin: 0;
    color: inherit;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: clamp(1.6rem, 2.65vw, 3.1rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0;
    text-transform: uppercase;
}

.split-video-title .glitch-effect {
    color: inherit;
}

.split-video-description {
    margin: 0;
    color: var(--split-video-panel-muted);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.55;
}

.split-video-section.video-overlay {
    --split-video-panel-bg: var(--split-video-canvas-bg);
    --split-video-panel-color: var(--split-video-canvas-color);
    --split-video-panel-muted: var(--split-video-canvas-muted);

    position: relative;
    display: block;
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-overlay .split-video-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-overlay .split-video-media .hero-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: var(--split-video-object-position, left center);
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-overlay .split-video-copy {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(25rem, 25vw);
    color: var(--split-video-panel-color);
    background: transparent;
}

.split-video-section.video-overlay .split-video-description {
    color: var(--split-video-panel-muted);
}

.split-video-section.video-fifty {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "media copy";
    height: auto;
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-fifty.copy-left {
    grid-template-areas: "copy media";
}

.split-video-section.video-fifty .split-video-media {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    aspect-ratio: 16 / 9;
    min-height: 0;
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-fifty .split-video-media .hero-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
    background: var(--split-video-canvas-bg);
}

.split-video-section.video-fifty .split-video-copy {
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--split-video-panel-color);
    background: var(--split-video-panel-bg);
}

.split-video-section.video-fifty .split-video-description {
    color: var(--split-video-panel-muted);
}

.split-video-section.video-fifty.copy-left .split-video-media .hero-video {
    object-position: right center;
}

@media (max-width: 968px) {
    .split-video-section,
    .split-video-section.video-left,
    .split-video-section.video-right {
        grid-template-columns: 1fr;
        grid-template-areas:
            "media"
            "copy";
        height: auto;
    }

    .split-video-media {
        min-height: clamp(18rem, 58vw, 28rem);
    }

    .split-video-copy {
        min-height: 0;
        padding: clamp(2rem, 8vw, 3rem) clamp(1.5rem, 6vw, 2.5rem);
    }

    .split-video-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .split-video-section.video-overlay {
        display: block;
        height: clamp(24rem, 82vw, 34rem);
        background: var(--split-video-canvas-bg);
    }

    .split-video-section.video-overlay .split-video-media {
        position: absolute;
        min-height: 0;
    }

    .split-video-section.video-overlay .split-video-copy {
        position: absolute;
        inset: auto 0 0 0;
        width: 100%;
        min-height: 0;
        justify-content: flex-end;
        padding: clamp(1.5rem, 7vw, 2.5rem);
        background: transparent;
    }

    .split-video-section.video-fifty {
        grid-template-columns: 1fr;
        grid-template-areas:
            "media"
            "copy";
        height: auto;
        background: var(--split-video-canvas-bg);
    }

    .split-video-section.video-fifty.copy-left {
        grid-template-areas:
            "copy"
            "media";
    }

    .split-video-section.video-fifty .split-video-media {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
    }

    .split-video-section.video-fifty .split-video-copy {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .split-video-media {
        min-height: 16rem;
    }
}
