.ward-algorithm-section {
    padding: 80px 0;
}

.algorithm-cards-container {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px 0;
}

.algorithm-card {
    flex: 1;
    min-width: 212px;
    max-width: 212px;
    background: white;
    border: 1px solid #00c08b;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.3s ease;
    position: relative;
    height: auto;
}

.algorithm-card.expanded {
    min-height: auto;
}

.algorithm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 192, 139, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    justify-content: space-between;
}

.step-number {
    width: 60px;
    height: 60px;
    background: #00c08b;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #111928;
    line-height: 1.4;
    margin: 0;
    flex-shrink: 0;
}

.card-description-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.card-description-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #111928;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-description-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    transition: all 0.3s ease;
}

.card-description-list li:before {
    content: "•";
    color: #00c08b;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

.card-description-list .hidden-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
}

.algorithm-card.expanded .hidden-content {
    margin-bottom: 8px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #00c08b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: auto;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background-color: rgba(0, 192, 139, 0.1);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .algorithm-cards-container {
        gap: 15px;
    }
    
    .algorithm-card {
        min-width: 200px;
        max-width: 200px;
    }
}

@media (max-width: 992px) {
    .algorithm-cards-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .algorithm-card {
        min-width: 280px;
        max-width: 350px;
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .ward-algorithm-section {
        padding: 60px 0;
    }
    
    .algorithm-cards-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .algorithm-card {
        min-width: 100%;
        max-width: 100%;
        flex: none;
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .ward-algorithm-section {
        padding: 40px 0;
    }
    
    .algorithm-card {
        padding: 12px;
        gap: 20px;
        min-height: 260px;
    }
    
    .card-header {
        gap: 12px;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-description-list {
        font-size: 13px;
    }
    
    .toggle-btn {
        font-size: 13px;
    }
}

/* Animation Classes */
.algorithm-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.algorithm-card:nth-child(1) { animation-delay: 0.1s; }
.algorithm-card:nth-child(2) { animation-delay: 0.2s; }
.algorithm-card:nth-child(3) { animation-delay: 0.3s; }
.algorithm-card:nth-child(4) { animation-delay: 0.4s; }
.algorithm-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling for horizontal scroll on mobile */
.algorithm-cards-container::-webkit-scrollbar {
    height: 8px;
}

.algorithm-cards-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.algorithm-cards-container::-webkit-scrollbar-thumb {
    background: #00c08b;
    border-radius: 4px;
}

.algorithm-cards-container::-webkit-scrollbar-thumb:hover {
    background: #00a076;
}
