/* =========================================================
   INDUSTRIES GLASSMORPHISM - CONTINUOUS LOOP VERSION
========================================================= */

.industries-glassmorphism-section {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
    overflow: hidden;
}

/* --- THE CONTINUOUS TYPING ANIMATION --- 
   Total Duration: 18 seconds 
   (3s typing + 15s waiting)
------------------------------------------ */
.industries-title {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #fff;
    width: 0;
    /* 18s total cycle: typing happens in first 15%, stays still for 80%, resets at 100% */
    animation:
        continuousTyping 18s steps(40, end) infinite,
        blinkCaret .75s step-end infinite;
}

@keyframes continuousTyping {
    0% {
        width: 0;
    }

    /* Start hidden */
    15% {
        width: 100%;
    }

    /* Finish typing (approx 2.7s) */
    90% {
        width: 100%;
    }

    /* Stay visible for 15 seconds */
    95%,
    100% {
        width: 0;
    }

    /* Disappear quickly and restart */
}

@keyframes blinkCaret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #fff;
    }
}

@keyframes fadeLeftToRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- MASTER GRID (LAPTOP/DESKTOP VIEW) --- */
.industries-grid {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 15px;
    align-items: stretch;
}

.industry-featured {
    width: 100%;
    height: 100% !important;
    min-height: 100% !important;
    border-radius: 30px !important;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeLeftToRight 0.8s ease forwards;
    animation-delay: 0.2s;
}

.industry-small-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.industry-card {
    border-radius: 20px !important;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    height: 80px !important;
    opacity: 0;
    animation: fadeLeftToRight 0.8s ease forwards;
}

/* Staggered load for cards */
.industry-card:nth-child(1) {
    animation-delay: 0.3s;
}

.industry-card:nth-child(2) {
    animation-delay: 0.4s;
}

.industry-card:nth-child(3) {
    animation-delay: 0.5s;
}

.industry-card:nth-child(4) {
    animation-delay: 0.6s;
}

.industry-card:nth-child(5) {
    animation-delay: 0.7s;
}

.industry-card:nth-child(6) {
    animation-delay: 0.8s;
}

.industry-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 10px;
    z-index: 3;
}

.industry-card-title {
    font-size: 11px !important;
    line-height: 1.1;
    margin: 0 0 4px 0 !important;
}

.industry-btn-sm {
    font-size: 9px !important;
    padding: 2px 6px !important;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* =========================================================
   RESPONSIVE SETTINGS - TABLET & MOBILE
========================================================= */

@media (max-width: 991px) {
    .industries-grid {
        grid-template-columns: 1fr;
    }

    .industry-featured {
        height: 280px !important;
        margin-bottom: 10px;
    }

    .industry-small-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* On mobile, we stop forcing the typing text to one line to prevent overflow */
    .industries-title {
        font-size: 24px !important;
        white-space: normal;
        width: 100% !important;
        border-right: none;
        animation: fadeLeftToRight 1s ease forwards;
        /* Use standard fade on mobile */
    }
}

@media (max-width: 767px) {
    .industry-small-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .industry-card {
        height: 90px !important;
    }
}

@media (max-width: 480px) {
    .industry-small-grid {
        grid-template-columns: 1fr;
        /* Stack cards vertically on small phones */
    }
}