/* ========================================================
   SUPPORTING PAGE — SPLIT SCREEN EXPANDING GALLERY
   fasterpen/assets/css/supporting.css
   ======================================================== */

/* ---- Layout ---- */
.split-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 90px);
    min-height: 700px;
    overflow: hidden;
    position: relative;
}

.split-panel {
    position: relative;
    flex: 1;
    display: flex;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Hover physics — disabled when gallery is open */
@media (hover: hover) and (pointer: fine) {
    .split-container:not(.gallery-active):hover .split-panel {
        filter: grayscale(80%) brightness(0.6);
        flex: 0.8;
    }

    .split-container:not(.gallery-active) .split-panel:hover {
        filter: grayscale(0%) brightness(1);
        flex: 1.2;
    }
}

/* ---- Panel Backgrounds ---- */
.panel-left {
    background-color: #f4f7fc;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    --shadow-color: rgba(6, 81, 237, 0.2);
}

.panel-right {
    background-color: #19274e;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    --shadow-color: rgba(0, 240, 255, 0.15);
}

/* ---- Floating Animations ---- */
.float-slow  { animation: fp-float 8s ease-in-out infinite; }
.float-fast  { animation: fp-float 5s ease-in-out infinite reverse; }
.float-delay { animation: fp-float 7s ease-in-out infinite 2s; }
.spin-slow   { animation: fp-spin 30s linear infinite; }

@keyframes fp-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-20px) rotate(5deg); }
}

@keyframes fp-spin {
    100% { transform: rotate(360deg); }
}

/* Marker draw SVG path */
.marker-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.split-panel:hover .marker-draw {
    animation: fp-draw 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fp-draw {
    to { stroke-dashoffset: 0; }
}

/* ---- 3D Product Showcase ---- */
.product-showcase-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35%;
    max-width: 350px;
    z-index: 5;
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-left  .product-showcase-container { left: 2%; }
.panel-right .product-showcase-container { right: 2%; }

.split-container:not(.gallery-active) .split-panel:hover .product-showcase-container {
    transform: translateY(-50%) scale(1.05);
}

.product-float-3d {
    width: 100%;
    height: auto;
    object-fit: contain;
    animation: fp-float3d 6s ease-in-out infinite;
    will-change: transform, filter;
    -webkit-backface-visibility: hidden;
}

@keyframes fp-float3d {
    0%, 100% {
        transform: perspective(1200px) translateY(0px) rotateY(-5deg) rotateX(2deg) rotateZ(-1deg);
        filter: drop-shadow(15px 25px 20px var(--shadow-color));
    }
    50% {
        transform: perspective(1200px) translateY(-15px) rotateY(5deg) rotateX(-2deg) rotateZ(1deg);
        filter: drop-shadow(5px 35px 25px var(--shadow-color));
    }
}

/* ---- Panel Overlays ---- */
.panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.panel-left .panel-overlay {
    background: linear-gradient(to right, rgba(244, 247, 252, 0.95) 0%, rgba(244, 247, 252, 0.3) 100%);
}

.panel-right .panel-overlay {
    background: linear-gradient(to left, rgba(25, 39, 78, 0.95) 0%, rgba(25, 39, 78, 0.5) 100%);
}

.content-z { position: relative; z-index: 10; }

/* ---- View States ---- */
.view-hero {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-gallery {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Worksheets (left) open */
.is-worksheets-open .panel-right {
    flex: 0;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}
.is-worksheets-open .panel-left { flex: 1; }
.is-worksheets-open .panel-left .view-hero {
    opacity: 0;
    visibility: hidden;
    transform: translateX(100px);
    pointer-events: none;
}
.is-worksheets-open .panel-left .view-gallery {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}
.panel-left .view-gallery { transform: translateX(-100px); }

/* Blocks (right) open */
.is-blocks-open .panel-left {
    flex: 0;
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}
.is-blocks-open .panel-right { flex: 1; }
.is-blocks-open .panel-right .view-hero {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100px);
    pointer-events: none;
}
.is-blocks-open .panel-right .view-gallery {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}
.panel-right .view-gallery { transform: translateX(100px); }

/* ---- Gallery UI ---- */
.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.custom-scrollbar::-webkit-scrollbar       { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 10px;
}
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(6, 81, 237, 0.5);
}

/* A4 card ratio */
.placeholder-card {
    aspect-ratio: 1 / 1.414;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.placeholder-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ---- Mobile ---- */
@media (max-width: 1024px) {
    .split-container:not(.gallery-active) {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .split-container:not(.gallery-active) .split-panel {
        min-height: 500px;
        flex: none !important;
        filter: none !important;
    }

    .view-hero { padding: 4rem 2rem; }

    .panel-left .panel-overlay {
        background: linear-gradient(to bottom, rgba(244, 247, 252, 0.95) 0%, rgba(244, 247, 252, 0.4) 100%);
    }
    .panel-right .panel-overlay {
        background: linear-gradient(to bottom, rgba(25, 39, 78, 0.95) 0%, rgba(25, 39, 78, 0.5) 100%);
    }

    .marker-draw {
        animation: fp-draw 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        animation-delay: 0.5s;
    }

    .product-showcase-container {
        width: 70%;
        max-width: 300px;
        left: 50% !important;
        right: auto !important;
        top: 40%;
        transform: translate(-50%, -50%) !important;
        opacity: 0.15;
        z-index: 0;
    }

    .view-gallery { flex-direction: column; }

    .gallery-sidebar {
        width: 100% !important;
        height: auto !important;
        padding: 1rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    .gallery-sidebar .vertical-text {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 1.5rem !important;
    }

    .gallery-grid-area {
        width: 100% !important;
        padding: 1.5rem !important;
    }
}
