/* Grid Blocks Styling - Puzzle-piece slide animation like Render's site */

#blocksContainer {
    position: fixed !important;
    top: 0 !important;
    right: -56px !important;
    width: 360px;
    max-height: 400px;
    z-index: 99999 !important;
    pointer-events: auto !important;
    overflow: visible;
}

.grid-container {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    line-height: 0; /* Eliminate line-height gaps */
}

.grid-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    font-size: 0; /* Eliminate whitespace gaps between inline elements */
}

/* Fillable blocks - ALL get same borders for consistent sizing */
.grid-square {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    position: relative;
    box-sizing: border-box;
    /* All blocks get all 4 borders - some transparent for alignment */
    border: 1px solid transparent;
    border-right-color: rgba(77, 77, 77, 0.25);
    border-bottom-color: rgba(77, 77, 77, 0.25);
    background-color: transparent;
    overflow: hidden;
    cursor: cell;
    pointer-events: auto !important;
}

/* First fillable block in EVERY row: make left border visible */
.grid-square.first-fillable {
    border-left-color: rgba(77, 77, 77, 0.25) !important;
}

/* First fillable in rows 1, 2, 5, 7: also make top border visible */
.grid-row:nth-child(1) .first-fillable,
.grid-row:nth-child(2) .first-fillable,
.grid-row:nth-child(5) .first-fillable,
.grid-row:nth-child(7) .first-fillable {
    border-top-color: rgba(77, 77, 77, 0.25) !important;
}

.grid-square::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%; /* Start off-screen */
    width: 100%;
    height: 100%;
    background: var(--block-image) no-repeat center center;
    background-size: cover;
    opacity: 0;
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.grid-square:hover::before {
    left: 0; /* Slide to position */
    opacity: 1;
}

/* Empty blocks - same border structure as grid-square for perfect alignment */
.false-square {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: transparent;
    border: 1px solid transparent; /* Same as grid-square, all transparent */
    pointer-events: none;
}

.hanging-border {
    width: 100%;
    height: 100%;
}

.fade-in {
    animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive - hide on smaller screens */
@media (max-width: 1200px) {
    #blocksContainer {
        width: 315px;
    }

    .grid-square,
    .false-square {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 900px) {
    #blocksContainer {
        display: none !important;
    }
}
