/* ============================================
   Features Grid Section - Zencia.AI
   ============================================ */

/* Features Section */
.features-section {
    position: relative;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #0f1419 0%, #082928 100%);
    overflow: hidden;
}

/* Animated background */
.features-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    background-image: url('../../images/application-bvg.svg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.4;
    filter: brightness(0.8);
}

/* Animated gradient overlay */
.features-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(0, 217, 213, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0, 139, 139, 0.15) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
    z-index: 2;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(50px, 30px) scale(1.1);
        opacity: 0.8;
    }
}

.features-container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
}

/* Section Header */
.features-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.features-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.2;
}

.features-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Features Grid - Bento Box Layout */
.features-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

/* Feature Card Base */
.feature-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 213, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 217, 213, 0.5);
    box-shadow: 0 20px 60px rgba(0, 217, 213, 0.3);
}

/* Card Accent Glow */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #00D9D5 0%, #40E0D0 100%);
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Grid Layout Variations */
.feature-card.large {
    grid-column: span 6;
    min-height: 350px;
}

.feature-card.medium {
    grid-column: span 6;
    min-height: 300px;
}

.feature-card.small {
    grid-column: span 6;
    min-height: 280px;
}

/* Feature Content */
.feature-content {
    z-index: 2;
    position: relative;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00D9D5 0%, #40E0D0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #FFFFFF;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.feature-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Feature Image Container */
.feature-image {
    position: relative;
    width: 100%;
    height: auto;
    margin-top: auto;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.4s ease;
}

.feature-card:hover .feature-image img {
    transform: scale(1.05);
}

/* Image Overlay for better text readability */
.feature-card.has-image {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%),
                rgba(255, 255, 255, 0.05);
}

/* Staggered Animation */
.feature-card:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.feature-card:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.feature-card:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.feature-card:nth-child(4) {
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .features-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .feature-card.large,
    .feature-card.medium,
    .feature-card.small {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .features-section {
        padding: 4rem 1.5rem;
    }

    .features-header {
        margin-bottom: 3rem;
    }

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

    .feature-card.large,
    .feature-card.medium,
    .feature-card.small {
        grid-column: span 1;
        min-height: auto;
    }

    .feature-card {
        padding: 2rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .feature-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .features-section {
        padding: 3rem 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-description {
        font-size: 0.95rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}