/* GridMotion.css */
#grid-motion-container {
    position: relative;
    width: 80%;
    max-width: 1500px;
    margin: 40px auto;
    height: 660px;
    overflow: hidden;
    background: #000;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.grid-rows-container {
    display: flex;
    flex-direction: column;
    width: 120%;
    /* Wider than container to avoid edge gaps */
    height: 120%;
    justify-content: center;
    gap: 20px;
    transform: rotate(-5deg) scale(1.05);
    /* Slight tilt for style */
}

/* Individual Rows */
.grid-row-track {
    display: flex;
    width: 100%;
    gap: 20px;
    will-change: transform;
    /* Critical for smooth animation */
}

/* Cards */
.grid-card {
    position: relative;
    height: 160px;
    /* Fixed height for rows */
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    /* Fallback color while loading */
    cursor: pointer;
    opacity: 0.6;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Skeleton Loader - Shimmer Effect */
.grid-card.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.grid-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.grid-card:hover {
    transform: scale(1.05);
    opacity: 1;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

/* Overlay Elements */
.grid-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 50;
    border-radius: 24px;
}

/* Centered Content Overlay */
.grid-content-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
    color: white;
    pointer-events: none;
    width: 100%;
    padding: 20px;
}

.grid-content-overlay h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
    letter-spacing: -1px;
}

.grid-content-overlay p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    font-weight: 500;
}

.grid-content-overlay a {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    background: white;
    color: black;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.grid-content-overlay a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: #f8f8f8;
}