/* Section + background layers */
.features-section {
    overflow: hidden;
    z-index: 1;
    background-color: #1a1a1a;
    padding: 50px 0 100px 0;
}

.features-single-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(180deg, rgba(7, 14, 18, 0.6) 0%, rgba(7, 14, 18, 0.65) 35%, rgba(7, 14, 18, 0.7) 100%),
                url('../assets/img/city-bg.jpeg') center center / cover no-repeat;
    image-rendering: optimizeQuality;
    pointer-events: none;
}

.features-single-bg--video {
    background: linear-gradient(180deg, rgba(7, 14, 18, 0.6) 0%, rgba(7, 14, 18, 0.65) 35%, rgba(7, 14, 18, 0.7) 100%);
}

.features-single-bg::before,
.features-single-bg::after {
    content: '';
    position: absolute;
    inset: -10%;
    background: conic-gradient(from 45deg, rgba(64, 184, 145, 0.08), rgba(88, 178, 255, 0.08), rgba(255, 99, 158, 0.08), rgba(64, 184, 145, 0.08));
    filter: blur(55px);
    animation: sweepGlow 18s linear infinite;
    mix-blend-mode: screen;
    z-index: 1;
}

.features-single-bg::after {
    animation-direction: reverse;
    animation-duration: 24s;
    opacity: 0.5;
    mix-blend-mode: screen;
}

@keyframes sweepGlow {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Clouds */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 100px;
    animation: moveClouds linear infinite;
}

.cloud::after, .cloud::before {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

/* Cloud Shape 1: Standard Fluffy */
.cloud-1 {
    width: 120px; height: 40px;
    top: 10%; left: -150px;
    animation-duration: 35s;
    opacity: 0.9;
}
.cloud-1::after { width: 50px; height: 50px; top: -25px; left: 20px; }
.cloud-1::before { width: 70px; height: 70px; top: -35px; left: 45px; }

/* Cloud Shape 2: Small & Long */
.cloud-2 {
    width: 100px; height: 30px;
    top: 25%; left: -150px;
    animation-duration: 45s;
    animation-delay: 5s;
    opacity: 0.7;
}
.cloud-2::after { width: 40px; height: 40px; top: -20px; left: 15px; }
.cloud-2::before { width: 50px; height: 50px; top: -25px; left: 35px; }

/* Cloud Shape 3: Large & Slow */
.cloud-3 {
    width: 180px; height: 60px;
    top: 15%; left: -250px;
    animation-duration: 60s;
    animation-delay: 2s;
    opacity: 0.8;
}
.cloud-3::after { width: 70px; height: 70px; top: -35px; left: 30px; }
.cloud-3::before { width: 90px; height: 90px; top: -50px; left: 60px; }

/* Cloud Shape 4: Tiny & Fast */
.cloud-4 {
    width: 80px; height: 25px;
    top: 5%; left: -100px;
    animation-duration: 25s;
    animation-delay: 10s;
    opacity: 0.6;
}
.cloud-4::after { width: 30px; height: 30px; top: -15px; left: 10px; }
.cloud-4::before { width: 40px; height: 40px; top: -20px; left: 25px; }

/* Cloud Shape 5: Low & Wide */
.cloud-5 {
    width: 140px; height: 45px;
    top: 35%; left: -200px;
    animation-duration: 50s;
    animation-delay: 15s;
    opacity: 0.5;
}
.cloud-5::after { width: 55px; height: 55px; top: -25px; left: 25px; }
.cloud-5::before { width: 75px; height: 75px; top: -35px; left: 50px; }

@keyframes moveClouds {
    0% { transform: translateX(0); }
    100% { transform: translateX(120vw); }
}

/* City Silhouette (Static) */
.city-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background-image: url('../assets/img/building-bg.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom center;
    image-rendering: optimizeQuality;
    z-index: 1;
    opacity: 1;
}

.features-single-bg .cloud,
.features-single-bg .city-silhouette {
    display: none;
}

.features-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(76, 209, 149, 0.28), rgba(0,0,0,0) 40%),
                radial-gradient(circle at 85% 25%, rgba(88, 178, 255, 0.24), rgba(0,0,0,0) 38%),
                radial-gradient(circle at 50% 85%, rgba(255, 99, 158, 0.26), rgba(0,0,0,0) 36%);
    z-index: 0;
    pointer-events: none;
    animation: auroraGlow 14s ease-in-out infinite alternate;
}

.features-video-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    z-index: 0;
}

.features-section.fallback-glow .features-single-bg {
    background-color: #0f1920;
}

@keyframes auroraGlow {
    0% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(-6px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.9; }
}

.features-content {
    z-index: 10;
}

.features-heading {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Base styles (Mobile first approach) */
.feature-img-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;

    /* Centering logic */
    margin: 0 auto;
}

.feature-card:hover .feature-img-wrapper {
    transform: scale(1.1);
}

.feature-img-wrapper img {
    max-width: 80%;
    max-height: 80%;
}

.feature-card .card-body {
    padding-top: 0.4rem;
    padding-bottom: 0.6rem;
}

.feature-card .card-title {
    margin-bottom: 0.4rem;
}

.feature-glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Default (Desktop) Styles */
.features-slider-wrapper {
    position: relative;
    padding-bottom: 0;
}

.features-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.feature-slide {
    width: 100%;
}

.features-nav,
.features-dots {
    display: none;
}

/* Desktop Specific Overrides for Images */
@media (min-width: 768px) {
    .feature-img-wrapper {
        width: 100%;
        max-width: 400px; /* 160px * 2.5 */
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .feature-img-wrapper img {
        max-width: 60%;
        max-height: 60%;
    }
}

/* Mobile Styles */
@media (max-width: 767px) {
    .features-slider-wrapper {
        overflow: hidden;
    }

    .features-track {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0;
        transition: transform 0.5s ease-in-out;
    }

    .feature-slide {
        width: 100%;
        flex-shrink: 0;
        padding: 15px;
        box-sizing: border-box;
    }

    .features-nav {
        display: block;
    }

    .features-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #fff;
        font-size: 2rem;
        cursor: pointer;
        z-index: 10;
        padding: 10px;
    }

    .features-arrow.prev {
        left: -10px;
    }

    .features-arrow.next {
        right: -10px;
    }

    .features-dots {
        display: flex;
        justify-content: center;
        margin-top: 1.5rem;
    }

    .features-dots .dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.3);
        margin: 0 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
    }

    .features-dots .dot.active {
        background-color: #fff;
        transform: scale(1.2);
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1200px) {
    .features-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
