/* Card fixes with optimized mosaic layout for perfect card arrangement */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 15px;
    margin-top: 40px;
}

/* Base card styles */
.feature-card {
    position: relative;
    overflow: hidden;
    border-radius: 0px;
    background-color: var(--card-bg);
    box-shadow: none !important;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100% !important;
    width: 100% !important;
}

/* Tailored mosaic layout - cards positioned specifically for optimal arrangement */
/* First row */
.feature-card:nth-child(1) {
    grid-column: 1 / span 4;
    grid-row: 1 / span 2;
}

.feature-card:nth-child(2) {
    grid-column: 5 / span 8;
    grid-row: 1 / span 2;
}

/* Second row */
.feature-card:nth-child(3) {
    grid-column: 1 / span 3;
    grid-row: 3 / span 2;
}

.feature-card:nth-child(4) {
    grid-column: 4 / span 5;
    grid-row: 3 / span 4;
}

.feature-card:nth-child(5) {
    grid-column: 9 / span 4;
    grid-row: 3 / span 2;
}

/* Third row */
.feature-card:nth-child(6) {
    grid-column: 1 / span 3;
    grid-row: 5 / span 2;
}

.feature-card:nth-child(7) {
    grid-column: 9 / span 4;
    grid-row: 5 / span 2;
}

/* Fourth row */
.feature-card:nth-child(8) {
    grid-column: 1 / span 5;
    grid-row: 7 / span 2;
}

.feature-card:nth-child(9) {
    grid-column: 6 / span 7;
    grid-row: 7 / span 2;
}

/* Override for wide class if still needed */
.feature-card.wide {
    width: 100% !important;
}

/* Enhanced glowing border animation */
.feature-card::before {
    content: '';
    position: absolute;
    inset: 1px; /* covers entire area */
    padding: 3px; /* border width */
    border-radius: 0px;
    background: linear-gradient( /* Smoother and slightly softer gradient */
        135deg,
        rgba(255, 120, 70, 0.85) 0%,  /* Softer Orange */
        rgba(255, 180, 90, 0.9) 25%,  /* Lighter Orange/Yellow */
        rgba(100, 150, 255, 0.9) 50%, /* Softer Blue */
        rgba(150, 200, 255, 0.9) 75%, /* Lighter Blue */
        rgba(255, 120, 70, 0.85) 100% /* Softer Orange */
    );
    background-size: 400% 400%; /* Increased size for smoother animation travel */
    animation: borderGlow 8s linear infinite; /* Slightly slower animation */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    filter: drop-shadow(0 0 8px rgba(255, 140, 60, 0.35)) drop-shadow(0 0 8px rgba(120, 170, 255, 0.35)); /* Softer, more spread-out shadows */
}

/* Shimmering light effect along the border */
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 3px;
    border-radius: 0px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 2;
    opacity: 0;
    animation: shimmerEffect 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes shimmerEffect {
    0% {
        opacity: 0;
        background-position: -100% 0;
    }
    20% {
        opacity: 0.8;
    }
    40% {
        opacity: 0;
    }
    100% {
        background-position: 200% 0;
        opacity: 0;
    }
}

/* Card content needs higher z-index to appear above the glow effects */
.card-content {
    position: relative;
    z-index: 5;
    background: linear-gradient(to top, var(--card-bg) 0%, rgba(22, 23, 27, 0.9) 70%, rgba(22, 23, 27, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 24px;
}

/* Enhanced glow shadow on card */
.feature-card {
    box-shadow: 
        0 0 20px rgba(255, 95, 11, 0.1),
        0 0 20px rgba(61, 126, 255, 0.1) !important;
}

/* Hover effects */
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 0 25px rgba(255, 95, 11, 0.3),
        0 0 25px rgba(61, 126, 255, 0.3) !important;
    z-index: 10;
}

.feature-card:hover::before {
    animation: borderGlow 3s linear infinite;
    background: linear-gradient(
        135deg, 
        rgba(255, 95, 11, 1) 0%, 
        rgba(255, 217, 112, 1) 25%,
        rgba(61, 126, 255, 1) 50%, 
        rgba(112, 215, 255, 1) 75%,
        rgba(255, 95, 11, 1) 100%
    );
    filter: drop-shadow(0 0 8px rgba(255, 95, 11, 0.7)) drop-shadow(0 0 8px rgba(61, 126, 255, 0.7));
}

.feature-card:hover::after {
    opacity: 0;
    /* animation: shimmerEffect 2s ease-in-out infinite; */
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 1200px) {
    .feature-cards {
        grid-template-columns: repeat(6, 1fr);
    }
    
    /* First row */
    .feature-card:nth-child(1) {
        grid-column: 1 / span 3;
        grid-row: 1 / span 2;
    }
    
    .feature-card:nth-child(2) {
        grid-column: 4 / span 3;
        grid-row: 1 / span 2;
    }
    
    /* Second row */
    .feature-card:nth-child(3) {
        grid-column: 1 / span 2;
        grid-row: 3 / span 2;
    }
    
    .feature-card:nth-child(4) {
        grid-column: 3 / span 4;
        grid-row: 3 / span 2;
    }
    
    /* Third row */
    .feature-card:nth-child(5) {
        grid-column: 1 / span 3;
        grid-row: 5 / span 2;
    }
    
    .feature-card:nth-child(6) {
        grid-column: 4 / span 3;
        grid-row: 5 / span 2;
    }
    
    /* Fourth row and beyond - vertical stack */
    .feature-card:nth-child(n+7) {
        grid-column: 1 / span 6;
        grid-row: auto / span 2;
    }
}

@media (max-width: 768px) {
    .feature-cards {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
    }
    
    .feature-card:nth-child(n) {
        grid-column: 1;
        grid-row: auto;
    }
} 