/* ========================================================
   WHAT'S NEW PAGE — SPLIT SCREEN EXPANDING GALLERY
   fasterpen/assets/css/whatsnew.css
   ======================================================== */

/* ---- Layout ---- */
.split-container {
    --fp-blue: #0651ed;
    --fp-blue-deep: #123fba;
    --fp-brand-dark: #19274e;
    --fp-navy: #0a1128;
    --fp-ink: #25344f;
    --fp-muted: #63718a;
    --fp-line: #dbe6f7;
    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%;
    width: 40%;
    /* Adjust left image width here */
    max-width: 400px;
    /* Adjust left image max-width here */
}

.panel-right .product-showcase-container {
    right: -2%;
    width: 38%;
    /* Adjust right image width here */
    max-width: 400px;
    /* Adjust right image max-width here */
}

.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);
}

.fp-product-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fp-product-grid--whatsnew {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fp-product-card {
    background: #fff;
    border: 1px solid #e4edf9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fp-product-card:hover {
    border-color: #c8d9f3;
    box-shadow: 0 18px 38px rgba(20, 39, 78, .08);
    transform: translateY(-1px);
}

.fp-product-card__media {
    align-items: center;
    aspect-ratio: 1.16;
    background: #f7faff;
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
}

.fp-product-card__image {
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform .35s cubic-bezier(.16, 1, .3, 1);
    width: 100%;
}

.fp-product-card:hover .fp-product-card__image {
    transform: scale(1.025);
}

.fp-product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 19px 20px 20px;
    text-align: left;
}

.fp-product-card__meta {
    align-items: center;
    color: var(--fp-blue);
    display: flex;
    font-size: 11px;
    font-weight: 700;
    gap: 10px;
    justify-content: space-between;
    letter-spacing: .08em;
    min-height: 22px;
    text-transform: uppercase;
}

.fp-product-card__meta small {
    color: #8a98ad;
    letter-spacing: 0;
    text-transform: none;
}

.fp-product-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.26;
    margin: 12px 0 9px;
    text-align: left;
}

.fp-product-card h3 a {
    color: var(--fp-navy);
    text-decoration: none;
}

.fp-product-card p {
    color: #5f6f85;
    flex: 1;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 18px;
    text-align: left;
}

.fp-product-card__actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.fp-text-link {
    color: var(--fp-blue);
    font-size: 14px;
    font-weight: 700;
    transition: color .18s ease;
    text-decoration: none;
}

.fp-text-link:hover {
    color: var(--fp-navy);
}

.fp-chip-link {
    background: #edf4ff;
    border: 1px solid #c7d9fa;
    border-radius: 8px;
    color: #0b3ea9;
    font-size: 13px;
    font-weight: 700;
    min-height: 38px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fp-chip-link:hover {
    background: var(--fp-blue);
    border-color: var(--fp-blue);
    box-shadow: 0 12px 20px rgba(6, 81, 237, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.fp-empty-state {
    background: #f7faff;
    border: 1px dashed #b9cbed;
    border-radius: 8px;
    color: #50617a;
    font-weight: 700;
    margin: 0;
    padding: 28px;
    text-align: center;
}

.fp-empty-state--whatsnew {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.fp-empty-state--whatsnew-dark {
    color: rgba(191, 219, 254, 0.72);
}

/* ---- 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;
    }

    .fp-product-grid--whatsnew {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .fp-product-grid--whatsnew {
        grid-template-columns: minmax(0, 1fr);
    }
}
