/**
 * Bento Grid Styles
 */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: var(--space-lg);
    margin-bottom: var(--space-4xl);
}

/* Layout Bento selon cahier des charges */
.bento-grid {
    grid-template-areas:
        "large large medium1 medium1"
        "large large medium2 medium2"
        "small1 small2 small3 small4";
}

.bento-card {
    background: var(--dark-secondary);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    /* État initial caché avant l'animation */
    opacity: 0;
}

/* Icône en arrière-plan */
.bento-card .card-icon-bg {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 180px;
    height: 180px;
    opacity: 0.05 !important; /* Forcer l'opacité faible */
    z-index: 0;
    pointer-events: none;
    transition: all var(--transition-base);
}

.bento-small .card-icon-bg {
    width: 120px;
    height: 120px;
    top: -20px;
    right: -20px;
}

.bento-card:hover .card-icon-bg {
    opacity: 0.08 !important;
    transform: scale(1.1) rotate(5deg);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-xl);
}

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

.bento-card > * {
    position: relative;
    z-index: 1;
}

/* Tailles de cartes avec grid-area */
.bento-large {
    grid-area: large;
    min-height: 400px;
}

.bento-medium:nth-of-type(2) {
    grid-area: medium1;
}

.bento-medium:nth-of-type(3) {
    grid-area: medium2;
}

.bento-small:nth-of-type(4) {
    grid-area: small1;
}

.bento-small:nth-of-type(5) {
    grid-area: small2;
}

.bento-small:nth-of-type(6) {
    grid-area: small3;
}

.bento-small:nth-of-type(7) {
    grid-area: small4;
}

.card-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-lg);
    display: none; /* Masquer l'icône principale, on utilise l'arrière-plan */
}

.card-icon svg {
    color: var(--primary);
}

.card-icon img {
    filter: brightness(0) saturate(100%) invert(45%) sepia(84%) saturate(2556%) hue-rotate(229deg) brightness(102%) contrast(92%);
    transition: filter var(--transition-base);
}

.card-icon-bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(45%) sepia(84%) saturate(2556%) hue-rotate(229deg) brightness(102%) contrast(92%);
}

.bento-card:hover .card-icon img {
    filter: brightness(0) saturate(100%) invert(52%) sepia(100%) saturate(2843%) hue-rotate(229deg) brightness(105%) contrast(91%);
}

.card-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--white);
}

.bento-small .card-title {
    font-size: var(--text-xl);
}

.card-description {
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    font-size: var(--text-base);
}

.bento-small .card-description {
    font-size: var(--text-sm);
}

.card-features {
    list-style: none;
    margin-top: var(--space-lg);
}

.card-features li {
    color: var(--gray-300);
    margin-bottom: var(--space-sm);
    font-size: var(--text-sm);
}

.card-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--gradient-primary);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-top: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.tag {
    padding: var(--space-xs) var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--primary-light);
}

.card-timeline {
    margin-top: var(--space-lg);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--gray-800);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-week {
    font-weight: 600;
    color: var(--primary-light);
    font-size: var(--text-sm);
}

.timeline-task {
    color: var(--gray-400);
    font-size: var(--text-sm);
}

/* Responsive Bento Grid */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "large large"
            "large large"
            "medium1 medium1"
            "medium2 medium2"
            "small1 small2"
            "small3 small4";
    }
    
    .bento-large {
        min-height: 300px;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "large"
            "medium1"
            "medium2"
            "small1"
            "small2"
            "small3"
            "small4";
    }
    
    .bento-large {
        min-height: 250px;
    }
    
    .bento-card {
        min-height: 180px;
    }
}

