/* ============================================
   NEW BENTO GRID - FRESH DESIGN
   ============================================ */

/* Container */
.bento-container {
    width: 90vw;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 2;
    overflow: visible;
}

/* Grid Base - 3 columns, fixed rows */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 380px;
    gap: 1.25rem;
    width: 100%;
    overflow: visible;
}

/* Card Wrapper - Parent container for each card */
.bento-card-wrapper {
    position: relative;
    overflow: visible;
    z-index: 10;
    height: 380px;
}

/* Hovered wrapper gets highest z-index */
.bento-card-wrapper:hover {
    z-index: 200;
}

/* All cards same size, no special positioning */
.bento-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(40, 40, 45, 1) 0%, rgba(30, 30, 35, 1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    height: 380px;
    opacity: 1;
    z-index: 10;

    /* Entrance animation */
    animation: slideUp 0.6s ease-out forwards;
}

/* Fade, blur and darken other cards when any card is hovered */
.bento-grid:has(.bento-card:hover) .bento-card:not(:hover) {
    opacity: 0.05;
    filter: blur(4px) brightness(0.3);
}

/* Staggered entrance */
.bento-card-wrapper:nth-child(1) .bento-card { animation-delay: 0.1s; }
.bento-card-wrapper:nth-child(2) .bento-card { animation-delay: 0.15s; }
.bento-card-wrapper:nth-child(3) .bento-card { animation-delay: 0.2s; }
.bento-card-wrapper:nth-child(4) .bento-card { animation-delay: 0.25s; }
.bento-card-wrapper:nth-child(5) .bento-card { animation-delay: 0.3s; }
.bento-card-wrapper:nth-child(6) .bento-card { animation-delay: 0.35s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* After animation completes, ensure card stays visible */
.bento-card.loaded {
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: none !important;
}

/* Hover state - scale and spotlight with dark gray gradient */
.bento-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.8);
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.98) 0%, rgba(45, 45, 52, 0.98) 100%);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 100 !important;
}

/* Gradient overlays */
.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.bento-card:hover::before {
    opacity: 1;
}

/* Glow effect */
.bento-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.bento-card:hover::after {
    opacity: 1;
}

/* Card Hover Images - Outside cards, inside wrapper */
.bento-card-hover-image {
    position: absolute;
    top: -15px;
    width: 380px;
    height: auto;
    opacity: 0.4;
    visibility: visible;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    z-index: 5;
}

/* All images centered above their cards */
.bento-card-hover-image {
    left: 50%;
    right: auto;
    /* Initial transform set by JavaScript with random rotation */
}

.bento-card-hover-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* Show image fully when hovering wrapper */
.bento-card-wrapper:hover .bento-card-hover-image {
    opacity: 1;
    visibility: visible;
    z-index: 5;
}

/* Background icon */
.bento-card-visual {
    position: absolute;
    top: 50%;
    right: -5%;
    transform: translateY(-50%) rotate(-15deg);
    font-size: clamp(8rem, 15vw, 12rem);
    color: var(--accent-color);
    opacity: 0.05;
    transition: all 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.bento-card:hover .bento-card-visual {
    opacity: 0.08;
    transform: translateY(-50%) rotate(0deg) scale(1.1);
}

.bento-card-visual i {
    display: block;
}

/* Card content */
.bento-card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    overflow: hidden;
}

/* Header section */
.bento-card-header {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Tag */
.bento-card-tag {
    display: inline-block;
    width: fit-content;
    padding: 0.4rem 0.9rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-tag {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* Title */
.bento-card-title {
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-title {
    color: var(--accent-color);
}

/* Description */
.bento-card-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-gray);
    opacity: 0.8;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-description {
    opacity: 1;
}

/* Features list */
.bento-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bento-card-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-features li {
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.bento-card-features li::before {
    content: '→';
    color: var(--accent-color);
    font-weight: bold;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-features li::before {
    opacity: 1;
    transform: translateX(2px);
}

/* Footer */
.bento-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-footer {
    border-color: rgba(99, 102, 241, 0.2);
}

/* CTA */
.bento-card-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-cta {
    gap: 0.7rem;
}

.bento-card-cta i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-card-cta i {
    transform: translateX(4px);
}

/* Icon */
.bento-card-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.bento-card:hover .bento-card-icon {
    color: var(--accent-color);
    transform: scale(1.15) rotate(5deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 640px) {
    .bento-container {
        width: 95vw;
        padding: 1.5rem 0;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bento-card-content {
        padding: 1.5rem;
    }

    .bento-card-title {
        font-size: 1.4rem;
    }

    .bento-card-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .bento-card-features {
        margin-bottom: 1.25rem;
    }

    .bento-card-features li {
        font-size: 0.8rem;
    }
}
