/* Bento Grid Component Styles - EXACT implementation from bento-grid.md */

/* Container */
.bento-demo-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Grid - EXACT from specification: "grid w-full auto-rows-[22rem] grid-cols-3 gap-4" */
.bento-grid {
    display: grid;
    width: 100%;
    max-width: 1200px;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 22rem; /* auto-rows-[22rem] */
    gap: 1rem; /* gap-4 */
    margin: 0 auto;
}

.lg-grid-rows-3 {
    grid-template-rows: repeat(3, 1fr);
}

/* BentoCard - EXACT from specification */
.bento-card {
    position: relative;
    grid-column: span 3; /* col-span-3 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-radius: 0.75rem; /* rounded-xl */
    
    /* Light styles - EXACT from spec */
    background: white; /* bg-white */
    box-shadow: 0 0 0 1px rgba(0,0,0,.03), 0 2px 4px rgba(0,0,0,.05), 0 12px 24px rgba(0,0,0,.05);
    
    /* Dark styles - EXACT from spec */
    /* transform-gpu dark:bg-black dark:[border:1px_solid_rgba(255,255,255,.1)] dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] */
    transform: translateZ(0); /* transform-gpu */
    will-change: transform;
    transition: all 0.3s ease;
}

/* Background - EXACT positioning */
.bento-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

/* Full background image - EXACT from spec */
.bento-background-full {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Show background on hover - EXACT from spec */
.bento-card:hover .bento-background-full {
    opacity: 0.6;
}

/* Ensure all images in bento cards are visible */
.bento-card img {
    display: block !important;
    visibility: visible !important;
}

.opacity-60 {
    opacity: 0.6;
}

/* Content wrapper - EXACT from spec: "pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300 group-hover:-translate-y-10" */
.bento-content-wrapper {
    pointer-events: none;
    z-index: 10;
    display: flex;
    transform: translateZ(0); /* transform-gpu */
    flex-direction: column;
    gap: 0.25rem; /* gap-1 */
    padding: 1.5rem; /* p-6 */
    transition: all 0.3s ease; /* transition-all duration-300 */
}

.bento-card:hover .bento-content-wrapper {
    transform: translateY(-2.5rem); /* group-hover:-translate-y-10 */
}

/* Icon - EXACT from spec: "h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75" */
.bento-icon {
    height: 3rem; /* h-12 */
    width: 3rem; /* w-12 */
    transform-origin: left; /* origin-left */
    transform: translateZ(0); /* transform-gpu */
    color: #374151; /* text-neutral-700 */
    transition: all 0.3s ease-in-out; /* transition-all duration-300 ease-in-out */
}

.bento-card:hover .bento-icon {
    transform: scale(0.75); /* group-hover:scale-75 */
}

/* Title - EXACT from spec: "text-xl font-semibold text-neutral-700 dark:text-neutral-300" */
.bento-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: #374151; /* text-neutral-700 */
    margin: 0;
}

/* Description - EXACT from spec: "max-w-lg text-neutral-400" */
.bento-description {
    max-width: 32rem; /* max-w-lg */
    color: #9ca3af; /* text-neutral-400 */
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* CTA wrapper - EXACT from spec: "pointer-events-none absolute bottom-0 flex w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100" */
.bento-cta-wrapper {
    pointer-events: none;
    position: absolute;
    bottom: 0;
    display: flex;
    width: 100%;
    transform: translateY(2.5rem) translateZ(0); /* translate-y-10 transform-gpu */
    flex-direction: row;
    align-items: center;
    padding: 1rem; /* p-4 */
    opacity: 0;
    transition: all 0.3s ease; /* transition-all duration-300 */
}

.bento-card:hover .bento-cta-wrapper {
    transform: translateY(0) translateZ(0); /* group-hover:translate-y-0 */
    opacity: 1; /* group-hover:opacity-100 */
}

/* Button - EXACT from spec: Button variant="ghost" asChild size="sm" className="pointer-events-auto" */
.bento-button {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: colors 0.15s ease-in-out;
    background: transparent; /* variant="ghost" */
    color: inherit;
    text-decoration: none;
    padding: 0.5rem 0.75rem; /* size="sm" */
    height: 2.25rem;
}

.bento-button:hover {
    background: rgba(0, 0, 0, 0.05); /* ghost hover */
    color: inherit;
    text-decoration: none;
}

.bento-arrow {
    margin-left: 0.5rem; /* ml-2 */
    width: 1rem; /* h-4 w-4 */
    height: 1rem;
}

/* Overlay - EXACT from spec: "pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10" */
.bento-overlay {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* inset-0 */
    transform: translateZ(0); /* transform-gpu */
    transition: all 0.3s ease; /* transition-all duration-300 */
    z-index: 5;
}

.bento-card:hover .bento-overlay {
    background: rgba(0, 0, 0, 0.03); /* group-hover:bg-black/[.03] */
}

/* EXACT Grid positioning from demo.tsx */
.lg-row-start-1 { grid-row-start: 1; }
.lg-row-end-4 { grid-row-end: 4; }
.lg-row-start-2 { grid-row-start: 2; }
.lg-row-end-3 { grid-row-end: 3; }
.lg-row-start-3 { grid-row-start: 3; }
.lg-row-end-2 { grid-row-end: 2; }

.lg-col-start-1 { grid-column-start: 1; }
.lg-col-end-2 { grid-column-end: 2; }
.lg-col-start-2 { grid-column-start: 2; }
.lg-col-end-3 { grid-column-end: 3; }
.lg-col-start-3 { grid-column-start: 3; }

/* Dark mode - EXACT from spec */
@media (prefers-color-scheme: dark) {
    .bento-demo-container {
        background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    }
    
    .bento-card {
        background: black; /* dark:bg-black */
        border: 1px solid rgba(255,255,255,.1); /* dark:[border:1px_solid_rgba(255,255,255,.1)] */
        box-shadow: 0 -20px 80px -20px rgba(255,255,255,0.12) inset; /* dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset] */
    }
    
    .bento-title {
        color: #d1d5db; /* dark:text-neutral-300 */
    }
    
    .bento-icon {
        color: #d1d5db;
    }
    
    .bento-card:hover .bento-overlay {
        background: rgba(115, 115, 115, 0.1); /* group-hover:dark:bg-neutral-800/10 */
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 18rem;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .bento-demo-container {
        padding: 1rem;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 16rem;
        gap: 0.5rem;
    }
    
    .bento-content-wrapper {
        padding: 1rem;
    }
    
    .bento-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .bento-title {
        font-size: 1.125rem;
    }
    
    .bento-description {
        font-size: 0.8rem;
    }
}
